[mkgmap-dev] how to convert Coord.distanceInDegreesSquared() to MapUnits?
From GerdP gpetermann_muenchen at hotmail.com on Wed Jan 30 07:58:02 GMT 2013
GerdP wrote > Hi, > > what is the correct way to convert the value > returned by Coord.distanceInDegreesSquared() into map units? > > A simple code like this seems not to work: > double distSq = co1.distanceInDegreesSquared(co2); > int mapUnits = Utils.toMapUnit(Math.sqrt(distSq)); > > Gerd OK, I learned that I have to know the latitude to do the calculation. In splitter, this (simplified) formula is used to calculate the width of a bbox: factor = Math.cos(Math.toRadians(Utils.toDegrees(lat))); double width = (maxLon-minLon) * factor Gerd -- View this message in context: http://gis.19327.n5.nabble.com/how-to-convert-Coord-distanceInDegreesSquared-to-MapUnits-tp5747103p5747134.html Sent from the Mkgmap Development mailing list archive at Nabble.com.
- Previous message: [mkgmap-dev] how to convert Coord.distanceInDegreesSquared() to MapUnits?
- Next message: [mkgmap-dev] Regression: Revision 2448 breaking routing in some cases
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list