Azzera filtri
Azzera filtri

Creating a shapefile from a set of coordinates

45 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

KSSV
KSSV il 18 Set 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 Commenti
Brittany K
Brittany K il 23 Mar 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 il 6 Lug 2022
Modificato: Sim il 6 Lug 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?

Accedi per commentare.

Più risposte (0)

Tag

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by