error accessing postgis
Rick Schumeyer
rschumeyer at IEEE.ORG
Mon Nov 28 07:45:57 PST 2005
Mapserver [v4.6.1] returns an error when I try to access a postgis [1.0.4]
database. (Postgis is installed with postgresql 8.1.0). I assume my
mapfile is incorrect, but I'm not sure what the mistake is.
Here is the error:
msDrawMap(): Image handling error. Failed to draw layer named 'sdata'.
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(iarea)),'NDR'),OID::text from sdata WHERE
iarea && setSRID('BOX3D(-180 -135,180 135)'::BOX3D,
find_srid('','sdata','iarea') )'
Postgresql reports the error as 'ERROR: column "oid" does not exist '
The relevant portion of my mapfile:
LAYER
NAME "sdata"
CONNECTIONTYPE POSTGIS
CONNECTION "dbname=gtest user=postgres host=localhost"
DATA "iarea from sdata"
TYPE line
STATUS default
CLASS
NAME "State Line"
STYLE
SYMBOL "BigLine"
SIZE 2
COLOR 255 0 0
END
END
END
The definition of the table "sdata":
Table "public.sdata"
Column | Type | Modifiers
------------+--------------------------+------------------------------------
----------------
id | integer | not null default
nextval('sdata_id_seq'::regclass)
instrument | character varying(20) |
begintime | timestamp with time zone |
endtime | timestamp with time zone |
iarea | geometry |
filename | character varying(512) |
Indexes:
"idx_iarea" gist (iarea)
Check constraints:
"enforce_dims_iarea" CHECK (ndims(iarea) = 2)
"enforce_geotype_iarea" CHECK (geometrytype(iarea) = 'POLYGON'::text OR
iarea IS NULL)
"enforce_srid_iarea" CHECK (srid(iarea) = 4326)
ECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(iarea)),'NDR'),OID::text from sdata WHERE
iarea && setSRID('BOX3D(-180 -135,180 135)'::BOX3D,
find_srid('','sdata','iarea') )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051128/2a92a468/attachment.htm>
More information about the MapServer-users
mailing list