How to find the Lat/Lon of the ends of a geolineshape?
8 次查看(过去 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!