On Sat, Jan 17, 2015 at 1:54 PM, Sampo Savolainen <
[email protected]> wrote:

> Hi,
>
> This build error seems to be triggered by the windows build machine
> locale. The locale of the build server is affecting the results of the CQL
> numberFormat() function. This to me looks like a real issue and not just
> test case that is incompatible with windows.
>
> When GeoTools is running en_US: numberFormat('0.0', 1.48) produces "1.5"
> When GeoTools is running fi_FI: numberFormat('0.0', 1.48) produces "1,5"
> (in Finland, we use commas as decimal separators)
>
> As far as I know, CQL is not used in GeoTools to produce human-readable
> strings but instead to form filters, and in the test case in question, to
> produce strings that are to be sent to the backend WFS server.
>
> Options to clear the situation:
>  1. Set up a locale for the CQL parser FilterFactory which is then passed
> to the objects of different CQL function classes.
>  2. Hard code the DecimalFormatSymbols that will be used in
> FilterFunction_numberFormat()
>  3. Leave it be and change my unit test to check for the decimal separator
> in the current locale and have it use a different string value to compare
> the CQL results to.
>
> Analysis:
>  1. The change will require quite a bit of work. The change is necessary
> only if numberFormat() needs to be locale-aware.
>  2. Easy one-liner, but we will run into issues if people actually want
> locale-aware strings
>  3. Is a minimal change "fix". It gives us least worries that we break
> something for people whose geoserver (or other geotools use) requires
> locale aware number strings from CQL expressions. This of course leaves the
> underlying problem unresolved.
>
> Can anyone shed any light on whether numberFormat() needs to be
> locale-aware (where the locale would be defined by the server) or not? If
> not, 2. should be the way to go.
>

I'd go for 2, leaving the door open for an eventual third parameter in the
function for those that need to
use a non english locale.

Cheers
Andrea


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to