Hi geoserver-community,
My name is David, this is my first post in the list and I feel curious about how SLD styling works in Geoserver. I am styling some layers using YSLD files and I am using filters in my rules. These filters look like this:
name: style_example
title: projects
feature-styles:
- rules:
- filter: ${ Attribute1 = ‘Value A’ AND status = ‘Ok’}
name: Ok
symbolizers:
- point:
size: *size
symbols:
- mark:
shape: circle
fill-color: ‘#0000FF’
I have lots of similar rules and the statement Attribute1 = ‘Value A’ never changes.
I have used the following way for working with variables:
define: &attribute_name ${Attribute1 = ‘Value A’}
name: style_example2
title: projects
feature-styles:
- rules:
- filter: *attribute_name
- filter: ${status = ‘Ok’}
name: Ok
symbolizers:
- point:
size: *size
symbols:
- mark:
shape: circle
fill-color: ‘#0000FF’
Would you know if Geoserver process these two types of styling in the same way? I mean, needs Geoserver to import the data twice when I use two filters in my rule instead of compounding the statements in only one filter?
The next thing may it be related or not but, I have tried to compare the SLD version using the Rest API(Geoserver version 2.10.2), and I couldn’t be able to get the SLD version of my style:
http://localhost:8080/geoserver/rest/resource/workspaces/myworkspace/styles/yaml_file_example.sld
Even though I am able to download the yaml version(native extension of the style) using the Rest API, I can not get the SLD (transformed) version of the style. I have the following answer from Geoserver:
Undefined resource path.
(However, I am able to get the SLD and YAML version of the example styles of Geoserver)
Thank a lot,
David
—
Deutsche Telekom IT GmbH
Technology Solution
David Lopez Villegas
GIS-mobile
Oberkasseler Strasse 2, 53227 Bonn, Germany
+49 228 18149623 (Phone)
E-Mail: david-lopez.villegas@anonymised.com
Internet: www.telekom.com
Life is for sharing.
You can find the obligatory information on www.telekom.com/compulsory-statement-dtit
Big changes start small – conserve resources by not printing every e-mail.
Notice: This transmittal and/or attachments may be privileged or confidential. It is intended solely for the addressee named above. Any dissemination, or copying is strictly prohibited. If you received this transmittal in error, please notify us immediately by reply and immediately delete this message and all its attachments. Thank you.
Hi,
the rules here are a bit complex. In general GeoServer tries to make a single query per layer to the data source by combining in OR the various filters.
However, some data sources report errors or have very poor performance with large/complex filters, so there is a hard-coded limit
of 20 combined filters to be sent to the database, if we go above, only the BBOX filter is sent and all other filtering happens in memory.
This limit rarely needs tweaking so it’s not exposed in the UI or configuration, but if you need to change it, you can set a system
variable, servlet variable, or environment variable to alter it. It’s called MAX_FILTER_RULES.
For example, a system variable given to the JVM running GeoServer would look like this:
-DMAX_FILTER_RULES=50
Cheers
Andrea
···
On Tue, Apr 25, 2017 at 5:28 PM, <David-Lopez.Villegas@anonymised.com> wrote:
Hi geoserver-community,
My name is David, this is my first post in the list and I feel curious about how SLD styling works in Geoserver. I am styling some layers using YSLD files and I am using filters in my rules. These filters look like this:
name: style_example
title: projects
feature-styles:
- rules:
- filter: ${ Attribute1 = ‘Value A’ AND status = ‘Ok’}
name: Ok
symbolizers:
- point:
size: *size
symbols:
- mark:
shape: circle
fill-color: ‘#0000FF’
I have lots of similar rules and the statement Attribute1 = ‘Value A’ never changes.
I have used the following way for working with variables:
define: &attribute_name ${Attribute1 = ‘Value A’}
name: style_example2
title: projects
feature-styles:
- rules:
- filter: *attribute_name
- filter: ${status = ‘Ok’}
name: Ok
symbolizers:
- point:
size: *size
symbols:
- mark:
shape: circle
fill-color: ‘#0000FF’
Would you know if Geoserver process these two types of styling in the same way? I mean, needs Geoserver to import the data twice when I use two filters in my rule instead of compounding the statements in only one filter?
The next thing may it be related or not but, I have tried to compare the SLD version using the Rest API(Geoserver version 2.10.2), and I couldn’t be able to get the SLD version of my style:
http://localhost:8080/geoserver/rest/resource/workspaces/myworkspace/styles/yaml_file_example.sld
Even though I am able to download the yaml version(native extension of the style) using the Rest API, I can not get the SLD (transformed) version of the style. I have the following answer from Geoserver:
Undefined resource path.
(However, I am able to get the SLD and YAML version of the example styles of Geoserver)
Thank a lot,
David
—
Deutsche Telekom IT GmbH
Technology Solution
David Lopez Villegas
GIS-mobile
Oberkasseler Strasse 2, 53227 Bonn, Germany
+49 228 18149623 (Phone)
E-Mail: david-lopez.villegas@anonymised.com180…de
Internet: www.telekom.com
Life is for sharing.
You can find the obligatory information on www.telekom.com/compulsory-statement-dtit
Big changes start small – conserve resources by not printing every e-mail.
Notice: This transmittal and/or attachments may be privileged or confidential. It is intended solely for the addressee named above. Any dissemination, or copying is strictly prohibited. If you received this transmittal in error, please notify us immediately by reply and immediately delete this message and all its attachments. Thank you.
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
Geoserver-users@anonymised.com.382…sourceforge.net
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.