[mapserver-users] Parse Error: how can I set the decimal separator in Java Mapscript ?

Francesco Martinelli francesco.martinelli at ingv.it
Wed Mar 7 08:59:03 PST 2018


Hi there,
on a freshly installed Ubuntu 16.04
I have just compiled Mapserver 7.0.7, with generation of java mapscript 
enabled.
Apparently everything worked fine,
but I found an issue with decimal separator when calling mapObj.draw()

I wonder if I could avoid the problem setting some variable during the 
compilation,
or if I did anything wrong.

Following are the steps which ggenerated the error.

Thank you in advance for any help,
Francesco.


I prepared the map file, having a layer with connection to a 
postgresql/postgis database with the following version:

"POSTGIS="2.2.1 r14555" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 
08 September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" 
LIBXML="2.9.3" LIBJSON="0.11.99" TOPOLOGY RASTER"

"PostgreSQL 9.5.12 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 
5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609, 64-bit"

I use the map file from a program in java, and when I call the method 
mapObj.draw()
I get the error:
msDrawMap(): Image handling error. Failed to draw layer named 
'AreeNazionali'.;msPostGISLayerWhichShapes(): Query error. Error 
executing query. Check server logs

I activated the debug in the map file,
and in the log I got the following lines:
[Wed Mar  7 17:28:55 2018].538014 msDrawMap(): rendering using 
outputformat named png24 (AGG/PNG).
[Wed Mar  7 17:28:55 2018].538994 msDrawRasterLayerLow(base_raster_1): 
entering.
[Wed Mar  7 17:28:55 2018].543385 msDrawMap(): Layer 0 (base_raster_1), 
0,005s
[Wed Mar  7 17:28:55 2018].574328 msPostGISLayerWhichShapes(): Error 
(ERROR:  parse error - invalid geometry
HINT:  "POLYGON((1056176,6" <-- parse error at position 18 within geometry
) executing query: select 
"tipo_area",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex') as 
geom,"gid" from (SELECT * FROM view_aree_geografiche ORDER BY tipo_area 
DESC) AS confini where the_geom && 
ST_GeomFromText('POLYGON((1056176,62493897 
4390888,49858335,1056176,62493897 4490888,49940103,1156176,62428404 
4490888,49940103,1156176,62428404 4390888,49858335,1056176,62493897 
4390888,49858335))',find_srid('','view_aree_geografiche','the_geom')) 
and ("tipo_area" > 1)
[Wed Mar  7 17:28:55 2018].574348 msPostGISLayerWhichShapes(): Query 
error. Error executing query. Check server logs
[Wed Mar  7 17:28:55 2018].574452 msDrawMap(): Image handling error. 
Failed to draw layer named 'AreeNazionali'.

If I change the select to:
select 
"tipo_area",encode(ST_AsBinary(ST_Force2D("the_geom"),'NDR'),'hex') as 
geom,"gid" from (SELECT * FROM view_aree_geografiche ORDER BY tipo_area 
DESC) AS confini where the_geom && 
ST_GeomFromText('POLYGON((1056176.62493897 
4390888.49858335,1056176.62493897 4490888.49940103,1156176.62428404 
4490888.49940103,1156176.62428404 4390888.49858335,1056176.62493897 
4390888.49858335))',find_srid('','view_aree_geografiche','the_geom')) 
and ("tipo_area" > 1)

and try to run within postgresql, it makes a result, and I think it 
could solve the problem...!




More information about the MapServer-users mailing list