[Mapserver-users] Mapserver + PostGIS for dummies.

Jason M. Nielsen jnielsen at aero-graphics.com
Fri Jan 16 10:01:45 EST 2004


Quoting Tyler Mitchell <TMitchell at lignum.com>:
> Hey Jason,
> We're on to something!
> > ERROR:  Attribute "name" not found
> 
> Hmmm...have you seen "name" anywhere else? i.e. in your map file?
> Yes...
> LAYER
>     CONNECTIONTYPE postgis
>     NAME "Utah Geological Study"
>     CONNECTION "user=gis_user dbname=pg00 host=localhost"
>     DATA "the_geom from s81"
>     STATUS default
>     TYPE POLYGON
> --> LABELITEM "name"
 
> > ERROR:  Attribute "name" not found
> 
> That's your problem!!
> 
> Your next steps?  Change "name" in your map file to some other meaningful
> field that you want on your map.  Otherwise, to keep it more simple,
> comment out the LABELITEM line and the whole LABEL....END section.  And see
> if you are up and running.

lol. I should have seen that.

I tried it but I am still getting the exact same error from mapserver.  But the
SELECT command after the BINARY CURSOR FOR works in psql.

So the question is now if the command works just performing the query manually
but I am getting the same error where to look next or is there a way to get more
detailed output perhaps from mapserv indicating precisely what is going on
behind the scenes?

msDrawMap(): Image handling error. Failed to draw layer named 'Utah Geological
Study'.
prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual query)
statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from s81 WHERE
the_geom && setSRID('BOX3D(1781048.9509602 472006.998403,2143367.3005688
833751.562963)'::BOX3D, find_srid('','s81','the_geom') )'

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.

For more help, please see http://postgis.refractions.net/documentation.php

Mappostgis.c - version of June 12/2003. 
------------------

MAP
  IMAGETYPE PNG
  UNITS feet
  EXTENT 1788886.749859 472006.998403 2135529.501670 833751.562963 
  SIZE 600 600
  PROJECTION
   "proj=latlong"
  END #end projection
  LAYER
    CONNECTIONTYPE postgis
    NAME "Utah Geological Study"
    CONNECTION "dbname=pg00 user=gis_user host=localhost"
    DATA "the_geom from s81"
    STATUS default
    TYPE POLYGON
    CLASS
      COLOR 255 255 255
        OUTLINECOLOR 255 0 0
    END #end class
  END #end layer
  SCALEBAR
    BACKGROUNDCOLOR 255 255 255
    COLOR 0 0 0
    IMAGECOLOR 0 0 0
    POSITION lr
    SIZE 200 50
    STATUS on
    STYLE 1
    TRANSPARENT on
    UNITS miles
  END #end scalebar
  WEB
    HEADER demo_header.html
    TEMPLATE demo.html
    FOOTER demo_footer.html
    MINSCALE 1000
    MAXSCALE 1550000
    IMAGEPATH "set in demo_init.html"
    IMAGEURL "set in demo_init.html"
  END #end web
END

END #end map


Thanks, Jason.

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/



More information about the mapserver-users mailing list