Writing multiple Lat, lon points to KML File !

조회 수: 6 (최근 30일)
ShahZahid
ShahZahid 2020년 8월 4일
답변: Sudheer Bhimireddy 2020년 8월 4일
I am trying to write/export a series of latitude and longitude points as the path followed by a vehicle to a KML file in MATLAB. The following command seems to be accepting one pair of lat,lon only.
clc
format long g
lat1=33.642956;
lon1=72.991585;
lat2=33.643051;
lon2=72.991282;
lat3=33.643190;
lon3=72.990963;
lat4=33.643310;
lon4=72.990690;
filename = 'MathWorks.kml';
kmlwriteline(filename,lat1,lon1);
The desired output is writting all the lat,lon to the KML file but the
kmlwriteline(filename,lat1,lon1,lat2,lon2,lat3,lon3,lat4,lon4,);
returns error.

채택된 답변

Sudheer Bhimireddy
Sudheer Bhimireddy 2020년 8월 4일
The syntax for kmlwrite is:
kmlwriteline(filename,latitude,longitude,altitude);
The fourth variable passed is considered as altitude data. In your case you can create an array with multiple lat and lon points and send that array to the function.
Try this:
lat_points = [lat1;lat2;lat3;lat4];
lon_points = [lon1;lon2;lon3;lon4];
kmlwriteline(filename,lat_points,lon_points);
Hope this helps.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by