フィルターのクリア

Convert Voronoi diagram to shape file

2 ビュー (過去 30 日間)
Nicolás Ernesto Cortés Malagon
Nicolás Ernesto Cortés Malagon 2021 年 9 月 6 日
回答済み: surya venu 2024 年 5 月 21 日
Hi,
I need to convert a voronoi diagram into a shapefile to plot it in Google Earth.
Currently my code looks like this:
X=[-74055915;-74068052;-74101923;-74060203;-74091317;-74089282;-74114873;-74071424;-74074763;-74105454];
Y=[4694567;4630518;4623200;4668864;4696542;4617255;4576684;4611062;4720726;4656747];
figure (1)
Polvor= voronoi(X,Y)
Thanks for your help

回答 (1 件)

surya venu
surya venu 2024 年 5 月 21 日
Hi,
To convert a Voronoi diagram into a shapefile and plot it in Google Earth, follow these steps:
  1. Generate Voronoi Diagram: Use MATLAB to generate the Voronoi diagram with your X and Y coordinates.
  2. Extract Voronoi Vertices and Regions: Use MATLAB's "voronoin" function to get the vertices and regions of the Voronoi diagram. Check out: https://www.mathworks.com/help/matlab/ref/voronoin.html
  3. Create Polygons: Loop through the Voronoi regions to construct polygons.
  4. Create Shapefile: Use MATLAB's "shapewrite" function to create a shapefile from the polygons.
  5. Convert Shapefile to KML: Use a tool like GDAL's "ogr2ogr" to convert the shapefile to KML format.
  6. Load in Google Earth: Open the KML file in Google Earth to view your Voronoi diagram.
Hope it helps.

カテゴリ

Help Center および File ExchangeVoronoi Diagram についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by