point - convert shape file to raster in matlab -


i convert shape file raster grid using matlab. first tried in python have faced difficulties , superior recommended me use matlab. use matlab randomly , pro in it.

the data have ascii file set of points coordinates , want create raster grid them.

i thinking can read data, create empty matrix size of (xmin,ymin,xmax,ymax) data. should assign z value each grid cell based on coordinate of corresponding point.

the grid size should 0.5m . have copied part of data consideration. thankful if me find right way of thinking application.

32511632.00 5402000.00 354.29 17.50 32511632.50 5402000.00 354.29 17.50 32511633.00 5402000.00 354.35 18.00 32511633.50 5402000.00 354.52 15.75 32511634.00 5402000.00 354.70 12.37 32511634.50 5402000.00 354.61 10.62 32511635.00 5402000.00 354.11 8.50 32511635.50 5402000.00 353.43 9.50 32511636.00 5402000.00 352.72 14.25 32511636.50 5402000.00 352.22 17.62 

(the first column x, second y, third z , last in attribute)

isize = floor((ymax - ymin) / 0.5) + 1; jsize = floor((xmax - xmin) / 0.5) + 1 m=zeros(isize, jsize); 

then each input line:

i = floor((y - ymin) / 0.5) + 1; j = floor((x - xmin) / 0.5) + 1; m(i, j) = z; 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -