[mapserver-users] Spherical Mercator Projection Problem

Sergey Kraev thexray at gmail.com
Wed Feb 23 03:01:05 PST 2011


Hi,



I’m running MS4W v3.0 (including MapServer 5.6.5) on Windows.



My data source are PostGIS multipolygon countries’ borders.



I have successfully got MapServer to render the world map in WGS84
projection using these settings:



Request:



http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=world.map&mode=map&mapsize=256+256&mapext=-180+-90+180+90



world.map:



MAP

 EXTENT                               -180 -90 180 90

  #EXTENT         -20037508 -20037508 20037508 20037508

  SIZE           256 256

  IMAGECOLOR     153 179 204

  FONTSET        "c:\MS4W\fonts\fonts.list"

  RESOLUTION    96

  MAXSIZE        5000



  PROJECTION

                "init=epsg:4326"

                #"init=epsg:3785"

  END

…

<layers don’t have PROJECTION sections>



I would like MapServer to render the same data into a “Web (spherical)
Mercator” projected map (epsg:3785), but I don't know how to modify my
request and mapfile in order to get the correct map.



With the following settings I just receive a picture without any polygons.



\ms4w\proj\nad\epsg:



            …

<3785> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0
+y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs <>

…



Request (only mapext is different):



http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=world.map&mode=map&mapsize=256+256&mapext=-20037508+-20037508+20037508+20037508<http://127.0.0.1:8080/cgi-bin/mapserv.exe?map=world.map&mode=map&mapsize=256+256&mapext=-180+-90+180+90>



world.map (only EXTENT and PROJECTION are different):



MAP

  #EXTENT                           -180 -90 180 90

  EXTENT         -20037508 -20037508 20037508 20037508

  SIZE           256 256

  IMAGECOLOR     153 179 204

  FONTSET        "c:\MS4W\fonts\fonts.list"

  RESOLUTION    96

  MAXSIZE        5000



  PROJECTION

                #"init=epsg:4326"

                "init=epsg:3785"

  END

…

<layers don’t have PROJECTION sections>



I’m assuming that -20037508 -20037508 20037508 20037508 is correct extent
for the whole world map, since Google uses that and they also have Mercator
projection.



Thanks for your help.



Sergey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110223/63ecdb64/attachment.htm>


More information about the MapServer-users mailing list