[MapServer-users] Database problem when using CLASSITEM
    Bob Basques 
    bob.basques at ci.stpaul.mn.us
       
    Mon May  1 06:59:39 PDT 2023
    
    
  
Jeremy,
One thing to check is the column name in Postgres, as in “CLASS” vs “class” vs “Class”, etc.   Needs to match.  Check the same thing on EXPRESSION values.
bobb
My machine - - - PW19-S295-C024
From: MapServer-users <mapserver-users-bounces at lists.osgeo.org> On Behalf Of Jeremy JK
Sent: Saturday, April 29, 2023 2:12 PM
To: Jason Snyder <mapserver-users at lists.osgeo.org>
Subject: [MapServer-users] Database problem when using CLASSITEM
Think Before You Click: This email originated outside our organization.
Hola
OK so I am going through the MapServer tutorial
Example 1-3 to be exact
the one with the classes
using classes to split layer polygon into land and water
when shp and dbf file is in filesystem it works fine
But
When I import shp file into postgres I get the following error
After checking the error logs, my question is how do I get a class column? Do I have to insert the dbf file into schema? If so, how?
Thanks
Error:
msDrawMap(): Image handling error. Failed to draw layer named 'states_poly'. msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs
Query:
http://localhost:8081/cgi-bin/mapserv?map=/opt/map/mdm60/example1-3.map&layer=states_poly&layer=states_line&mode=map
Mapfile:
MAP
  IMAGETYPE      PNG
  EXTENT         -97.238976 41.619778 -82.122902 49.385620
  SIZE           400 300
  SHAPEPATH      "/opt/map/mdm60/ms4w/apps/tutorial/data/"
  IMAGECOLOR     255 255 255
  LAYER
    NAME         "states_poly"
    CONNECTIONTYPE POSTGIS
    CONNECTION "user=postgres password=postgres dbname=mdm6data host=mxsig-db port=5432"
    DATA         "wkb_geometry from tutoiral.states_ugl_imported using srid=3857"
    STATUS       OFF
    TYPE         POLYGON
CLASSITEM "CLASS"
CLASS
      NAME 'States'
      EXPRESSION 'land'
  STYLE
        COLOR      232 232 232
      END
    END
    CLASS
      NAME 'Water'
      EXPRESSION 'water'
      STYLE
        COLOR      198 198 255
      END
    END
  END
                                                                             LAYER
    NAME         "states_line"
    CONNECTIONTYPE POSTGIS
    CONNECTION "user=postgres password=postgres dbname=mdm6data host=mxsig-db port=5432"
    DATA         "wkb_geometry from tutorial.sttes_ugl_imported using srid=3875"
    STATUS       OFF
    TYPE         LINE
    CLASSITEM    "CLASS"
    CLASS
      NAME       'State Boundary'
      EXPRESSION 'land'
      STYLE
        COLOR    32 32 32
      END
    END
  END
END
Error Log:
[Sat Apr 29 19:08:42 2023].232185 CGI Request 1 on process 1677
[Sat Apr 29 19:08:42 2023].233452 msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Sat Apr 29 19:08:42 2023].233473 msDrawMap(): WMS/WFS set-up and query, 0.000s
[Sat Apr 29 19:08:42 2023].282742 msPostGISLayerWhichShapes(): Error (ERROR:  no existe la columna «CLASS»
LINE 1: select "CLASS"::text,ST_AsBinary(("wkb_geometry"),'NDR') as ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230501/c025f6ce/attachment.htm>
    
    
More information about the MapServer-users
mailing list