[mapserver-users] Another newbie needing help with a mapfile (projections)...

adams adams at terrestris.de
Thu Nov 11 05:43:22 PST 2010


Dear MM,

I guess your problem is the
SHAPEPATH "."

Try first to add  the full OR relative (from where your *.map is) 
datapath in your data-statement of the layer, e.g. :

    DATA /this/is/the/path/to/mattarello.shp

If that works, add that path to your shapepath

Till



MM wrote:
> Hello!
>
> I have a problem with Mapserver which I am apparently unable to solve. 
> I have a mapserver installation which is queried by a web component, 
> that uses virtual earth tile addressing. It works really great. My web 
> component queries it like this:
>
> http://localhost/MapServ/mapserv.exe?map=mymap.map&mode=tile&tilemode=ve&tile=1202213133323032212&layers=aaa 
>
>
> Until now it worked with ECW files only, and I had no problems. But 
> now I need to add a shape file, and I just can't get it to work! I 
> googled extensively the whole morning but I was unable to find any 
> solution.
>
> Ogrinfo says this:
>
> **************************************************************
> INFO: Open of ... using driver `ESRI Shapefile' successful.
> Layer name: mattarello
> Geometry: Polygon
> Feature Count: 8270
> Extent: (662941.920131, 5093593.286658) - (667764.802144, 5099438.607073)
> Layer SRS WKT:
> PROJCS["UTM Zone 32, Northern Hemisphere",
>     GEOGCS["GRS 1980(IUGG, 1980)",
>         DATUM["unknown",
>             SPHEROID["GRS80",6378137,298.257222101]],
>         PRIMEM["Greenwich",0],
>         UNIT["Degree",0.017453292519943295]],
>     PROJECTION["Transverse_Mercator"],
>     PARAMETER["latitude_of_origin",0],
>     PARAMETER["central_meridian",9],
>     PARAMETER["scale_factor",0.9996],
>     PARAMETER["false_easting",500000],
>     PARAMETER["false_northing",0],
>     UNIT["Meter",1]]
> ogc_fid: Integer (10.0)
> ...
> **************************************************************
>
> This map has the same extent as the ecw I am using and it was provided 
> by the same person, so I just thought to use the same projection as 
> the ECW. I also thought that the output projection should be the same 
> as the one I am using with the ECW, to work with the web component.
>
> Unfortunately, all tiles I get are just blank, and calling mapserver 
> in map mode also renders a blank map.
>
> If I comment out the projection inside the layer, calling mapserver in 
> map mode, it displays the map. But the tile is still blank.
>
> I am probably using the wrong projection, but I really can't figure 
> out how to find the correct one, or how to translate the ogrinfo 
> information to the mapfile!
>
> Here is the mapfile I am using.
>
> **************************************************************
> MAP
>   IMAGETYPE      PNG
>   EXTENT         662941.920131 5093593.286658 667764.802144 
> 5099438.607073
>   SIZE           400 400
>   SHAPEPATH      "."
>   IMAGECOLOR 255 255 255
>   CONFIG "MS_ERRORFILE" "mapserverlog.txt"
>   CONFIG "PROJ_DEBUG" "ON"
>   DEBUG 5
>
>   OUTPUTFORMAT
>     NAME png
>     DRIVER "GD/PNG"
>     MIMETYPE "image/png"
>     IMAGEMODE RGB
>     EXTENSION "png"
>   END
>
>   LAYER
>     NAME aaa
>     TYPE POLYGON
>     DATA mattarello.shp
>     STATUS DEFAULT
>     CLASS
>       NAME aaa
>       OUTLINECOLOR 255 0 0
>     END
>
>     PROJECTION
>       "proj=utm"
>       "zone=32"
>       "ellps=GRS80"
>       "units=m"
>       "no_defs"
>     END
>   END
>
>   PROJECTION
>     "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"
>   END
> END
> **************************************************************
>
> Is there a way to display this shape on the tile?
>
> Thanks for any help!!!
> Palantir
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>

-- 
 
---------------------------------------------------------
terrestris GmbH & Co. KG
Irmintrudisstrasse 17
53111 Bonn
Germany

Till Adams
Geschäftsführung

Tel: +49 (0)228 / 962 899-52
Fax: +49 (0)228 / 962 899-57
adams at terrestris.de http://www.terrestris.de
Amtsgericht Bonn, HRA 6835
---------------------------------------------------------

Komplementärin:

terrestris Verwaltungs GmbH

vertreten durch:
Hinrich Paulsen, Till Adams




More information about the MapServer-users mailing list