[Mapserver-users] mapserver+postgis schema
Alessio Ferrario
alessio.f at cost.it
Fri Apr 23 07:31:02 PDT 2004
Hi,
first of all thaks for your reply.
I follow yuor suggestion, but unfortunately no luck,I've still the same
problem.
Now my map filelook like this :
....
LAYER
NAME "isone"
STATUS ON
TYPE POLYGON
CONNECTIONTYPE POSTGIS
CONNECTION "user=postgres dbname=test_cc host=192.168.0.1 port=5432"
DATA "the_geom from cc.pippo_iso UNIQUE oid using SRID=-1"
....
This is the error reported by mapserver when i try to use the schema:
--------
msDrawMap(): Image handling error. Failed to draw layer named 'isone'.
prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
tipo::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from cc.pippo_iso UNIQUE oid WHERE the_geom && setSRID('BOX3D(527833.85 5040987,552290.15 5065452)'::BOX3D, -1 )'
Postgresql reports the error ''
More Help:
Error with POSTGIS data variable. You specified '<check your .map
file>'.
Standard ways of specifiying are :
(1) 'geometry_column from geometry_table'
(2) 'geometry_column from (<sub query>) as foo using unique <column
name> using SRID=<srid#>'
Make sure you put in the 'using unique <column name>' and 'using SRID=#'
clauses in....
in my postgres log i see:
-----
2004-04-23 14:47:54 [14740] ERROR: Function force_2d(cc.geometry) does
not exist
Unable to identify a function that satisfies the given argument
types
You may need to add explicit typecasts
2004-04-23 14:47:54 [14740] LOG: statement: DECLARE mycursor BINARY
CURSOR FOR SELECT
tipo::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),oid::text from cc.pippo_iso WHERE the_geom && setSRID('BOX3D(514064 5033607,515064 5034607)'::BOX3D, -1 )
----
It's seems I've no declared the function, but I've the function in my
schema "cc".
Maybe we have to declare in some way the "search_path" variable...
Any idea?
thanks to all
Ciao
Alessio
P.S.
obviously whne i use "public" schema all work fine
Il gio, 2004-04-22 alle 16:33, Alexandros Chimarios ha scritto:
> Also add the index oid on your query like this :
>
> DATA "the_geom from gis.it_iso using UNIQUE oid using SRID=-1"
>
>
> Please notice that you should have created the indexes (oid, srid)
> on your DB. Please refer to the PostGIS manual.
>
>
>
> On Thursday 22 April 2004 16:50, Alessio Ferrario wrote:
> > Hi all,
> > Can I use schema in a postgres layer?
> > my map file look like this:
> > ....
> > CONNECTIONTYPE POSTGIS
> > CONNECTION "user=dbuser dbname=ITALIA33 host=192.168.0.1 port=5432"
> > DATA "the_geom from gis.it_iso using SRID=-1"
> > ....
> >
> > I software configuration is:
> > postgres 7.3.4 running on Red Hat Linux 9
> > mapserver 4.0
> > php 4.3.4
> > apache 2.0.47
> >
> > thanks in advance
> > best regards
> > Alessio
--
Alessio Ferrario
e-mail: alessio.f at cost.it
Work: +39-02-454461
Fax +39-02-45446333
More information about the MapServer-users
mailing list