How to find the Lat/Lon of the ends of a geolineshape?
조회 수: 11 (최근 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!