[mapserver-dev] Wrong .prj file with SHAPEZIP Outputformat

Guillaume Sueur no-reply at neogeo-online.net
Thu May 16 05:38:10 PDT 2013


I think I undestood. mapgdal.c retrieves the mapserver projection 
definition and translates it to proj4 string, and then ask GDAL for a 
WKS. I think it should be using ESPG code when available to allow GDAL 
to retrieve more information from its CRS database than the proj4 string 
allows it to.

Gonna try to hack it a bit...


Le 16/05/13 13:29, Thomas Gratier a écrit :
> Hello,
>
> Just a guess: the Mapserver projection file comes maybe from GEOS and
> GDAL retrieve the wrong proj (deduce from the mapfile) after (although
> with your analysis it doesn't seem so) >>
> http://mapserver.org/faq.html#where-do-i-find-my-epsg-code
>
> Regards
>
> Thomas Gratier
>
>
> 2013/5/16 Guillaume Sueur <no-reply at neogeo-online.net
> <mailto:no-reply at neogeo-online.net>>
>
>     Hi list(s),
>
>     Sorry for cross-posting gdal and mapserver dev lists, but I don't
>     know exactly where my problem comes from.
>
>     When using a SHAPEZIP OUTPUTFORMAT with MapServer, I retrieve a prj
>     file which is not exactly the correct projection definition (for
>     EPSG:3946) :
>
>     PROJCS["Lambert_Conformal___Conic",GEOGCS["GCS_GRS 1980(IUGG,
>     1980)",DATUM["D_unknown",__SPHEROID["GRS80",6378137,298.__257222101]],PRIMEM["Greenwich"__,0],UNIT["Degree",0.__017453292519943295]],__PROJECTION["Lambert_Conformal___Conic"],PARAMETER["standard___parallel_1",45.25],PARAMETER["__standard_parallel_2",46.75],__PARAMETER["latitude_of_origin"__,46],PARAMETER["central___meridian",3],PARAMETER["false___easting",1700000],PARAMETER["__false_northing",5200000],UNIT[__"Meter",1]]
>
>     I took a look at the code in mapogroutput.c and noticed it was all
>     driven by OGR.
>
>     So I did the same extract to a EPSG:3946 shapefile with ogr2ogr. It
>     gives the correct result :
>
>     PROJCS["RGF93_Lambert_93",__GEOGCS["GCS_RGF93",DATUM["D___RGF_1993",SPHEROID["GRS_1980",__6378137,298.257222101]],__PRIMEM["Greenwich",0],UNIT["__Degree",0.017453292519943295]]__,PROJECTION["Lambert___Conformal_Conic"],PARAMETER["__standard_parallel_1",49],__PARAMETER["standard_parallel___2",44],PARAMETER["latitude_of___origin",46.5],PARAMETER["__central_meridian",3],__PARAMETER["false_easting",__700000],PARAMETER["false___northing",6600000],UNIT["__Meter",1]]
>
>     which makes the shapefile's projection understandable by QGIS.
>
>     So, the question is : where does the prj definition generated by
>     mapserver come from ? Why is it wrong and how to fix this ?
>
>     Best regards
>
>     Guillaume
>     _________________________________________________
>     mapserver-dev mailing list
>     mapserver-dev at lists.osgeo.org <mailto:mapserver-dev at lists.osgeo.org>
>     http://lists.osgeo.org/__mailman/listinfo/mapserver-dev
>     <http://lists.osgeo.org/mailman/listinfo/mapserver-dev>
>
>


More information about the mapserver-dev mailing list