Hello,
I have been playing around with Geoserver for the last week and been playing around with SLDs, but now I need some help on an issue.
I loaded a countries shapefile and I am styling the polygons using the normal PolygonSymbolizer element. Indeed the SLD gets the job done, but I would
also like to color the oceans, outside the countries polygons. I just thought about loading a world oceans shp but maybe there is a workaround using SLD.
I’ve read some SLD tutorials to try to find a way, but with no luck, maybe I missed something. Is there a way to apply style outside of the polygons?
Thanks very much in advance for any useful advice!
Jose Cuadra ha scritto:
Hello,
I have been playing around with Geoserver for the last week and been playing around with SLDs, but now I need some help on an issue.
I loaded a countries shapefile and I am styling the polygons using the normal PolygonSymbolizer element. Indeed the SLD gets the job done, but I would
also like to color the oceans, outside the countries polygons. I just thought about loading a world oceans shp but maybe there is a workaround using SLD.
I've read some SLD tutorials to try to find a way, but with no luck, maybe I missed something. Is there a way to apply style outside of the polygons?
Nope, there is not, but you can ask a WMS to render a map with a specific background color. For example:
http://sigma.openplans.org:8080/geoserver/wms?bbox=-197.9998992919926,-98.68126678466797,197.9998992919926,92.30878448486328&styles=gray&Format=image/png&request=GetMap&version=1.1.1&layers=topp:countries&width=800&height=362&srs=EPSG:4326&bgcolor=0xCCCCFF
See &bgcolor=0xCCCCFF at the end of the request.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.