Re: [mapserver-users] msPostGISLayerWhichShapes() Error : java library set wrong query

2022-01-26 Thread Rahkonen Jukka (MML)
Hi,

I wonder if it could be related to which locale Java detects  on your computer 
– Italian (or Finnish) computer -> comma as a separator. Maybe something that 
deals around the same thing 
https://stackoverflow.com/questions/4713166/decimal-separator-in-numberformat.

-Jukka Rahkonen-

Lähettäjä: MapServer-users  Puolesta 
Francesco Martinelli
Lähetetty: keskiviikko 26. tammikuuta 2022 19.00
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] msPostGISLayerWhichShapes() Error : java library set 
wrong query

Hi all,
I have a java program calling the method draw() of class 
edu.umn.gis.mapscript.mapObj
after I compiled mapserver 7.6.4 on Ubuntu 20.04

The result produce the following error:
java.lang.UnknownError: msDrawMap(): Image handling error. Failed to draw layer 
named 'MyLayer'.;msPostGISLayerWhichShapes(): Query error. Error executing 
query. Check server logs
edu.umn.gis.mapscript.mapscriptJNI.mapObj_draw(Native Method)
edu.umn.gis.mapscript.mapObj.draw(mapObj.java:397)

In mapfile I set the parameters:
CONFIG "MS_ERRORFILE" "myfile"
DEBUG 6
...
LAYER
CONNECTIONTYPE postgis
DATA "the_geom FROM (SELECT * FROM classi_comuni WHERE tipo_area = 2 ORDER 
BY tipo_area DESC) AS confini USING UNIQUE gid"
CLASSITEM "my_column"
...
and in the error file I got the following message:
[Wed Jan 26 17:14:19 2022].558530 msDrawMap(): rendering using outputformat 
named png24 (AGG/PNG).
[Wed Jan 26 17:14:19 2022].569532 msPostGISLayerWhichShapes(): Error (ERROR:  
parse error - invalid geometry
HINT:  "POLYGON((774076,75" <-- parse error at position 18 within geometry
) 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('POLYGON((774076,75 4875124,5,774076,75 5115124,5,1014076,75 
5115124,5,1014076,75 4875124,5,774076,75 
4875124,5))',find_srid('','classi_comuni','the_geom'))
[Wed Jan 26 17:14:19 2022].569545 msPostGISLayerWhichShapes(): Query error. 
Error executing query. Check server logs
[Wed Jan 26 17:14:19 2022].569605 msDrawMap(): Image handling error. Failed to 
draw layer named 'MyLayer'.

I checked the error is caused by decimal separators being commas instead of 
dots.
As far as I understand the correct query would be (in red the changes):
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('POLYGON((774076.75 
4875124.5,774076.75 5115124.5,1014076.75 5115124.5,1014076.75 
4875124.5,774076.75 4875124.5))',find_srid('','classi_comuni','the_geom'))


I think I should set something during the compilation of java mapserver library.
Please can someone drive me on how to solve it?


Thank you,
Francesco



___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] msPostGISLayerWhichShapes() Error : java library set wrong query

2022-01-26 Thread Francesco Martinelli
Hi all,
I have a java program calling the method draw() of class
edu.umn.gis.mapscript.mapObj
after I compiled mapserver 7.6.4 on Ubuntu 20.04

The result produce the following error:
*java.lang.UnknownError: msDrawMap():* Image handling error. Failed to draw
layer named 'MyLayer'.;*msPostGISLayerWhichShapes(): Query error*. Error
executing query. Check server logs
edu.umn.gis.mapscript.mapscriptJNI.mapObj_draw(Native Method)
edu.umn.gis.mapscript.mapObj.draw(mapObj.java:397)

In mapfile I set the parameters:
*CONFIG* "MS_ERRORFILE" "myfile"
*DEBUG* 6
...
*LAYER*
*CONNECTIONTYPE* postgis
*DATA* "the_geom FROM (SELECT * FROM classi_comuni WHERE tipo_area = 2
ORDER BY tipo_area DESC) AS confini USING UNIQUE gid"
*CLASSITEM* "my_column"
...

and in the error file I got the following message:
[Wed Jan 26 17:14:19 2022].558530 msDrawMap(): rendering using outputformat
named png24 (AGG/PNG).
[Wed Jan 26 17:14:19 2022].569532 msPostGISLayerWhichShapes(): Error
(ERROR:  parse error - invalid geometry
HINT:  "POLYGON((774076,75" <-- parse error at position 18 within geometry
) 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('*POLYGON((774076,75
4875124,5,774076,75 5115124,5,1014076,75 5115124,5,1014076,75
4875124,5,774076,75 4875124,5))*',find_srid('','classi_comuni','the_geom'))
[Wed Jan 26 17:14:19 2022].569545 msPostGISLayerWhichShapes(): Query error.
Error executing query. Check server logs
[Wed Jan 26 17:14:19 2022].569605 msDrawMap(): Image handling error. Failed
to draw layer named 'MyLayer'.

