Hot answers tagged

10 votes
Accepted

Qgis exported SLD file is not valid on Geoserver

Current QGIS releases export invalid SLD 1.1 in various ways. In your example, you should amend the gap this way: <se:Gap>3</se:Gap> There are also other issues like wrong sizes and the ...
Andrea Aime's user avatar
  • 17.3k
9 votes
Accepted

Rotation in GeoServer SLD

Something like this should work, using the math operators - please note it is untested: <Rotation> <ogc:Div> <ogc:Sub> <ogc:Literal>450</ogc:Literal&...
JimT's user avatar
  • 2,373
8 votes

Geoserver SLD external graphic path

Check if you have created the style definition inside a workspace. If you are in this situation you have to place the png image into $GEOSERVER_DATA_DIR/wokspaces/{Name}/styles directory or any ...
Juan Jaraices's user avatar
8 votes
Accepted

Filtering number of features in GeoServer using SLD?

Personally, I would try to separate data store access/publishing from layer styling. You could create a SQL View for the datastore, effectively adding a new layer with the query result table. The ...
geozelot's user avatar
  • 29.8k
7 votes

Does QGIS support .sld style files for raster layers?

There is a plugin in the Official Repository that seems to be what you were looking for. It's called SLD4raster. https://plugins.qgis.org/plugins/SLD4raster/
Alexandre Neto's user avatar
7 votes

Using Conditional Statement in SLD GeoServer

You can use something like this: <ogc:Mul> <ogc:PropertyName>variable</ogc:PropertyName> <ogc:Function name="if_then_else"> <ogc:Function name="between"> ...
Zoran Kokeza's user avatar
6 votes

Force all labels visible in GeoServer

You can use : <VendorOption name="partials">true</VendorOption> to tell geoserver to render labels that are partially visible
Olyster's user avatar
  • 171
6 votes

Converting ArcGIS layer style to Styled Layer Descriptor (SLD) file?

I have confirmed that arcmap2sld tool is working fine on ArcGIS Desktop 10.1+. The program can be downloaded from this link and the readme docs are here. The program transforms an ArcMap project's ...
Alex Tereshenkov's user avatar
6 votes
Accepted

OpenLayers 3 WMS Styling Using SLD_BODY and POST request

I am not sure whether my answer is going to give you the final solution. But give it a try and let us know if something good comes up. So do the following: add tileLoadFunction to your source. Like ...
pavlos's user avatar
  • 3,538
6 votes
Accepted

problem displaying inline features with geoserver sld

Your SLD is stored in the configuration, and you are assuming that you can call it by name. That's not how it works. User layers can only be used when you are making POST requests for your GetMap, as ...
Andrea Aime's user avatar
  • 17.3k
6 votes
Accepted

Creating custom SLDs for Heatmaps using GeoServer

Consider the use of Rendering transformation. Check the example Heatmap SLD. with Variable substitution in SLD to pass dynamic values with WMS request parameters.
WKT's user avatar
  • 2,183
6 votes

Changing background color to transparent in GeoServer?

Here an example to create one transparent classe. You will use opacity="0.0" parameter: <sld:ColorMap> <sld:ColorMapEntry color="#000000" opacity="0.0" quantity="-999"/> ...
WKT's user avatar
  • 2,183
6 votes
Accepted

Geoserver tiles missing point labels that show up fine when serving as a single tile

I did further research, and the following three "vendorOption" parameters were recommended where labels are left off when you really want them labeled in the tiles. I'll explain each briefly and why ...
Brian B's user avatar
  • 805
6 votes
Accepted

Using Math in SLD file - wkt

You can do math in SLD in most places, but a WellKnownMark element is not one of them. This is what the standard says, GeoServer has a custom extension allowing to stick a CQL expression in the ...
Andrea Aime's user avatar
  • 17.3k
6 votes
Accepted

Geoserver SLD labels dynamic displacement to resolve overlap conflicts?

I found the answer to my problem with the "maxDisplacement" vendor option. For lines, normally GeoServer labels a line at its center point only. If this label conflicts with another one it ...
Psymøn's user avatar
  • 191
6 votes
Accepted

Show custom string as label in SLD Geoserver

