Ask a questionAsk a question
 

AnswerObtain terrain height

  • Friday, October 30, 2009 2:46 PMfredqqq Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am writing a plug in for the the 3D. If I draw a line from a lat lon position, I can make it start from the terrain or datum by setting altitude mode in the PolyInfo style object.. I want to position a 3D model on the terrain at a lat lon position, however all the altitudes are relative to the datum. (This model is a mesh taken from the simple actor example.)
    How can i make the altitudes relative to the terrain surface ?

Answers

  • Wednesday, November 04, 2009 3:53 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You may be able to retrieve the altitude at a location by adding a PushpinGeometry at the location where you want a measurement and then look at it's properties. Setting the altitude mode to above ground and the altitude to 0 should set the pushpin on the ground. You should be able to retrieve the altitude above sea level for the pushpin properties.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com

All Replies

  • Friday, October 30, 2009 7:41 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There are a couple of ways to do this. One would be to make a call to a web service that has this data; i.e. http://gisdata.usgs.net/XMLWebServices2/Elevation_Service.php
    Or find the right property in the 3D control that has this information. I put together the following article that shows how to extract altitudes from the 3D control using a mouse click: http://rbrundritt.spaces.live.com/blog/cns!E7DBA9A4BFD458C5!1017.entry
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
  • Wednesday, November 04, 2009 3:30 PMfredqqq Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Richard, thanks for the replies..

    I don't see why i would have to use a different service, as the bing 3D already knows the terrain heights and uses them when plotting lines in altitudeMode = above terrain.

    Your example gets height for the mouse cursor on the screen, i need to get this for a lat lon position.
  • Wednesday, November 04, 2009 3:53 PMRichard_BrundrittMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You may be able to retrieve the altitude at a location by adding a PushpinGeometry at the location where you want a measurement and then look at it's properties. Setting the altitude mode to above ground and the altitude to 0 should set the pushpin on the ground. You should be able to retrieve the altitude above sea level for the pushpin properties.
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com