Drawing arcs with JavaScript

A couple of weeks ago Google updated the Voyager layer, adding a new sub-layer called ‘Animal View’. The layer includes some nice arcs between placemarks. However, there is no automatic way to create these arcs with Google Earth or in KML. We do not know how Google created them, but when we have seen it done in the past (such as in this KML) it was done programmatically.

We thought a utility to create these arcs might be useful.

In order to draw an arc we first needed to work out the location of points along a great circle between two points. We did this with assistance from this website. We have used a simple sine wave and by default make the maximum altitude of the centre of the arc one fourth of the distance between the two points. There is also the option to set the maximum altitude of the arc. We have used altitudes relative to the ground, which has the advantage of making sure the end points start from the ground, but as can be seen in the screen shot above, if there is a significant dip in the ground altitude it is mirrored in the arc as well (notice dips where the arc crosses the river). This effect is not noticeable for larger arcs.

You can include multiple features, such as Placemarks, Polygons or Paths. All Placemarks will be put together and arcs drawn between pairs of consecutive points. Polygons and Paths will have an arc between each consecutive point.

If you don’t like the styling, you can adjust that later in Google Earth or in the KML.

No of segments to divide into:

Altitude method:

Maximum altitude: (metres relative to ground)

Extrude: (shades the area below the arc)

About Timothy Whitehead

Timothy has been using Google Earth since 2004 when it was still called Keyhole before it was renamed Google Earth in 2005 and has been a huge fan ever since. He is a programmer working for Red Wing Aerobatx and lives in Cape Town, South Africa.






PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.

Comments

  1. http://Todd says

    Hi Timothy, How does the spreadsheet need to be formatted before upload to create the arcs? Thanks Todd

  2. http://Todd says

    Wow. This is great. I figured it out. Thanks. Todd



PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.