Hot answers tagged

17

You can try these: Altas Styler Udig Kosmo or OpenJump And Qgis either natively or with the help of the SLD plugin


13

Looks like you found something to work with in the end and I hope by now you have a solution. I recently had a similar issue to yourself so I set about creating my own QML styles for OSM Shapefiles. You can find them on my github here: https://github.com/charleyglynn/OSM-Shapefile-QGIS-stylesheets


12

The SLD spec includes a string concatenation function. Here's an example of how to use it with labels: <Label> <ogc:Function name="Concatenate"> <ogc:Literal>No. </ogc:Literal> <ogc:PropertyName>postalNumber</ogc:PropertyName> </ogc:Function> <...


12

You can do this by using Layer Groups. In the Admin interface, Under the 'Data' section on the left click on 'Layer Groups'. Then, in the usual GeoServer way, create a new layer group (by default you may already have a couple of examples) and then follow the intuitive interface to add layers to the group. Once you have your Layer Group created, go back ...


12

You can use the math functions ogc:Mul ogc:Div ogc:Add & ogc:Sub to do simple maths on properties. So your example would become: <sld:CssParameter name="font-size"> <ogc:Mul> <ogc:PropertyName>text_size</ogc:PropertyName> <ogc:Literal>2.5</ogc:Literal> </ogc:Mul> </sld:CssParameter> ...


11

I did a lot of trial-error tests with SLD lately, and my sum up is use Atlas Styler. They have problems with certificates (version 2.0), newest Java runtime refuses to launch the app, you have to adjust the security settings of Java, but its the only tool doing ALMOST all I expect it to do. Only filters (setting filter like Field='text' will become [Field = ...


10

It isn't necessary to learn OpenLayers or Leaflet when you just want to use GeoServer. However, I have a single advice for you: because you already have a working GeoServer, do yourself a favor and go to https://github.com/boundlessgeo/suite/tree/master/geoexplorer. Follow those instructions, build a geoexplorer.war and deploy it to your servlet container. ...


10

The GeoServer documentations states how to extract start and end points with geometry transformations (just use the end- point rule). The code example provided uses square as marks, but you could always replace this with e.g. the shape symbol shape://oarrow. EDIT: I forgot to mention how to rotate the triangle correctly (couldn't find it in the ...


9

You have to define 2 different sld:Rules using MaxScaleDenominator. In the first one, add the style to render the label (the TextSymbolizer in my example), and specify the desired zoom level with the right MaxScaleDenominator. In the second rule, define a different style without the label. Basically, a rule contains a style, an only the style whith the ...


9

QGIS has a OpenGeo Explorer (for GeoServer) plug-in that you can create new SLD styles based on your feature symbology, then push to your server. You may also use uDig web GIS app. to pull in PostGIS layers, then copy out the .xml sld text which you may paste within GeoServer SLD styling editor.


9

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 custom usage of the mark index, that no released version of GeoServer can handle (but it's already in, GeoServer 2.9.2 will have that improvement). Future ...


8

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 query will execute each time the layer is requested, the SLD style can be applied as usual.


7

I don't know how GDAL handles JPEG compression on a four band raster, it does not make much sense to me, JPEG is meant to be used against RGB (three band) or gray (one band) images. When you gdal_translate it you can also shave off the fourth band with, I believe, -b 1 -b 2 -b 3


7

The label placement algorithm will almost certainly decide not to show both labels as they will overlap. There are various vendor options that you can use to make it less picky about overlaps and clutter but it will end up looking ugly. The better solution is to combine the two properties into one label (this will give you much more control over the way ...


7

The other way is to list all the layers you want in the LAYERS parameter of your WMS request. If you have GeoServer installed locally you can try http://localhost:8080/geoserver/wms?LAYERS=topp:states,tiger:poi&STYLES=&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-74.028479182883,40.704071325538,-...


7

Perhaps you are referring to this one? Since you know exactly what you want the map to look like, I would suggest starting with either the linked SLD from this post or the one from @tmcw. Then you can edit it until the map visualization fits your needs. You could even post the results to github and share them with the community.


7

Label placement is more an art than a science, GeoServer tries very hard to put as many labels as possible on to your map while making it look good. As part of this it will not draw a label that goes over the edge of the map. This means that with small tiles and relatively large labels it may not be possible to place many (or any) labels. The easiest ...


7

If you add LEGEND_OPTIONS parameter to your request and the value forceLabels:on then you can force GeoServer to draw the text for a single rule. Here is an example of a request: http://demo.opengeo.org/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=topp:states&STYLE=point&...


7

I guess the attribute "NAME" is written in capital letters in your style and your column name of your layer/service is "name" without capital letters.could that be?


6

Zach, correct, there is no way to hide a rule from the GetLegendGraphics call. The SLD standard does not provide a way either, so someone would have to come up with an extension to the standard and then code to implement it at the Geotools and GeoServer level.


6

I assume from your question that you are generating an SLD file and then copying it to the style directory in GeoServer. As you have seen, that approach won't work because I believe the style also needs to be registered as a catalogue item in GeoServer - if you look in the style folder you will see companion XML files with the SLD files. The best way to ...


6

There is an open feature request for this functionality: http://hub.qgis.org/issues/8925 If you have the skills or means to help implement it, please contact the developer team.


6

Try an SLD like this, using ogc:PropertyName to include the accuracy value: <?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....


6

Finally figured out what was going wrong when I fired up Inkscape to take a look at the details of the SVG files. They weren't vector graphics; they were raster images embedded in the SVG format. Fortunately, they were pretty simple, and I solved the problem by making my own - real SVGs this time. So moral of the story: GeoServer doesn't like to render ...


6

The SLDs were originally created for our own use in GeoServer which supports several vendor specific options that we use for our OS OnDemand Web Services, so there are some edits that you need to manually make to the SLDs for them to work in QGIS. The first is that in the SLDs we top and tail each rule with the <FeatureTypeStyle> </...


6

Put the MinScaleDenominator and MaxScaleDenominator element after the ogc:Filter element: <?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="...


6

Something like this should work, using the math operators - please note it is untested: <Rotation> <ogc:Div> <ogc:Sub> <ogc:Literal>450</ogc:Literal> <ogc:PropertyName>ROTATION</ogc:PropertyName> </ogc:Sub> <ogc:Literal>360</ogc:Literal> </...


6

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 middle of a mark name like this: wkt://LINESTRING(0 0, ${Orientation * 200} 33) I could not try it out, but it should work.


5

GeoServer has some examples of how to style using SLD called SLD cookbook. In your case you want to combine the Attribute-based point example and the Point as graphic example.


5

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 layers symbology into an .sld document which can be used in open-source software. It is implemented in Visual Basic .NET and requires .NET 2.0. The steps: ...


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