How to find the Lat/Lon of the ends of a geolineshape?
10 ビュー (過去 30 日間)
古いコメントを表示
When I read the shape data of a table obtained using readgeotable function using T.Shape, it returns:
ans =
geolineshape with properties:
NumParts: 1
Geometry: "line"
CoordinateSystemType: "geographic"
GeographicCRS: [1×1 geocrs]
How can I find the Latitude and Longitude data?
3 件のコメント
KSSV
2022 年 6 月 2 日
This is a new function, introduced in 2021b. It seems the functions has layers to specify. If you specify the layers, you may get coordinates.
T = readgeotable("sample_tracks.gpx",Layer="track_points");
回答 (1 件)
Siraj
2023 年 9 月 7 日
編集済み: Siraj
2023 年 9 月 7 日
Hi! It is my understanding that you want to access the latitude and longitude of a shape stored in the "geolineshape" object.
You read the geographical data from the file "CELPA_371_2019-12-31_M10_20200903-1416.gdb" using the "readgeotable" function. This function will create a geospatial table that includes the "geolineshape" objects in its first column.
However, it's important to note that in your case the "geolineshape" object represents a line geometry, and the latitude and longitude properties do not exist for non-point geometries.
Therefore, a possible workaround to access the coordinate data of the line is to convert the geospatial table to a regular table using the "geotable2table" function.
Refer to the code below for better understanding.
T = readgeotable(filenameBDGD);
T = geotable2table(GT,["Latitude","Longitude"]);
This will create Latitude and Longitude table columns.
You can refer to the following link for detailed information about the "geotable2table" function:
Please note that without access to the specific data file mentioned, I am unable to personally verify the correctness of the solution. However, I hope that the information and the "geotable2table" function will be helpful.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!