フィルターのクリア

How to acces coordinates of a mappolyshape object?

7 ビュー (過去 30 日間)
khney
khney 2023 年 6 月 16 日
コメント済み: khney 2023 年 6 月 30 日
I want to extract the X and Y coordinates of a polygon-shapefile (Esri *.shp).
Up to now, I uesed the function shaperead for this, but it does not to work anymore. Matlab R2022b offers the function readgeotable().
But when I open the shapefile with readgeotable(), I get a table with a 1x1 mappolyshape. In this mappolyshape, I can not find the X and Y data.
I can illustrate this polygon using the function mapshow(), so the X and Y data must be anywhere in the table. But where? How can I extract this data?
Cheers

採用された回答

Kojiro Saito
Kojiro Saito 2023 年 6 月 27 日
You can check X and Y data by converting to table with geotable2table function.
hydro = readgeotable("concord_hydro_area.shp");
tempT = geotable2table(hydro, ["X" "Y"]);
disp(tempT)
X and Y will be stored in X and Y columns in tempT
  1 件のコメント
khney
khney 2023 年 6 月 30 日
Thank you very much Kojiro, that solution works perfectly well!

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by