[Mapserver-users] Error message using PostGis

Zamil Murji Zamil.Murji at divestco.com
Tue Jul 22 08:11:29 PDT 2003


Hi Gabriel,

I had a similar problem not to long ago. You need to be add USING SRID = -1 to the end of your DATA tag. I'm not to sure if it will accept -1 so you might have to update the SRID field for every geom to a valid one. Hope this helps.

Thanks
Zamil

-----Original Message-----
From: Gabriel Vieira Ferrari [mailto:gabriel at ciasc.gov.br]
Sent: Tuesday, July 22, 2003 8:36 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Error message using PostGis


Hi listers.

Is the first time I'm use Postgres/Posgis with MapServer and receive this
error MSG:

==>>       msDrawMap(): Image handling error. Failed to draw layer named
'cidadept0'.

But the original shp file are read without error.

Complementary information:

Postgres/Postgis is: VERSION: 0.7.5 (2003/04/08)

MapServer is:
MapServer version 4.0-beta1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=TIFF INPUT=EPPL7
INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

MAP file:
 CONNECTION "user=postgres password=xxx dbname=mapserver host=xxxx"
 DATA "the_geom from cidade_p"


I import shp files with:
$ shp2pgsql -d ../mapserver/data/cidade_p cidade_p mapserver|psql -d
mapserver (point data)
$ shp2pgsql ../mapserver/data/politico2001 sc2001 mapserver |psql -d
mapserver (polygon data)
$ shp2pgsql -d ../mapserver/data/politico2001 sc2001 mapserver |psql -d
mapserver (polygon data)

mapserver=# \dt
              List of relations
 Schema |       Name       | Type  |  Owner
--------+------------------+-------+----------
 public | cidade_p         | table | postgres
 public | geometry_columns | table | postgres
 public | politicotable    | table | postgres
 public | sc2001           | table | postgres
 public | sc97             | table | postgres
 public | spatial_ref_sys  | table | postgres
(6 rows)

mapserver-# \d cidade_p
         Table "public.cidade_p"
  Column  |       Type        | Modifiers
----------+-------------------+-----------
 gid              | integer                  |
 id                | integer                  |
 nm_munic | character varying |
 munic_02  | character varying |
 ptot2001   | bigint                    |
 the_geom  | geometry              |
Check constraints: "$1" (srid(the_geom) = -1)
                               "$2" ((geometrytype(the_geom) =
'POINT'::text) OR (the_geom IS NULL))
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list