<div dir="ltr"><div dir="auto">Hi Bob,</div><div dir="auto">Thanks for the guidance </div><div>I had been "misdirected" by the mentioning of the dbf file in tutorial </div><div>Hope you guys can clear up some more of my misdirections in the future </div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 1, 2023, 9:59 AM Bob Basques <<a href="mailto:bob.basques@ci.stpaul.mn.us" target="_blank">bob.basques@ci.stpaul.mn.us</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)">Jeremy,<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)"><u></u> <u></u></span></b></p>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)">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.<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)"><u></u> <u></u></span></b></p>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)">bobb<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)"><u></u> <u></u></span></b></p>
<div>
<p class="MsoNormal"><span style="color:rgb(0,176,240)"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)">My machine - - - PW19-S295-C024<u></u><u></u></span></b></p>
</div>
<p class="MsoNormal"><b><span style="color:rgb(0,176,240)"><u></u> <u></u></span></b></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> MapServer-users <<a href="mailto:mapserver-users-bounces@lists.osgeo.org" rel="noreferrer" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>>
<b>On Behalf Of </b>Jeremy JK<br>
<b>Sent:</b> Saturday, April 29, 2023 2:12 PM<br>
<b>To:</b> Jason Snyder <<a href="mailto:mapserver-users@lists.osgeo.org" rel="noreferrer" target="_blank">mapserver-users@lists.osgeo.org</a>><br>
<b>Subject:</b> [MapServer-users] Database problem when using CLASSITEM<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<table border="1" cellpadding="0" style="background:rgb(226,247,0);border:1pt solid black">
<tbody>
<tr>
<td style="border:none;padding:0.75pt">
<p class="MsoNormal"><strong><span style="font-family:Calibri,sans-serif;color:rgb(255,51,51)">Think Before You Click:
</span></strong><span style="color:rgb(255,51,51)">This email originated <strong><span style="font-family:Calibri,sans-serif">outside
</span></strong>our organization.</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hola <br>
<br>
OK so I am going through the MapServer tutorial <br>
Example 1-3 to be exact <br>
the one with the classes <br>
using classes to split layer polygon into land and water <br>
<br>
when shp and dbf file is in filesystem it works fine <br>
But <br>
When I import shp file into postgres I get the following error <br>
<br>
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?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt">Thanks <br>
<br>
<b>Error</b>: <br>
msDrawMap(): Image handling error. Failed to draw layer named 'states_poly'. msPostGISLayerWhichShapes(): Query error. Error executing query. Check server logs<br>
<br>
<br>
<b>Query: <br>
</b><a href="http://localhost:8081/cgi-bin/mapserv?map=/opt/map/mdm60/example1-3.map&layer=states_poly&layer=states_line&mode=map" rel="noreferrer" target="_blank">http://localhost:8081/cgi-bin/mapserv?map=/opt/map/mdm60/example1-3.map&layer=states_poly&layer=states_line&mode=map</a><br>
<br>
<br>
<b>Mapfile</b>:<br>
MAP<br>
IMAGETYPE PNG<br>
EXTENT -97.238976 41.619778 -82.122902 49.385620<br>
SIZE 400 300<br>
SHAPEPATH "/opt/map/mdm60/ms4w/apps/tutorial/data/"<br>
IMAGECOLOR 255 255 255<br>
<br>
LAYER <br>
NAME "states_poly"<br>
CONNECTIONTYPE POSTGIS<br>
CONNECTION "user=postgres password=postgres dbname=mdm6data host=mxsig-db port=5432"<br>
DATA "wkb_geometry from tutoiral.states_ugl_imported using srid=3857"<br>
STATUS OFF<br>
TYPE POLYGON<br>
<br>
CLASSITEM "CLASS"<br>
<br>
CLASS<br>
NAME 'States'<br>
EXPRESSION 'land' <br>
STYLE<br>
COLOR 232 232 232<br>
END<br>
END<br>
CLASS<br>
NAME 'Water'<br>
EXPRESSION 'water' <br>
STYLE<br>
COLOR 198 198 255<br>
END<br>
END<br>
END <br>
LAYER
<br>
NAME "states_line"<br>
CONNECTIONTYPE POSTGIS<br>
CONNECTION "user=postgres password=postgres dbname=mdm6data host=mxsig-db port=5432"<br>
DATA "wkb_geometry from tutorial.sttes_ugl_imported using srid=3875"<br>
STATUS OFF<br>
TYPE LINE<br>
<br>
CLASSITEM "CLASS"<br>
<br>
CLASS<br>
NAME 'State Boundary'<br>
EXPRESSION 'land'<br>
STYLE<br>
COLOR 32 32 32<br>
END<br>
END<br>
END <br>
<br>
<br>
END <br>
<br>
<b>Error Log:<br>
</b>[Sat Apr 29 19:08:42 2023].232185 CGI Request 1 on process 1677<br>
[Sat Apr 29 19:08:42 2023].233452 msDrawMap(): rendering using outputformat named png (AGG/PNG).<br>
[Sat Apr 29 19:08:42 2023].233473 msDrawMap(): WMS/WFS set-up and query, 0.000s<br>
[Sat Apr 29 19:08:42 2023].282742 msPostGISLayerWhichShapes(): Error (ERROR: no existe la columna «CLASS»<br>
LINE 1: select "CLASS"::text,ST_AsBinary(("wkb_geometry"),'NDR') as ...<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div>