2

I have GeoServer with Postgres and PostGIS bundle installed. I have also sucessfully imported my osm map using osm2pgsql.

I'm following this tutorial from this site, Link and reached this step in which the author said about SLD filtering/styling.

ScreenGrab

Upon researching, I found out there are 2 github that provides the SLD already in which, they are: GithubLink1 GithubLink2, in which one of them says to

  1. Add .sld files into "styles" directory.
  2. Add "symbols" directory into "styles" directory.
  3. Create new styles from GeoServer administration website.

How do I do that, and am I on the right track?

  • 3
    Right track to do what? If you re just looking to make a map, then you can upload the styles (per the GeoServer manual). If you're looking to make your own style (or need to update the style to match something post 2009), then the SLD Cookbook part of the manual (docs.geoserver.org/stable/en/user/styling/sld/index.html) is probably more useful. – BradHards Sep 21 '17 at 2:52
  • @BradHards thanks for the input, I want to upload the styles into my geoserver, how do I go about doing it? – Gene Sep 21 '17 at 2:54
  • 1
    Not related to the "output" side, but on the "input" side you might want to consider using lua tag transforms with osm2pgsql to merge together (for example) highway=motorway, highway=motorway_link, highway=trunk, highway=trunk_link so that your database only contains the complexity that you care about. – SomeoneElse Sep 21 '17 at 9:58
  • @SomeoneElse do u have the exact command line code? – Gene Sep 25 '17 at 0:55
  • An example of "invoking osm2pgsql with a lua script" is at wiki.openstreetmap.org/wiki/User:SomeoneElse/… , and an example of "merging together different highway types" is at github.com/SomeoneElseOSM/SomeoneElse-style/blob/master/… . – SomeoneElse Sep 26 '17 at 1:42
3

Assuming you are using a current stable release (if not, upgrade first):

  • log in to the web UI
  • go to the Data Management section
  • click on styles
  • click on the "Add a new style" - adjacent to the green "+" symbol.
  • click on the "Browse..." button, and select your SLD.
  • click on the "Upload..." link.
  • verify style uploaded successfully (should appear in the style list)

For more information, refer to relevant part of the manual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.