Draw a circle in Google Earth

From GeoWiki
Revision as of 07:14, 21 April 2010 by Norkmeister (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Ever wanted to project a circle around a WP in Google Earth and been frustrated by your inability to do so? Well have I go the solution for you. The jscript below will, given starting co-ordinates and the required distance (in metres), spit out a gpx file that has a track described by a bunch of points. Just edit the SouthCentre, EastCentre and DistanceAway variables at the top of the script. For ease of calculation it only accepts decimal degrees.

The resolution of the circle is adjustable by adjusting the "Resolution" variable in the top part of the script. If you want it to run fast, leave it at 0.0001. If you want a better circle then add a zero or two (but it takes considerably longer).

Now I couldn't be bothered looking up the methods to write the output to a file, so it just echoes it to the screen and you just redirect the output as shown below.

To run it on a Windows machine just open a cmd prompt (start -> Run -> cmd.exe) and type: cscript /nologo ProjectCircle.js > output.gpx

this will create a file called output.gpx in the current directory. Download the attached file an rename it from ProjectCircle.js.txt to ProjectCircle.js