Google Maps Find Altitude
Last Updated 4th December 2009
Quick Find :
Description
A method of determining altitude (height) when a point is clicked on a map.
How To Use
- Click on the map on a location where you wish to find the altitude
- The altitude will be displayed in the message box below the map
How it Works
var map;
function Gload()
{
mapDiv.innerHTML='Loading ...';
if(!GBrowserIsCompatible())
{
mapDiv.innerHTML='Sorry, your browser is not compatible with Google Maps.';
return;
}
map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(new GLatLng(0,0), 2);
map.setMapType(G_HYBRID_MAP);
GEvent.addListener(map, "click", function(overlay,point,overlaylatlng)
{
if(point)
{
mapDiv.innerHTML="Finding Altitude...";
map.addOverlay(createMarker(point));
findalt(point);
}
});
mapDiv.innerHTML="Ready";
}
function findalt(point)
{
var script = document.createElement("script");
document.body.appendChild(script);
var selectedWebService="gtopo30";
script.src = "http://ws.geonames.org/" + selectedWebService + "JSON?lat=" + point.lat() + "&lng=" + point.lng() + "&callback=loadJSON";
}
function loadJSON(result)
{
var filter = new Array();
filter[0] = "gtopo30";
var output=JSON.stringify(result,filter);
var output2=JSON.parse(output);
mapDiv.innerHTML =output2.gtopo30+"m";
}
function createMarker(point)
{
var marker=new GMarker(point);
return marker;
}
function ClearMap()
{
map.clearOverlays();
mapDiv.innerHTML="";
}
Relevant Links
Further Uses and Ideas
- None at the current time
Version History
- Version 1 (28/09/2008)
- Version 1.1 (28/12/2008)
- Added quick find option
- Version 1.2 (21/03/2009)
- Enlarged output text at bottom of map
- Version 1.3 (04/012/2009) - You are here
- Output now also displayed in feet
Previous Comments For This Page
worthless
On 24/07/2010This is great. Thanks!
By Jeff Edwards on 08/07/2010It's not right in Riverside, CA Mt Rubidoux
On 04/07/2010how do i find my height above sea level?somebody please help
On 18/06/2010Why is it taking forever to repeat a request today that took no more than 10 seconds yesterday. In fact it has been 10 minutes and no result.
On 12/06/2010Just put a pin into the Beach at Woolacombe Bay, Devon UK and gave showed an altitude reading of 292feet above Sea level. Last time I looked there wasn't that kind of drop to the Sea!!!!!
By Andy on 26/05/2010Using feet and inches is great for building -- it lets you easily divide by 2, 3, and 4. I can't tell you how often I've been building something that I needed to trisect a measurement. It was easier than pi with the US Customary System (1 foot / 3 = 4 inches, 1 yard / 3 = 1 foot, 1 yard / 4 = 9 inches). That would have been a real pain in the metric system. The metric system is full of a bunch of lengthy decimals instead of concise fractions and short numbers (2 feet is 60.96 centimeters). The metric system of measuring the length of things is literally a royal pain.
On 23/05/2010False results for me in France : my test was done on a point which is about 300 meters, and the software gives me 38 meters.
It's good only for approximate results, on very large maps.
By Mathilde D on 29/04/2010supercool . . , considering 10 years ago, we shouldn't complain!!
On 10/04/2010Altitude or Elevation? I think this should be Elevation (reference from sea level)
By MKD on 06/04/2010gtopo30 accuracy is 1km x 1 km. Theoretically, for more accuracy you can use srtm3, that should be 90m x 90m, or astergdem, that should be 30m x 30m. But great job anyways! Greetings from Lithuania! ;]
By DonatasJ on 26/03/2010I'm on the ocean in San Francisco and said my location was -9999M - I'm not a fish !!!
On 27/02/2010'Looks to me like comment #9 above by "By A Fellow Programmer on 22/09/2009" explains it best...
Great job, DAFT!
Surfer Steve
On 27/01/2010CCR, This has now been fixed.
By Daft Logic on 07/01/2010I get a weird message:
The page at http://www.daftlogic.com says:
IMPORTANT: Remove this line from json2.js before deployment.
What does it mean?
By CCR on 07/01/2010One of the other comments said the elevation data has 1 km resolution.
If so, PLEASE don't let us enlarge the Google map down to meter resolution. That makes no sense.
By Andy I. on 31/12/2009I tried it out on my town ... and the results are just plain wrong!
A small hill comes up lower than the valley next to it.
The top of the highest hill in town is no higher than the lowlands around it.
My guess is the database you got your elevations from, is either wrong, or has very poor resolution (relative to the Google map) so that clicking on nearby objects is meaningless, resulting in bogus relative elevations.
It is showing an 8 meter (26 foot) difference in elevation between points on the same pond. I don't think so.
So I think this application should come with a warning that the results are VERY approximate and sometimes plain wrong.
I know there is much better elevation data out there. Another website tool showed me realistic variations for points on my own property, which this application doesn't do.
By Andy I. on 31/12/2009could you make altitude finder read in feet?
By Greg K on 03/12/2009where is it? where is it?
Junk!
On 22/11/2009A reading in feet and metric would be helpful for the US.
By DMWilson on 14/11/2009Kindly update satelite image its four year old. September 26, 2009
By Jebran, Karachi, Pakistan on 26/09/2009Folks, the accuracy level of this is "close enough." From the documentation of geonames.org service Daft is using - "GTOPO30 is a global digital elevation model...with a horizontal grid spacing of...approximately 1 kilometer."
In other words, they haven't measured every "point", so don't expect pinpoint accuracy here, especially in areas of rapid elevation gain/loss. Great job, DAFT!
By A Fellow Programmer on 22/09/2009Why is Mount Everest much lower here than what it actually is. On here it shows 8752 metres when it should be about 100 metres higher?
By Wendy on 13/09/2009As per the last persons comment, these altitudes are not correct.
By Alan on 13/09/2009Super Cool! Thanks for creating.
By Atheist Slayer on 27/08/2009very cool! how can i send a link to someone?
btw, i live in the usa, and i vote for metric!
On 12/08/2009It would be great to be able to print the map for travelling purposes!
By Dr T on 10/08/2009If people don't like metres, just convert it to feet.
Thanks for this page.
By James on 05/08/2009how come there is no "feet measurements"? it would be nice to have both systems...including the metric system, Paul
On 03/08/2009Are there any other websites to find altitude for pinpoint locations? Some comments suggest this Daft may not be accurate...
By Steve in Minnesota on 03/08/200930 out of 53 comments shown. See all comments.
Add your own comment below and let others know what you think: