Effacer les filtres
Effacer les filtres

Creating a shapefile from a set of coordinates

45 vues (au cours des 30 derniers jours)
hendra kurnia febriawan
hendra kurnia febriawan le 18 Sep 2018
Modifié(e) : Sim le 6 Juil 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.

Réponse acceptée

KSSV
KSSV le 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 commentaires
Brittany K
Brittany K le 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 le 6 Juil 2022
Modifié(e) : Sim le 6 Juil 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?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mapping Toolbox dans Help Center et File Exchange

Tags

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by