Creating a shapefile from a set of coordinates

45 Ansichten (letzte 30 Tage)
hendra kurnia febriawan
hendra kurnia febriawan am 18 Sep. 2018
Bearbeitet: Sim am 6 Jul. 2022
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.

Akzeptierte Antwort

KSSV
KSSV am 18 Sep. 2018
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 Kommentare
Brittany K
Brittany K am 23 Mär. 2020
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 am 6 Jul. 2022
Bearbeitet: Sim am 6 Jul. 2022
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?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mapping Toolbox finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by