Creating a shapefile from a set of coordinates

Illustration
febriawan - 2022-01-07T13:24:15+00:00
Question: Creating a shapefile from a set of coordinates

Hi all,     I have a set of rectangular's coord (Xmin,Xmax,Ymin,Ymax) in UTM coord. Could you please tell me how to create a rectangular (or polygon) shapefile based on those coordinates?   Thank you in advance.

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

Xmin = 0. ; Xmax = 1. ;
Ymin = 0. ; Ymax = 1. ;

x = [0 1 1 0]  ;
y = [0 0 1 1] ;

Data.Geometry = 'Polygon' ;
Data.X = x  ;  % latitude
Data.Y = y ;  % longitude
Data.Name = 'Rectangle' ;   % some random attribute/ name

shapewrite(Data, 'myfile.shp')
p = shaperead('myfile.shp')

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!