1

I have a shapefile loaded in a GeoServer instance, and I need some guidance on how to best style the output. The file is depicting public/private land ownership in the State of Colorado. The shapefile has different feature properties (adm_name) for each agency - State Land, BLM, US Forest Service, Private, etc. Each type of ownership needs to be a different color.

A PNG image of the unstyled map is here.

enter image description here

I need it to look like this (without the grid, of course).

enter image description here

So, this is as much a theoretical question as a technical one.

Can I just apply the styling with a SLD file? Or inline in the web browser through the Leaflet code? Or should the features be split up into different layers and a single style applied to each layer? Or something else completely?

It's currently a huge resource to load on a web page. So, any suggestions to accomplish this efficiently are most welcome.

1

1 Answer 1

1

Since this is a "large" file your best bet is to style it on the server and use the WMS service to send it to your browser as a small image (i.e. a compressed png).

GeoServer uses SLD to style layers, there are many examples available in the SLD cookbook which you can use as a basis for your style. In your case I would recommend using the recode function as being the easiest and probably quickest.

2
  • OK, I think I'm following you, and I had seen the recode function in the SLD Cookbook. My question now is in response to your answer. You said, "send it to your browser as a small image (i.e. a compressed png). "That's where I'm scratching my head. I don't want a single image. I want it is a zoomable/togglable tile layer on an interactive map. Jul 2, 2016 at 13:38
  • That is how GeoServer works.
    – Ian Turton
    Jul 2, 2016 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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