[OSM-dev] strange OpenLayers longitude and latitude

Christopher Schmidt crschmidt at metacarta.com
Fri Aug 31 15:23:12 BST 2007


On Fri, Aug 31, 2007 at 05:22:46PM +0400, Vladimir Elistratov wrote:
> Chris, thank for your help. I forgot to define the projection. I 
> managed to convert longitudes and latitudes forth and back through the 
> functions mercatorToLonLat and lonLatToMercator.
> 
> But there is another big issue. How could one use OSM 
> (http://tile.openstreetmap.org) and "Canada overlay" 
> (http://www2.dmsolutions.ca/cgi-bin/mswms_gmap) or similar one 
> simultaneously?

You would need to reproject the canada maps on the server. The
projection that OSM/Google/etc. uses is not a 'well-known' projection,
so very few (that is: almost none) of the existing WMS services will
reprojected into it.

This means that what you will probably need to do is:
 * Set up a MapServer instance, with WMS Client capabilities
 * Add the "Google Projection"
   (http://spatialreference.org/ref/user/google-projection/) to your 
   /usr/share/proj/epsg file: The de-facto standard is to use <900913>, 
   'google' in leet.
 * Set up a WMS Client layer in your mapfile:
   http://mapserver.gis.umn.edu/docs/howto/wms_client/#adding-a-wms-layer
 * Add the layer to your map.

If you need help with any of those steps, I'm happy to offer help, but
it might be better to take it to the OpenLayers list, since setting up
WMS servers is somewhat out of the realm of OSM development :)  (I'm
glad to keep it here if others are interested though.)

Regards,
-- 
Christopher Schmidt
MetaCarta




More information about the dev mailing list