some issues related to write kml files
18 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have encountered an issue regarding the ordering of polygon vertices and writing to KML files. As demonstrated in the following code, I need to convert the polygon vertices to a counterclockwise order ([lonb, latb] = poly2ccw(lonb, latb); this is mandated by some data services). However, the output KML file appears somewhat strange (Figure 2). How can I obtain a KML file similar to Figure 1? I have limited knowledge in this area, and any advice would be greatly appreciated.
% load coastline
load('coast_polygon_c.mat', 'lonb', 'latb');
% check direction
ispolycw(lonb, latb)
% plot
shape = geopolyshape(latb, lonb);
shape.GeographicCRS = geocrs(4326);
figure;geoplot(shape);
% convert to counter-clockwise
[lonb, latb] = poly2ccw(lonb, latb);
% save and write kml
kmlwritepolygon('coast_polygon_c.kml', latb, lonb);
% plot
GT=readgeotable('coast_polygon_c.kml');
figure;geoplot(GT);
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Geographic Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

