Creating a shapefile from a set of coordinates

45 次查看(过去 30 天)
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.

采纳的回答

KSSV
KSSV 2018-9-18
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')
  6 个评论
Brittany K
Brittany K 2020-3-23
Hello, I am experiencing similar difficulty. Would either of you know how to plot lat/long points from a single csv file that contains a X , Y, and 3 other variables? Once plotted, I would like to save it as a shapfile with the output in UTM hopefully. -Brittany
Sim
Sim 2022-7-6
编辑:Sim 2022-7-6
Hi @KSSV, do you know how to perform the same you have suggested, but starting from a graph like this one ?
s = [1 1 2 2 2 3 3 3];
t = [2 3 3 4 5 6 7 5];
x = [0 0 1 0 4 3 1];
y = [0 1 0 4 5 0 -1];
G = graph(s,t);
G.Nodes.X = x'; G.Nodes.Y = y';
plot(G,'XData',G.Nodes.X,'YData',G.Nodes.Y)
I understood that I can use my x- and y- coordinates, as you have showed
Data.X = x ; % latitude
Data.Y = y ; % longitude
but how to insert/import the edges into the shapefile?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mapping Toolbox 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by