Hi Ian,
it might, or might not... to build legend graphics we create a sample
features with all default
values for the data types of the feature... it might be that map rendering
works,
but legend graphic fails
Cheers
Andrea
On Wed, Feb 15, 2017 at 4:07 PM, Ian Turton <[email protected]> wrote:
> Nope it isn't a bug - the error is quite clear
>
> <ServiceException>
>
> java.lang.IllegalArgumentException: Filter Function problem for
> function round argument #0 - expected type float
>
> Filter Function problem for function round argument #0 - expected type
> float
>
> </ServiceException></ServiceExceptionReport>
>
>
>
> You are passing something that isn't a number into the round function -
> you'll either need to check your attributes or add a check to the SLD to
> limit the input to numbers (probably with an if_then_else and a regexp)
>
> On 15 February 2017 at 14:51, Julian Hollingbery <[email protected]>
> wrote:
>
>> Hi list,
>>
>>
>>
>> I wonder if anyone else has seen something like this.
>>
>>
>>
>> I have a PostGIS table defined basically as
>>
>>
>>
>> CREATE TABLE vdline
>>
>> (
>>
>> ogc_fid serial NOT NULL,
>>
>> hast_gener character varying,
>>
>> kode_hast0 character varying,
>>
>> hast_lokal double precision,
>>
>> hast_gaeld double precision,
>>
>> hast_anbef double precision,
>>
>> hast_var_h character varying,
>>
>> geometri geometry(MultiLineString),
>>
>> CONSTRAINT vdline_pkey PRIMARY KEY (ogc_fid)
>>
>> )
>>
>> WITH (
>>
>> OIDS=FALSE
>>
>> );
>>
>>
>>
>> I publish it through GeoServer 2.9.1, using a style looking basically
>> like this:
>>
>>
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>
>> <StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www
>> .opengis.net/sld StyledLayerDescriptor.xsd" xmlns="
>> http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
>> xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2
>> 001/XMLSchema-instance">
>>
>> <NamedLayer>
>>
>> <Name>vdline</Name>
>>
>> <UserStyle>
>>
>>
>> <Title>Hastighedsgrænser</Title>
>>
>>
>> <Abstract>Visualisering af hastighedsgrænsedata</Abstract>
>>
>>
>> <FeatureTypeStyle>
>>
>>
>> <Rule>
>>
>>
>>
>> <Name>Skiltet hastighed 40</Name>
>>
>>
>>
>> <Title>Skiltet hastighed 40 km/t</Title>
>>
>>
>>
>> <Abstract>Skiltet hastighed (hast_lokal) 40 km/t. Etiket viser gældende
>> hastighed (hast_gaeld)</Abstract>
>>
>>
>>
>> <ogc:Filter>
>>
>>
>>
>>
>> <ogc:PropertyIsEqualTo>
>>
>>
>>
>>
>> <ogc:PropertyName>hast_lokal</ogc:PropertyName>
>>
>>
>>
>>
>> <ogc:Literal>40</ogc:Literal>
>>
>>
>>
>>
>> </ogc:PropertyIsEqualTo>
>>
>>
>>
>> </ogc:Filter>
>>
>>
>>
>> <LineSymbolizer>
>>
>>
>>
>> <Stroke>
>>
>>
>>
>>
>> <CssParameter name="stroke">#0000ff</CssParameter>
>>
>>
>>
>>
>> <CssParameter name="stroke-width">1</CssParameter>
>>
>>
>>
>> </Stroke>
>>
>>
>>
>> </LineSymbolizer>
>>
>>
>>
>> <TextSymbolizer>
>>
>>
>>
>> <Label>
>>
>> <ogc:Function name="round"><ogc:PropertyName
>> >hast_gaeld</ogc:PropertyName></ogc:Function>
>>
>>
>>
>> </Label>
>>
>>
>>
>> <Font>
>>
>>
>>
>>
>> <CssParameter name="font-size">10</CssParameter>
>>
>>
>>
>>
>> <CssParameter name="font-family">Arial</CssParameter>
>>
>>
>>
>>
>> <CssParameter name="font-color">#0000aa</CssParameter>
>>
>>
>>
>> </Font>
>>
>>
>>
>> <LabelPlacement>
>>
>>
>>
>>
>> <LinePlacement>
>>
>>
>>
>>
>>
>> <PerpendicularOffset>0</PerpendicularOffset>
>>
>>
>>
>>
>> </LinePlacement>
>>
>>
>>
>> </LabelPlacement>
>>
>>
>>
>> <Halo>
>>
>>
>>
>>
>> <Radius>
>>
>>
>>
>>
>> <ogc:Literal>1</ogc:Literal>
>>
>>
>>
>>
>> </Radius>
>>
>>
>>
>>
>> <Fill>
>>
>>
>>
>>
>> <CssParameter name="fill">#f4faf6</CssParameter>
>>
>>
>>
>> </Fill>
>>
>>
>>
>> </Halo>
>>
>>
>>
>> <Fill>
>>
>>
>>
>>
>> <CssParameter name="fill">#0000aa</CssParameter>
>>
>>
>>
>> </Fill>
>>
>>
>>
>> <VendorOption name="maxDisplacement">50</Ven
>> dorOption>
>>
>>
>>
>> <VendorOption name="removeOverlaps">true</Ve
>> ndorOption>
>>
>>
>>
>> <VendorOption name="followLine">true</Vendor
>> Option>
>>
>>
>>
>> <VendorOption name="group">true</VendorOption>
>>
>>
>>
>> </TextSymbolizer>
>>
>>
>> </Rule>
>>
>>
>> </FeatureTypeStyle>
>>
>> </UserStyle>
>>
>> </NamedLayer>
>>
>> </StyledLayerDescriptor>
>>
>>
>>
>> The complete SLD contains multiple <FeatureTypeStyle>s for various values
>> of <PropertyName>hast_lokal</PropertyName>.
>>
>>
>>
>> If I make a GetLegendGraphic-request like
>>
>> http://hostname/workspace/wms?service=WMS&version=1.1.0&requ
>> est=GetLegendGraphic&layer=vdline&format=image/png
>>
>> I get the error:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE
>> ServiceExceptionReport SYSTEM "http://gs.demo.geoteamwork.co
>> m:80/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport
>> version="1.1.1" > <ServiceException>
>>
>> java.lang.IllegalArgumentException: Filter Function problem for
>> function round argument #0 - expected type float
>>
>> Filter Function problem for function round argument #0 - expected type
>> float
>>
>> </ServiceException></ServiceExceptionReport>
>>
>>
>>
>> If I modify the SLD, specifically the <Label>, removing the <ogc:Function
>> name=”round”>, so that it becomes
>>
>>
>>
>> <Label>
>>
>> <ogc:PropertyName>hast_gaeld</ogc:PropertyName>
>>
>>
>>
>> </Label>
>>
>>
>>
>> I get a nice legend. Is that a bug?
>>
>>
>>
>> Regards,
>>
>> /julian
>>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Geoserver-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
>>
>
>
> --
> Ian Turton
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
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.
-------------------------------------------------------
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users