[OSM-talk] Mathematic genius needed

Andrew Ayre andy at britishideas.com
Mon Mar 22 03:29:42 GMT 2010


How about converting to UTM then using a zoom level specified as meters 
per pixel?

Here is what I did when printing from Mapnik:

http://www.britishideas.com/2009/09/22/map-scales-and-printing-with-mapnik/

Andy

Bernhard zwischenbrugger wrote:
> Hi all
> 
> Maybe that one is easy for someone out there, for me it's unsolvable.
> 
> I have
> minlat, minlon, maxlat, maxlon
> That describes an area in WGS84
> 
> The area should be placed on the screen.
> To place it on the screen, I need the centerlat,centerlng and the zoomlevel.
> 
> To be shorter on that:
> 
> Given:
> wgs84: minlat, minlon, maxlat, maxlon
> screen: width, height
> 
> Needed:
> lat,lng, center
> ---------
> 
> Hint:
> 
> At first you maybe think
> centerLat = (minlat + matlat)/2;
> centerLng = (minlng + matlng)/2;
> could be the solution.
> 
> But that does not give the correct result.
> The center must be the center in screen coordinates.
> 
> 
> Bernhard
> 
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/talk
> 
> 
> 




More information about the talk mailing list