You just ad BC to the label line. <TextSymbolizer> <Label> <ogc:PropertyName>STATE_ABBR</ogc:PropertyName> Ian </Label> <Font>...
Ian Turton's user avatar
  • 81k
6 votes
Accepted

Problem with GeoServer modifying a style when uploading an SLD via the REST API

You are mixing an SLD 1.1.0 file (or Symbology Encoding) with the SLD 1.0.0 format so GeoServer is filtering out the 1.1.0 elements to make it compliant with 1.0.0. You need to set the content-type to ...
Ian Turton's user avatar
  • 81k
6 votes
Accepted

Geoserver SLD stylesheets - what does "se" namespace mean?

XML prefixes don't mean anything, though by convention they are often chosen to relate to the schema they are importing. If you look at (usually) the first line of your XML you will see something like:...
Ian Turton's user avatar
  • 81k
6 votes
Accepted

GetLegendGraphic and getLegendUrl function filter by extent

As specified in the docs of GeoServer : https://docs.geoserver.org/stable/en/user/services/wms/get_legend_graphic/index.html#content-dependent-legends Content dependent evaluation is enabled via ...
jossefaz's user avatar
  • 227
5 votes

Converting/using ArcGIS *.style file for/in QGIS (QML or SLD)?

There's now a tool ("slyr") which will do basic .style to qgis symbol conversion. See https://github.com/nyalldawson/slyr
ndawson's user avatar
  • 27.5k
5 votes

SLD encoding in GeoSever on Ubuntu

If files created by Geoserver are in us-ascii, it means that the Java VM is running using this encoding. In your Geoserver starting script, add the Java option (JAVA_OPTS) -Dfile.encoding=UTF-8
JGH's user avatar
  • 41.6k
5 votes

SLD styling in QGIS, elsefilter not working

As you can read here about the ElseFilter, A Rule containing an ElseFilter is evaluated if and only if no other Rule in the current Style matches. All Rules in a Style are evaluated ...
Ralu Bur's user avatar
  • 573
5 votes
Accepted

SLD : setting Multiple Values in one Literal Tag

I would go with something like: <ogc:Function name="in"> <ogc:PropertyName>name</ogc:PropertyName> <ogc:Literal>1</ogc:Literal> <ogc:Literal>11</ogc:...
Ian Turton's user avatar
  • 81k
5 votes

Qgis exported SLD file is not valid on Geoserver

I had to adapt many complicated, hundred of clases simbology sld made in qgis to be used in Geoserver some time ago. I tried some programs with no luck, so finally I changed a few things in the QGis ...
A_NeriWinter's user avatar
5 votes
Accepted

SAXParseException GeoServer SLD error

You can Convert Hex value of color to base 10. for example use 4359924 (BASE 10) instead of #4286f4 (BASE 16) in CssParameter tag: <CssParameter name="fill">4359924</CssParameter>
Seyed Arman Fatemi's user avatar
5 votes
Accepted

GeoJSON style in Leaflet from GeoServer

GeoJSON is a data output format, if you want GeoServer to style the output then you need to request a WMS image output such as png or jpg. Leaflet has styling options too but they are distinct from ...
Ian Turton's user avatar
  • 81k
5 votes

SLD - break in hatch

The solution is to use something similar to something you already used in the past (for reference Using Math in SLD file - wkt), <PolygonSymbolizer> <Fill> <GraphicFill>...
Miroslav Vujasinovic's user avatar
5 votes
Accepted

Dynamic label in SLD Style

The documentation does not include "label" as an attribute that can take expressions, it states "Most of the ColorMapEntry attributes (color, quantity and opacity) can be defined using cql expressions"...
Andrea Aime's user avatar
  • 17.3k
5 votes
Accepted

Geoserver SLD style PointSymbolizer ExternalGraphic issue

Check please if your style isn't in some workspace - workspaces has their own store, so images for styles in workspace should be placed in (geoserver_data_dir)/workspaces/(workspace_name)/styles not ...
Jendrusk's user avatar
  • 2,617
5 votes

Relative path to the plugin folder for SVG file in QGIS3 .SLD file

When you use relative path in SLD file, that path is relative to the current working directory (CWD), not relative to SLD file. If you change CWD into your plugin folder, relative path in SLD file ...
Kadir Şahbaz's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible