Tuesday, November 13, 2018

Quickly plot a shapefile in Matlab


Are you having a trouble in plotting shapefile in Matlab or the geoshow and mapshow is taking too much time to plot your shapefile then you can use the approach shown below. This is very quick.

shpfile=('landareas.shp');
S1 = shaperead(shpfile);
XX=[];YY=[];
for j=1:length(S1)
%Look for your X and Y variables in your shapefile
XX=[XX S1(j).X;];
YY=[YY S1(j).Y;];
end

plot(XX,YY)

Please leave a comment if you have any problem or if this solution has worked for you.

Related queries:
Plot fast shapefile.
Shapefile hangs, very slow
Quickly view a shapefile in Matlab

Wednesday, May 23, 2018

wget from Google Drive and Dropbox: One line command to download in Linux

Google Drive 
Make sure the link is shared, and it will look something like this:

https://drive.google.com/open?id=FILEID&authuser=0

Then, copy that FILEID and use it like this

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME.EXT



DropBox
When you share a file in Dropbox, the link will look like
https://www.dropbox.com/s/xvuu7a8syeaur0n/FILENAME.EXT?dl=0

replace dl=0 to dl=1 then use the following command to download using wget from Dropbox

wget -O FILENAME.EXT "https://www.dropbox.com/s/xvuu7a8syeaur0n/FILENAME.EXT?dl=1"