Write Kml with vector of coordinates

조회 수: 4 (최근 30일)
Ahmet Hakan UYANIK
Ahmet Hakan UYANIK 2022년 7월 1일
댓글: Ahmet Hakan UYANIK 2022년 7월 7일
Hi,
I have a vector of latitude and longitude where I want to create a kml out of them. However, when I tried with
Poly = kmlwritepoint('new.kml',latitude,longitude)
it saves each point of coordinates individually in struct. That is why in case of reading the kml, I am having so many structs.
Is there any way to save the kml, such a way that I can read the coordinates in a single struct. (e.g. Poly.Lat(1000x1 double) and Poly.Lon(1000x1 double))
  댓글 수: 1
Garmit Pant
Garmit Pant 2022년 7월 4일
Hello Ahmet
The kmlwritepoint function stores the data into kml files as individual points. There are other ways to write data into kml files like kmlwrite, kmlwriteline and kmlwritepolygon but they all serve different purposes. I could not find a function to write the coordinates into kml files in single structs.

댓글을 달려면 로그인하십시오.

답변 (1개)

Siraj
Siraj 2022년 7월 4일
Hi,
It is my understanding that you want to read a kml file into a single struct such that you can access all the latitudes and longitudes at once. Currenlty I am not sure if there exists a method to read the kml file into a single struct. You can try :
  1. Read a kml file into a struct.
  2. Convert the struct into a table using "struct2table"
  3. From this tabel you can directly access the columns for latitude and longitude.
For more information you can check Vector to Kml and Importing kml files.
Hope this helps
  댓글 수: 1
Ahmet Hakan UYANIK
Ahmet Hakan UYANIK 2022년 7월 7일
Hi,
I think Garmit Pant replied as he could not find a function to write the coordinates into kml files in single structs. That is how I wanted to create the kml file but seems like it does not exist.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by