[Geoserver-users] SLD: WellKnownName based on property?

Is it possible to have the WellKnownName of a mark be dependent on a property name (or using the recode filter function)? Based on a few experiments I think it’s not possible…


Volg Aquafin op Facebook | Twitter | YouTube | LinkedIN

Disclaimer: zie www.aquafin.be P Denk aan het milieu. Druk deze mail niet onnodig af.

On Wed, Jul 17, 2013 at 4:36 PM, Roel De Nijs <roel.denijs@anonymised.com>wrote:

Is it possible to have the WellKnownName of a mark be dependent on a
property name (or using the recode filter function)? Based on a few
experiments I think it’s not possible…

Hmm... no, it is actually possible.
There is also an example showing the usage of a function in it here:
http://docs.geoserver.org/stable/en/user/styling/sld-extensions/substitution.html

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------

If it’s possible, that would be really great for simplifying our 3000+ line SLDs. One of the things I tried, was the following code but that doesn’t work

<ogc:Function name=“Recode”>

ogc:PropertyNamenode_type</ogc:PropertyName>

ogc:LiteralPUT</ogc:Literal>

ogc:Literalttf://AQFBestaand#0x0048</ogc:Literal>

</ogc:Function>

I also tried this with no success (where property “vorm” contains the correct values):

ogc:PropertyNamevorm</ogc:PropertyName>

Van: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Namens Andrea Aime
Verzonden: woensdag 17 juli 2013 16:52
Aan: Roel De Nijs
CC: geoserver-users@lists.sourceforge.net
Onderwerp: Re: [Geoserver-users] SLD: WellKnownName based on property?

On Wed, Jul 17, 2013 at 4:36 PM, Roel De Nijs <roel.denijs@anonymised.com73…> wrote:

Is it possible to have the WellKnownName of a mark be dependent on a property name (or using the recode filter function)? Based on a few experiments I think it’s not possible…

Hmm… no, it is actually possible.

There is also an example showing the usage of a function in it here:

http://docs.geoserver.org/stable/en/user/styling/sld-extensions/substitution.html

Cheers

Andrea

==

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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



Volg Aquafin op Facebook | Twitter | YouTube | LinkedIN

Disclaimer: zie www.aquafin.be P Denk aan het milieu. Druk deze mail niet onnodig af.

Based on the section about “dynamic symbolizer" which can be found on [1] I was able to do what I wanted using:

${Concatenate(‘ttf://ourfont#0x’, VORM)}

When I try to generate a legend I get the following exception, so I guess the legend just iterates through all rules in an sld an visualizes them (without interpretation of the actual layer data). So with just 1 defined rule in the sld, the legend will be very limited J

java.lang.IllegalArgumentException: The specified mark ${Concatenate('ttf://ourfont#0x', vorm)} was not found!

The specified mark ${Concatenate('ttf://ourfont#0x', vorm)} was not found!

[1] http://docs.geoserver.org/stable/en/user/styling/sld-extensions/pointsymbols.html

Van: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Namens Andrea Aime
Verzonden: woensdag 17 juli 2013 16:52
Aan: Roel De Nijs
CC: geoserver-users@lists.sourceforge.net
Onderwerp: Re: [Geoserver-users] SLD: WellKnownName based on property?

On Wed, Jul 17, 2013 at 4:36 PM, Roel De Nijs <roel.denijs@anonymised.com73…> wrote:

Is it possible to have the WellKnownName of a mark be dependent on a property name (or using the recode filter function)? Based on a few experiments I think it’s not possible…

Hmm… no, it is actually possible.

There is also an example showing the usage of a function in it here:

http://docs.geoserver.org/stable/en/user/styling/sld-extensions/substitution.html

Cheers

Andrea

==

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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



Volg Aquafin op Facebook | Twitter | YouTube | LinkedIN

Disclaimer: zie www.aquafin.be P Denk aan het milieu. Druk deze mail niet onnodig af.

On Thu, Jul 18, 2013 at 10:05 AM, Roel De Nijs <roel.denijs@anonymised.com>wrote:

Based on the section about “dynamic symbolizer" which can be found on
[1] I was able to do what I wanted using:

            <WellKnownName>${Concatenate('ttf://ourfont#0x',
VORM)}</WellKnownName>

When I try to generate a legend I get the following exception, so I guess
the legend just iterates through all rules in an sld an visualizes them
(without interpretation of the actual layer data). So with just 1 defined
rule in the sld, the legend will be very limited J

Yes, of course, we cannot scan the whole data set just to generate the
legend, that would take ages
(I've played with vector dataset with up to 50 million records... do you
really want to scan them to generate a legend?)
For these cases we cannot scan the whole dataset, or even just try to
extract the unique values,
one needs to provide a static legend instead (there was work towards this,
but I don't remember where it ended up)

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------

geowolf wrote

Yes, of course, we cannot scan the whole data set just to generate the
legend, that would take ages
(I've played with vector dataset with up to 50 million records... do you
really want to scan them to generate a legend?)
For these cases we cannot scan the whole dataset, or even just try to
extract the unique values,
one needs to provide a static legend instead (there was work towards this,
but I don't remember where it ended up)

Cheers
Andrea

Confirms what I thought. Thanks!

I updated the column (which determines the WellKnownName) to a non-existing
value (simulating a wrong data conversion) and tried to generate the map,
which failed (and a crystal clear log message was written to the error log).
Is it possible to ignore these wrong features or give them some default
rendering, like you can do with an ElseFilter?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-WellKnownName-based-on-property-tp5067087p5067324.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Thu, Jul 18, 2013 at 1:35 PM, Roel De Nijs <roel.denijs@anonymised.com>wrote:

geowolf wrote
> Yes, of course, we cannot scan the whole data set just to generate the
> legend, that would take ages
> (I've played with vector dataset with up to 50 million records... do you
> really want to scan them to generate a legend?)
> For these cases we cannot scan the whole dataset, or even just try to
> extract the unique values,
> one needs to provide a static legend instead (there was work towards
this,
> but I don't remember where it ended up)
>
> Cheers
> Andrea

Confirms what I thought. Thanks!

I updated the column (which determines the WellKnownName) to a non-existing
value (simulating a wrong data conversion) and tried to generate the map,
which failed (and a crystal clear log message was written to the error
log).
Is it possible to ignore these wrong features or give them some default
rendering, like you can do with an ElseFilter?

Not with the recode function. I guess you can create a large Filter in your
rule
with the recode, that only accepts the values you want, and then have
a else filter to catch everything else

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------