2 Answers 2

2

There is a WFS service available, too, which allows you to access the underlying data that you see in the WMS response. You can browse all of these here in the Geoserver interface: https://maps.huntscore.com/geoserver/web/?wicket:bookmarkablePage=:org.geoserver.web.demo.MapPreviewPage

Then you can make a request just for the feature you want, which is well covered by this question's answers: Passing Filter Parameters to GeoServer WFS via URL?

The query you want is something like this (this one returns GeoJSON): https://maps.huntscore.com/geoserver/ows?service=wfs&version=1.0.0&request=getfeature&typename=colorado:BigGameGMUBoundaries12092014&CQL_FILTER=GMUID=84&outputFormat=application/json

You will need to apply your own styling once you have the features you are after. Perhaps the best thing to do is to continue requesting the WMS image as you are already doing, but also overlay the result of the WFS request on top in the client, and style that as you see fit.

EDIT: to stay within WMS, what you want to do is specify multiple layers (well, the same layer twice), and apply two filters, and two styles:

http://maps.huntscore.com:8080/geoserver/colorado/wms?service=WMS&version=1.1.0&request=GetMap&layers=colorado:BigGameGMUBoundaries12092014,BigGameGMUBoundaries12092014&cql_filter=GMUID%3E0;GMUID=84&styles=MiniMap_Outlines,MiniMap_Polygon&bbox=139992.54690000042,4094064.75,763240.4375,4546735.0&width=768&height=557&srs=EPSG:26913&format=image%2Fpng

enter image description here

7
  • Thanks for your explanation. That helped me highlight the feature, but I still can't figure out how to get both into a single image. Commented Dec 15, 2015 at 16:54
  • I updated my original post using WMS to show the highlighted feature as well as the base map. I guess I don't understand part of your response where you said "also overlay the result of the WFS request on top in the client." Commented Dec 15, 2015 at 17:06
  • Do you just want an image, or are you showing this in a web map? Commented Dec 15, 2015 at 18:58
  • My assumption is that you are creating a web map, although this would work in a desktop GIS environment just as well. The way I would approach it is to request the non-filtered WMS as a base layer, and then request either the WFS or WMS again with the filter applied, and display that on top of the base layer. Using WFS in the second step is better IMO because you can choose the style yourself with complete control. Commented Dec 15, 2015 at 20:03
  • I just want an image. I have done it before within a web map, but that will not work here. Commented Dec 15, 2015 at 21:40
0

If the WMS service supports SLD, you could make a GetMap request that provided an SLD style using SLD_BODY or SLD parameters, that coloured the map image according to some unique aspect of the polygon in question.

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.