[mapserver-users] PostGis not displayed byMapServer

Jeff McKenna jeffmckenna at gmail.com
Thu May 1 11:35:07 PDT 2008


My thoughts:

1) MS4W is preconfigured for the following imagepath and imageurl  
settings, in case you are not aware:

   IMAGEPATH "/ms4w/tmp/ms_tmp/"
   IMAGEURL "/ms_tmp/"

2) I assume that the postgis layer is in the same projection as the  
local layer?
	- test this by setting the extents to the postgis layer and removing  
the local layer from the mapfile

3) use ogrinfo to verify the extents of the postgis layer

     e.g.   ogrinfo -ro PG:"host=127.0.0.1 user=postgres dbname=gmap"  
yourlayername --summary

4) make sure you specified an srid when you loaded the data into postgis

    e.g.  shp2pgsql -s 42304 province.shp province > province.sql

5) here is my my working tiny mapfile with a postgis layer:

#
# Start of map file
#
#
NAME "postgis"
STATUS ON
SIZE 400 300
SYMBOLSET ../etc/symbols.txt
## ESPG:42304 extents:
EXTENT -2200000 -712631 3072800 3840000
UNITS METERS
SHAPEPATH "../data"
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txt


#
# Start of web interface definition
#
WEB
   IMAGEPATH "/ms4w/tmp/ms_tmp/"
   IMAGEURL "/ms_tmp/"
END

PROJECTION
   "init=epsg:42304"
END


#
# Start of layer definitions
#


LAYER
   NAME provinces
   TYPE POLYGON
   STATUS DEFAULT
   CONNECTIONTYPE postgis
   CONNECTION "host=127.0.0.1 user=postgres port=5432 dbname=gmap"
   DATA "the_geom FROM province USING unique gid using srid=42304"
   PROJECTION
     "init=epsg:42304"
   END
   CLASS
     NAME "Land"
     STYLE
       COLOR 240 240 240
       OUTLINECOLOR 199 199 199
     END
   END
END # layer



END # Map File

6) test your mapfile with the shp2img utility (http://mapserver.gis.umn.edu/docs/reference/utilityreference/shp2img 
)

   e.g. shp2img -m gmap75_postgis.map -o test.png -map_debug 3


--jeff






On 1-May-08, at 11:24 AM, <susanne.kalliany at tefis.at> <susanne.kalliany at tefis.at 
 > wrote:

> Hello to everyone,
>
> I have an (already mentioned but - as it seems to me - not yet solved)
> problem concerning PostGis used with MapServer.
>
> My application can show shape files but not postgis-files. There are  
> no
> output files (png) generated for this layer.
>
> Below is my mapfile.
>
> I would be very pleased if anyone can give me some usefull hint.
>
> Thanks a lot,
>
> Susanne Kalliany
>
> ------------------------------
> MAP
>  NAME global_map
>  STATUS ON
>  SIZE 1000 700
>  EXTENT -100300 260500 -99100 261600
>  UNITS meters
>  IMAGECOLOR 255 255 255
>  IMAGETYPE png24
>
>  WEB
>            IMAGEPATH "C:\ms4w\Apache\htdocs\tmp"
>            IMAGEURL "/tmp/"
>  END
>
>  LAYER
>    NAME Ortho
>    GROUP Ortho
>    DATA "C:\ms4w\Apache\htdocs\ortho\alle_e_50cm.tif"
>    projection
>            "AUTO"
>    end
>    TYPE RASTER
>    MINSCALE 10
>    MAXSCALE 10001
>    STATUS ON
>    DUMP TRUE
>  END
>
>  LAYER
>                        CONNECTIONTYPE postgis
>            NAME UAbt
>            GROUP UAbt
>                        CONNECTION "user=postgres password=xxxxxxxx
> dbname=tefisdb host=localhost port=5432"
>     STATUS ON
>     TYPE line
>     DATA "roads_geom from roads"
>     CLASS
>          SIZE 16
>          COLOR 0 0 255
>     END
>    DUMP TRUE
>  END
>
> END
>
> UAbt with or without
>     projection "AUTO"
>
> -- 
> DI. Susanne KALLIANY - susanne.kalliany at tefis.at
>
> TeFiS - www.tefis.at
> Technische und forstliche Informationssysteme
> (Forstliche Software und GIS)
>
> Mobiltelephon: +43 664 1424269
> Telephon: +43 316 931746-0, Fax: -15
>
> A-8010 Graz, Schillerstrasse 58
> A-1040 Wien, Schaumburgergasse 11/13
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list