开发者

Send lon/lat & description from html table cell to google earth

开发者 https://www.devze.com 2023-02-24 05:30 出处:网络
I have a table in an html page where each cell开发者_StackOverflow中文版 contains one line whose elements are separated by spaces:

I have a table in an html page where each cell开发者_StackOverflow中文版 contains one line whose elements are separated by spaces:

09/04/2011 16:06:23 Suspect Vessel, INDIAN OCEAN 14 16 N 056 32 E

Each row cell contains similar entries. What would be the best way to extract these elements and send them as a label to GoogleEarth (KMZ?) and have it run automatically every day so any new entries are added to the map?


Just extract the entries and put them into KML as placemarks

Here's the sample KML from Google:

<Placemark>
  <name>Google Earth - New Placemark</name>
  <description>Some Descriptive text.</description>
  <LookAt>
    <longitude>-90.86879847669974</longitude>
    <latitude>48.25330383601299</latitude>
    <range>440.8</range>
    <tilt>8.3</tilt>
    <heading>2.7</heading>
  </LookAt>
  <Point>
    <coordinates>-90.86948943473118,48.25450093195546,0</coordinates>
  </Point>
</Placemark>

http://code.google.com/apis/kml/documentation/kmlreference.html#placemark

You can add an icon to the placemark to make it look a little nicer:

http://code.google.com/apis/kml/documentation/kmlreference.html#icon

You really only need to use a KMZ if you want to include custom images/icons for the placemark.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号