[mapserver-users] Postgis/mapserver error

Donald Kerr donald.kerr at dkerr.co.uk
Thu Apr 26 14:23:25 PDT 2012


Paul,
 
I had the same issue. The functions have been renamed in PostGIS 2. You need
to run legacy_minimal.sql in PostGreSQL. That file can be found here:
\PostgreSQL\9.1\share\contrib\postgis-2.0. 
 
Regards,
 
Donald

-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Paul Maddock
Sent: 26 April 2012 21:52
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Postgis/mapserver error



Dear all,

 

I'm currently trying to have mapserver v6.0.1 grab data from my postgis
database v 2.0.0  .  When I request the layer through mapserver using cgi
commands I get the following error message:


msDrawMap(): Image handling error. Failed to draw layer named
'aep_polygon_polyline'. msPostGISLayerWhichShapes(): Query error. Error
(ERROR: function geomfromtext(unknown, integer) does not exist LINE 1:
...gid" from aep_polygon_polyline where geom_3754 && GeomFromTe... ^ HINT:
No function matches the given name and argument types. You might need to add
explicit type casts. ) executing query: select
encode(ST_AsBinary(ST_Force_2D("geom_3754"),'NDR'),'hex') as geom,"gid" from
aep_polygon_polyline where geom_3754 &&
GeomFromText('POLYGON((980934.251404232 125495.986,980934.251404232
1038792.604,2809561.55559577 1038792.604,2809561.55559577
125495.986,980934.251404232 125495.986))',3754)

 

 

my mapfile looks like this:

 

LAYER

   NAME "aep_polygon_polyline"

   STATUS ON

   TYPE line

   CONNECTIONTYPE postgis

   CONNECTION "host=localhost dbname=aep_columbus user=******
password=******** port=5432"

   

   

   DATA "geom_3754 from aep_polygon_polyline using unique gid using
srid=3754"

   PROJECTION

                "init=epsg:3754"

   END

   CLASSITEM 'gid'

    CLASS                

                STYLE                     

                                COLOR 200 200 200

                                OUTLINECOLOR 200 200 200

                                SIZE 2

                END

    END

END

 

 

I used the following command to create my shapefile:

 

shp2pgsql -s 3754 -g geom_3754 /path/to/my/shpfile | psql -h localhost -U
postgres -p 5432 -d aep_columbus

 

3754 is Ohio State Plane South.  Does this mean that I need to use the -G
geography option to make my data properly render?

 

Thank you so much,

Paul

 

 

 

 

 

 

Paul A. Maddock

Mapping Technician

IJUS LLC

560 Officenter Place

Gahanna, OH 43230

Cell: (513) 404-6476

 <http://www.ijus.net/index.html> Description: Description: Home

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120426/9718eefb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 3201 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120426/9718eefb/attachment.gif>


More information about the MapServer-users mailing list