Hot answers tagged

15

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> ...


14

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 ...


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

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 = ...


12

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 ...


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

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&...


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

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,-...


8

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> </...


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

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.


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

XML is ordered (at least in the SLD schema) so you must use the elements in the right order, what you should have written is: <ogc:Filter>**line.24** <ogc:PropertyIsEqualTo> <ogc:PropertyName>mpec_magis</ogc:PropertyName> <ogc:Literal>1</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> &...


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

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

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

This may not be what you want to hear but I think the best chance you have of having ArcGIS Desktop read SLD files will be to vote for this ArcGIS Idea. Its proposer says: It would be a great interoperability improvement to be able to import SLD styles into *.style files and vice versa.


6

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/


6

When stacked symbols are only separated by the <Rule> tags, the order in which they appear on the map is random. You need to separate them using <FeatureTypeStyle> tags. Symbols at the top of the SLD will be drawn first, so for your road example you should put the road casing first followed by the road fill. E.g. <FeatureTypeStyle> <...


6

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 subdirectory. i.e if you upload the image into the directory: $GEOSERVER_DATA_DIR/workspaces/{yourWorkspace}/styles/images/earthquake.png Your sld must look like ...


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

There are lots of different methods, depending what you want to do with the data (routing, general GIS, rendering with Mapnik...). You can find quite a lot on the OSM wiki. osm2postgresql (http://wiki.openstreetmap.org/wiki/Osm2postgresql) is my personal fav but you can have a look at the other ones. They will allow you to import an *.osm file into the ...


5

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


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: ...


5

I've had this issue before, it looks like you have done exactly what I did. The GeoServer WPS example heat map doesn't support tiles, so what Gery said is correct you need to set tiled=false. I had the same problem in OpenLayers, so it isn't a Leaflet issue.


5

There is an example in the GeoServe documentation which seems to do what you need - see http://docs.geoserver.org/stable/en/user/styling/sld-extensions/geometry-transformations.html#start-and-end-point Basically you need to use the startPoint and endPoint functions to extract the start and end point of your line. <PointSymbolizer> <Geometry> ...


5

OpenLayers And GeoServer are two distinct softwares, used for different purposes. Geoserver is a Server Software, which serves out Geospatial Data, via OGC services. OpenLayers is JavaScript Library which can be used to make web applications that (Amongst other things) can consume OGC services. It just so happens, that when Geoserver wants to use ...


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