Howto: Geocaching With Google And Terraserver

terraserver hackaday headquarters
if you’re into geocaching, terraserver and google maps can be your greatest allies.  well, maybe second greatest, right after your trusty gps receiver.  with terraserver, you can pull up hires satellite photos and topo maps of just about everywhere in the continental us.  with google maps, you can easily pull up a road map and driving directions.

however, one thing i noticed when google maps launched was that it’s interface is conspicuously lacking a lat/lon entry field.  it turns out there are a couple of query parameters that you can use to pull up coordinate based maps.  with this info, you can make a simple form to pull up both map results for a given latitude/longitude combination, which should hopefully be a handy tool for your next gps treasure hunt.  continue reading to see how this works.

terraserver parameters

there are two query parameters to specify latitude and longitude.  they are PgSrh:NavLat and PgSrh:NavLon, respectively, and they take decimal values.  if your location is in degree/minute notation, just divide the minutes by 60 to get the appropriate decimal value.

the final terraserver query string looks like this:

terraserver blanca little bear
plugging that in should give you a birds eye view of my first two colorado 14ers (little bear and blanca).  note the hairy ridgeline in between the two where i probably should have died.

google maps parameters
google maps has a single query parameter in which you specify both latitude and longitude.  the parameter name is ‘sll’ and has the format [latitude]%2C[longitude].  like terraserver, these are in decimal format.

the final google maps query looks like this:

google maps area 51
enter that one, zoom out a bit, and you should be able to plot your next trip to the super top secret area 51.

make your own interface
you should be able to take this info and make use of it in your next geocaching quest.  both services are useful for different tasks, so i just like to use a quick and dirty html interface for pulling up both map results for a lat/lon combination that i can quickly key in.  make your own and let us know about it, or in the mean time, just bookmark and use mine below:

jason’s quick and dirty google maps / terraserver split screen viewer



map it

hop to it

it’s time to get out there and find something. happy hunting and happy hacking!

27 thoughts on “Howto: Geocaching With Google And Terraserver

  1. Jason,

    This dual map was a great idea, with a great little piece of code. Thanks!

    But ‘split-screen’? Is it horizontal for you? Because with a 1024 screeen, both Firefox and IE make it vertical, with of course a scroll. Is that what you meant?

    An email would be great.

  2. Just so you know, the terraserver maps do not line up very well with the latitude and longitude you enter from either a url or their forms. You can see this if you go an integer lat and long. The photos have a little white cross at the exact co-ordninates, but if you zoom in on the page terraserver gives you, its way off.

  3. Yea, I have been using terraserver for geocaching for a few years already, and their coordninates are way off, usually by a few miles. The sad thing is this has been happening for a few years and they still haven’t fix the problem.

  4. You can generate accurate terraserver with a little code. The terraserver urls use the UTM system, and they are accurate. you can see this with following demonstration. the correct url for 39N 95w is:
    if you look at the parameters for X,Y,and Z, they correspond to Northing, Easting and Zone. Plug any coordinates into:
    and you will get the numbers to substitute into the url (you have to divide x and y by 200 for terraserver to work)

  5. Now what I could REALLY use are directions to and from latitude/longitude/addresses. Or some way to convert addresses into lat/long.

    I don’t have a fancy gps unit, so it’d be nice to plugin where I’m going in addition to using the printout I make from mapquest/google maps. Or if I’m stuck in the middle of nowhere, and I need directions home… I’d like to be able to punch in my lat/long (using my internet enabled Sidekick) and get those directions.

  6. I’ve found a few tricks to drawing Google maps using the URL. Thought maybe someone could expand on it.

    URL arguments :

    q = coordinates (decimal – lat,lon)
    also you can add “(stuff+things)” to add tags to the bubble on the marker.

    hl=en means that it will start in map mode.

    t=k means that it will start in satellite mode.

    z = the level of zoom.

    Put it all together (map to my geocache):,-115.02998333+(Fish+Out+of+Water)&hl=en&z=3

  7. With google maps, you can just search for the lat/long coordinates, in a number of common formats. So try e.g.

    [N 44.93 W 93.27]
    [35 15′ 26″ -120 38′ 49″]
    [36 1′ N 115 1′ W]

  8. You can get lat, lon from Google Maps’s bitmap picture URL very easily. But the problem is that for the rest of the world (which is the largest part of it) these coordinates will not be precise no matter what you do.

    First, the coordinate system GM uses inside the script, is Mercator, but latitude is being calculated by the formula that is assiming Earth is a spheroid and not an ellipsoid, and therefore the results can not be compatible with WGS84.

    Interestingly, these calculations results appear to be precisely coinciding with what Google Earth is reporting on the screen for the same point on the surface, while Google claims GE uses WGS84.

    Which means that either it was just a coincidence or that GE doesn’t use WGS84 datum. Second, their sat bitmaps seem to be not precisely geo-referenced for the rest of the world anyhow, with difference up to 100-200 m.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.