I checked the error is caused by decimal separators being commas instead of
dots.
As far as I understand the correct query would be (in *red* the changes):
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('*POLYGON((774076.75
4875124.5,774076.75 5115124.5,1014076.75 5115124.5,1014076.75
4875124.5,774076.75 4875124.5*))',find_srid('','classi_comuni','the_geom'))


I think I should set something during the compilation of java mapserver
library.
Please can someone drive me on how to solve it?


Thank you,
Francesco
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] LUT file too long, what to do?

2022-01-26 Thread Rahkonen Jukka (MML)
Hi Thomas,

It appeared that GIMP has invented a new format for saving the curves since the 
Mapverver LUT processing option was introduced in 2006 and the new format is 
not supported anyway. GIMP can still export the old compact format and for that 
the 2500 character limit may be realistic.

-Jukka-

Lähettäjä: thomas bonfort 
Lähetetty: keskiviikko 26. tammikuuta 2022 12.19
Vastaanottaja: Rahkonen Jukka (MML) 
Kopio: Mapserver-Users (mapserver-users@lists.osgeo.org) 

Aihe: Re: [mapserver-users] LUT file too long, what to do?

Hi Jukka,
Unfortunately it's hardcoded: 
https://github.com/MapServer/MapServer/blob/2d73b379284aa12a2013929dfb6cdc244ae60994/mapdrawgdal.c#L1064
 but it shouldn't be very difficult for you to apply a local patch fixing that.
regards,
thomas

On Wed, Jan 26, 2022 at 11:11 AM Rahkonen Jukka (MML) 
mailto:jukka.rahko...@maanmittauslaitos.fi>>
 wrote:
Hi,

I am trying to adjust satellite image colors with a GIMP curve file but trial 
fails because the file is too long

[Wed Jan 26 12:03:52 2022].708000 msDrawRasterLayerLow(sentinel_lut): entering.
[Wed Jan 26 12:03:52 2022].713000 drawGDAL(): Unable to access file. LUT 
definition from file c:\ms4w_data\sentinel_malli_a.crv longer than maximum 
buffer size (2500 bytes).

Is this a hard coded limit or can user override it somehow? The .crv file has 
26000 characters and it is using ridiculous precision in entries 
(0.9826558159707) but it is not easy to shrink it into 2500 characters.

-Jukka Rahkonen-
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] LUT file too long, what to do?

2022-01-26 Thread thomas bonfort
Hi Jukka,
Unfortunately it's hardcoded:
https://github.com/MapServer/MapServer/blob/2d73b379284aa12a2013929dfb6cdc244ae60994/mapdrawgdal.c#L1064
but it shouldn't be very difficult for you to apply a local patch fixing
that.
regards,
thomas

On Wed, Jan 26, 2022 at 11:11 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> I am trying to adjust satellite image colors with a GIMP curve file but
> trial fails because the file is too long
>
>
>
> [Wed Jan 26 12:03:52 2022].708000 msDrawRasterLayerLow(sentinel_lut):
> entering.
>
> [Wed Jan 26 12:03:52 2022].713000 drawGDAL(): Unable to access file. LUT
> definition from file c:\ms4w_data\sentinel_malli_a.crv longer than maximum
> buffer size (2500 bytes).
>
>
>
> Is this a hard coded limit or can user override it somehow? The .crv file
> has 26000 characters and it is using ridiculous precision in entries
> (0.9826558159707) but it is not easy to shrink it into 2500 characters.
>
>
>
> -Jukka Rahkonen-
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] LUT file too long, what to do?

2022-01-26 Thread Rahkonen Jukka (MML)
Hi,

I am trying to adjust satellite image colors with a GIMP curve file but trial 
fails because the file is too long

[Wed Jan 26 12:03:52 2022].708000 msDrawRasterLayerLow(sentinel_lut): entering.
[Wed Jan 26 12:03:52 2022].713000 drawGDAL(): Unable to access file. LUT 
definition from file c:\ms4w_data\sentinel_malli_a.crv longer than maximum 
buffer size (2500 bytes).

Is this a hard coded limit or can user override it somehow? The .crv file has 
26000 characters and it is using ridiculous precision in entries 
(0.9826558159707) but it is not easy to shrink it into 2500 characters.

-Jukka Rahkonen-
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users