[Mapserver-users] Wierd PostGIS Layer Error - msPOSTGISLayerWhichShapes()

Benjamin Wragg bwragg at tpg.com.au
Wed Jan 22 15:41:52 EST 2003


Hi All,

I've just fired PostGIS up and I'm getting the following error when I
use the draw() method of the mapObj:

Warning: MapServer Error in msPOSTGISLayerWhichShapes(): prep_DB:Error
executing POSTGIS DECLARE statement (0.6 failed - retried 0.5 and it
failed too). DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d()),'NDR'),OID::text from WHERE &&
setSRID('BOX3D(-180 -45,180 225)'::BOX3D, find_srid('','','') ) in
C:\MAB\Dev\mapscripttest\test.php on line 4

>From what I've learnt so far, it seems that this query is missing the
geometry columns. Any ideas why?

Heres the map file I'm using:

NAME TEST
EXTENT -180 -90 180 90
SIZE 400 300
STATUS ON
UNITS DD
IMAGECOLOR 255 255 255
SYMBOLSET symbols.sym

WEB
  MINSCALE 2000000
  MAXSCALE 50000000
  IMAGEPATH "c:/mab/dev/temp/" 
  IMAGEURL "/ms_tmp/"
END

LAYER
    CONNECTIONTYPE postgis
    NAME "testpoints"
    # Connect to a remote spatial database
    CONNECTION "user=user password=password dbname=dbname
host=localhost"
    # Get the lines from the 'geom' column of the 'roads' table
    DATA "the_geom FROM testpoints"
    STATUS default
    TYPE POINT
    CLASS
	COLOR 255 0 0
    END
END
END

I've tried all different configurations in the map file but I don't
think this is the problem because the $map=ms_newMapObj('mapfile.map')
line of code is getting executed with no errors. Also the $map object
exists because I can print out some of the variables?

Any ideas?

Thanks,

Benjamin Wragg




More information about the mapserver-users mailing list