필터 지우기
필터 지우기

How to check the kml file elevation values with the readgeotable

조회 수: 8 (최근 30일)
주영
주영 2024년 8월 23일
답변: Angelo Yeo 2024년 8월 23일
I would like to check the kml file z value with the readgeotable and apply it to build the hd map
In the example above, I am importing elevation values to the GeoTiff file, is there a way to get elevation values directly from the kml file?
Do I have to use GeoTiff?

답변 (1개)

Angelo Yeo
Angelo Yeo 2024년 8월 23일
readgeotable does not support reading elevation data. One workaround is to change extension from "kml" to "xml" and use readstruct.
unzip("KML_Samples.zip");
copyfile("KML_Samples.kml", "KML_Samples.xml"); %changing extension from kml to xml
T = readgeotable("KML_Samples.kml");
T(1,:)
ans = 1x3 table
Shape Name Description _______________________ __________________ ______________________________________________________________________________________________ (37.4223°N, 122.0822°W) "Simple placemark" "Attached to the ground. Intelligently places itself at the height of the underlying terrain."
data = readstruct("KML_Samples.xml");
data.Document.Folder(1).Placemark(1).name
ans = "Simple placemark"
data.Document.Folder(1).Placemark(1).description
ans =
"Attached to the ground. Intelligently places itself at the height of the underlying terrain."
data.Document.Folder(1).Placemark(1).Point % 37.4223'N, 122.0822' W
ans = struct with fields:
coordinates: "-122.0822035425683,37.42228990140251,0"
You can see that the elevation is "0" according to "coordinates".
If you want an enhancement for readgeotable, please reach out to technical support and request it.

카테고리

Help CenterFile Exchange에서 Get Started with RoadRunner에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by