<div dir="ltr"><div>Dear developers,</div><div>I have an issue with the java library on the call to <b>mapObj.draw()</b>, of <b>mapserver 7.6.4</b>, compiled and running on Ubuntu 20.04<b><br></b></div><div>Apparently it is "sensible" to the locale which is:</div><div>$ localectl<br> System Locale: LANG=it_IT.UTF-8<br> VC Keymap: n/a<br> X11 Layout: it<br> X11 Model: pc105<br>$ locale -c decimal_point<br>LC_NUMERIC<br>,<br>$</div><div><br></div><div>I already asked the mapserver-users list, but without success.<br></div><div><br><div class="gmail_quote"><div><b>Here is the code</b>:<br></div><div dir="ltr"><div dir="ltr"> mapObj myMap = new mapObj("myMapFile.map");<br> rectObj originalMapView = myMap.getExtent();<br> <br> rectObj maxView = new rectObj(-1, -1, -1, -1, myMap.getUnits().swigValue());<br> maxView.setMinx(originalMapView.getMinx());<br> maxView.setMaxx(originalMapView.getMaxx());<br> maxView.setMiny(originalMapView.getMiny());<br> maxView.setMaxy(originalMapView.getMaxy());<br><div><br></div><div><div> rectObj myView = new rectObj(-1, -1, -1, -1, 3);<br> myView.setMinx(<b>774076.75</b>);<br> myView.setMaxx(<b>1014076.75</b>);<br> myView.setMiny(<b>4875124.5</b>);<br> myView.setMaxy(<b>5115124.5</b>);</div> myMap.setExtent(myView);<br></div><div><br></div><div> myMap.setSize(600, 600);<br><br> pointObj mousePosition = new pointObj(300, 300, 0);<br> myMap.zoomPoint(1, mousePosition, 600, 600, myView, maxView);</div> myMap.draw();</div><div dir="ltr"><br></div><div><b>resulting in the error</b>:<br></div><div dir="ltr"><b>java.lang.UnknownError: msDrawMap():</b> Image handling error. Failed to draw layer named 'MyLayer'.;<b>msPostGISLayerWhichShapes(): Query error</b>. Error executing query. Check server logs<br>
edu.umn.gis.mapscript.mapscriptJNI.mapObj_draw(Native Method)<br>
edu.umn.gis.mapscript.mapObj.draw(mapObj.java:397)</div><div dir="ltr"><br></div><div><b>and in the ERROR file</b>:</div><div dir="ltr">[Wed Jan 26 17:14:19 2022].569532 msPostGISLayerWhichShapes(): Error (ERROR: parse error - invalid geometry<br>
HINT: "POLYGON((774076,75" <-- parse error at position 18 within geometry<br>
) executing query: select "my_column"::text,ST_AsBinary(("the_geom"),'NDR')
as geom,"gid"::text from (SELECT * FROM classi_comuni WHERE tipo_area =
2 ORDER BY tipo_area DESC) AS confini where "the_geom" &&
ST_GeomFromText('<b>POLYGON((774076,75 4875124,5,774076,75
5115124,5,1014076,75 5115124,5,1014076,75 4875124,5,774076,75 4875124,5))</b>',find_srid('','classi_comuni','the_geom'))</div><div dir="ltr"><br></div><div dir="ltr"><div>
<p class="MsoNormal">As far as I understand the correct query should be (in <b><span style="color:black;background:red none repeat scroll 0% 0%">red</span></b> the changes):</p>
</div>
<div>
<p class="MsoNormal">select "my_column"::text,ST_AsBinary(("the_geom"),'NDR')
as geom,"gid"::text from (SELECT * FROM classi_comuni WHERE tipo_area =
2 ORDER BY tipo_area DESC) AS confini where "the_geom" &&
ST_GeomFromText('<b>POLYGON((774076<span style="color:black;background:red none repeat scroll 0% 0%">.</span>75
4875124<span style="color:black;background:red none repeat scroll 0% 0%">.</span>5,774076<span style="color:black;background:red none repeat scroll 0% 0%">.</span>75 5115124<span style="color:black;background:red none repeat scroll 0% 0%">.</span>5,1014076<span style="color:black;background:red none repeat scroll 0% 0%">.</span>75 5115124<span style="color:black;background:red none repeat scroll 0% 0%">.</span>5,1014076<span style="color:black;background:red none repeat scroll 0% 0%">.</span>75
4875124.5,774076<span style="color:black;background:red none repeat scroll 0% 0%">.</span>75 4875124<span style="color:black;background:red none repeat scroll 0% 0%">.</span>5</b>))',find_srid('','classi_comuni','the_geom'))</p>
</div><div><br></div></div><div>I think the following parameters in mapfile could be of interest to you:<br></div><div dir="ltr"> CONFIG "MS_ERRORFILE" "myfile"<br> DEBUG 6<br> ...<br> LAYER<br> CONNECTIONTYPE postgis<br> DATA "the_geom FROM (SELECT * FROM classi_comuni WHERE tipo_area = 2 ORDER BY tipo_area DESC) AS confini USING UNIQUE gid"<br> CLASSITEM "my_column"<br> ...<br><br></div><div dir="ltr"><br></div><div>Please could you help?</div><div><br></div><div>Thank you,</div><div>Francesco<br></div><div dir="ltr"><br>
</div></div>
</div></div></div>