Jump to content

Latitude / Longitude Query


photo

Recommended Posts

What is the easiest way to query the Latitude / Longitude / Altitude of an object during runtime? 

I am creating a pseudo map interface using a high altitude ortho camera (looking straight down). I want to drop an object and then write the latitude / longitude / altitude of the object  to an xml. I currently do not know the best way to determine these coordinates of the object after it is placed arbitrarily in the world.

Edited by de-Roo.Lukas
Link to comment

Hi,

The engine itself operates only in cartesian coordinates so you have to provide additional information in order to get Lat / Lon / Alt coordinates on specific datum. You can go two ways:

1. If you have geo-referenced raster data and you know what projections it uses then you can use DatasetRasterPosResolver::getGeodeticPosition to get Lat / Lon / Alt coordinates from raster coordinates.

2. If you don't care about specific projection then you can use place GeodeticPivot somewhere in the world, set it's geodetic origin and use GeodeticPivot::mapFlatToGeodetic and GeodeticPivot::mapGeodeticToFlat for conversion between geodetic and cartesian coordinates.

Link to comment
×
×
  • Create New...