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
'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/2009Nice idea. What is the expected accuracy? I've clicked places I know are at least 5 meters difference and they read the same altitude.
By Craig on 28/07/2009The metric system rules. Get with the rest of the world, America. Come into the 21st century.
On 20/06/2009were in the US, feet, yards and miles are our unit of measure. I don't need to know metric
On 18/06/2009i hate the metric system.
By America FTW on 14/06/2009Latest ff-3.0.10 here. No map displayed - only a blank white area, resizable using the Small, Medium, Large options. Two definite errors reported: "GlocalSearch is not defined" and "mapDiv is undefined". Interesting.
By Nefi on 20/05/2009sort it out this gave me same hight at to locations that are at 50 to 60m higher or lower than the other.technology just not there yet for us poor civies
On 14/05/2009Need in feet as well
By brian in NYC on 08/05/2009doesn't work for me
On 27/04/2009works great. Thanks
By Bobby on 14/04/2009lake taupo is at 356m according to the wiki
but this gives from 308 to 338 at various points on the surface of the lake.
By roger on 31/03/2009even more confused
By cookie on 20/03/2009worked well, thank you
On 13/03/200930 out of 41 comments shown. See all comments.
Add your own comment below and let others know what you think: