error accessing postgis

Bart van den Eijnden BEN at SYNCERA-ITSOLUTIONS.NL
Mon Nov 28 08:02:09 PST 2005


See:
http://lists.maptools.org/pipermail/ms4w-users/2005-November/000363.html

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> Rick Schumeyer <rschumeyer at IEEE.ORG> 11/28/05 4:45 PM >>>
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') )

 

 



More information about the MapServer-users mailing list