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

Benjamin Wragg bwragg at tpg.com.au
Wed Jan 22 13:19:20 PST 2003


Thanks David. I get 2 rows back, one of them matching testpoints. It
contins the_geom in the f_geometry_column. Don't worry about it though
as David Blasby just posted a solution.

Thanks for you help.

Cheers,

Benjamin

-----Original Message-----
From: Lowther, David W [mailto:dlowther at ou.edu] 
Sent: Thursday, 23 January 2003 7:31 AM
To: 'bwragg at tpg.com.au'
Subject: RE: [Mapserver-users] Wierd PostGIS Layer Error -
msPOSTGISLayerWhichShapes()

Benjamin,

In psql try:

select * from geometry_columns

What does that return?


Dave

-----Original Message-----
From: Benjamin Wragg [mailto:bwragg at tpg.com.au]
Sent: Wednesday, January 22, 2003 3:00 PM
To: 'Lowther, David W'; mapserver-users at lists.gis.umn.edu
Subject: RE: [Mapserver-users] Wierd PostGIS Layer Error -
msPOSTGISLayerWhichShapes()


Testpoints is a table in the database with a geometry column. It's a
simple layer that contains 7 points. The geometry is held in the
"the_geom" field and when I do a select on the table in psql I can see
that in the "the_geom" field every record begins with "SRID=-1;POINT("
followed by the geometry.

Cheers,

Benjamin Wragg
-----Original Message-----
From: Lowther, David W [mailto:dlowther at ou.edu] 
Sent: Thursday, 23 January 2003 7:14 AM
To: 'bwragg at tpg.com.au'
Subject: RE: [Mapserver-users] Wierd PostGIS Layer Error -
msPOSTGISLayerWhichShapes()

Benjamin,

is there a geometry columns table in your database? does testpoints have
a
record in the table with SRID set?

Dave

-----Original Message-----
From: Benjamin Wragg [mailto:bwragg at tpg.com.au]
Sent: Wednesday, January 22, 2003 2:42 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Wierd PostGIS Layer Error -
msPOSTGISLayerWhichShapes()


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

_______________________________________________
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