[OSM-talk] Mathematic genius needed

Bernhard zwischenbrugger bz at datenkueche.com
Mon Mar 22 04:29:19 GMT 2010


hi
> 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/ 
>

I don't know UTM.

If a globe is displayed on a 2D medium some things appear bigger than 
others.
As far I have seen in wikipedia, that's also in UTM coordinate system.
(greenland gets too fat)
see: http://wiki.openstreetmap.org/w/images/4/4a/Scale.png

UTM solves this problem for latitude (y-coordinate) in a different way 
than the normal osm projection.

You write that 0.00028m is one pixel.
But is that true for equator AND northpole?

Is your formula also working on low zoomlevels?

Bernhard

>
> 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