[MAPSERVER-USERS] Error: Schema definition in postgis layer

Ritesh Ambastha group.ritesh at gmail.com
Tue Jul 15 07:09:24 EDT 2008


Hello,

I am connecting to postgis for displaying maps.

I have a schema named as 'testschema' and table 'test'

I get these errors when I try to display the map.

<snip>
1.Without specifying schema:

DATA "the_geom FROM test USING UNIQUE fid SRID -1"

msDrawMap(): Image handling error. Failed to draw layer named 'test'.
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(the_geom)),'NDR'),fid::text from test
WHERE the_geom && setSRID('BOX3D(-548821.411568409 1455242,-506293.588431591
1487129)'::BOX3D, find_srid('','test','the_geom') )' Postgresql reports the
error as 'ERROR: relation "test" does not exist '...............

2. After specifying schema

DATA "the_geom FROM testschema.test USING UNIQUE fid SRID -1"

msDrawMap(): Image handling error. Failed to draw layer named 'test'.
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(the_geom)),'NDR'),fid::text from
testschema.test WHERE the_geom && setSRID('BOX3D(-548821.411568409
1455242,-506293.588431591 1487129)'::BOX3D,
find_srid('','testschema.test','the_geom') )' Postgresql reports the error
as 'ERROR: function force_2d(testschema.geometry) does not exist LINE 1:
...INARY CURSOR FOR SELECT asbinary(force_collection(force_2d(t... ^ HINT:
No function matches the given name and argument types. You might need to add
explicit type casts. ' ................

</snip>

Also, when I keep the table in public schema, it works without any error.

I need to know the correct way to define schema in mapfile while using
postgis.

Right now I am using these statements in my mapfile:

  CONNECTIONTYPE postgis

  CONNECTION "user=postgres password=postgres dbname=map host=xx.xx.xxx.xxx
port=5432"
  DATA "the_geom from test USING UNIQUE fid SRID -1"

Thanks,
Ritesh Ambastha
-- 
View this message in context: http://www.nabble.com/Error%3A-Schema-definition-in-postgis-layer-tp18462571p18462571.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list