planetfederal / registry

pycsw + elasticsearch + opensearch + swagger - Based on HHyperMap
MIT License
11 stars 9 forks source link

Add wms legend support #116

Closed theduckylittle closed 7 years ago

theduckylittle commented 7 years ago

The intention of this PR is to provide Legend support for those WMS sources which provide the capabilitiy. As a general rule, Warper-sourced layers appear to fail when making GetLegendRequests. In order to avoid that problem, the code below will only publish a legend_url for layers which are from OGC:WMS format layers.

Notes on the changes:

  1. Line 48 adds an import for urlencode, which is used to ensure that stored URLs are properly formatted.
  2. Lines 347-358 add a "legend_url" entry for layers which are from OGC:WMS formatted sources.
  3. wms_opts gets "legendgraphic" for WMS-style layer entries to tell MapProxy to allow proxying of GetLegendGraphic requests.
coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 39f2f01f21b66b827c1a495f2a457e6383f34005 on theduckylittle:add-wms-legend-support into on boundlessgeo:master.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 39f2f01f21b66b827c1a495f2a457e6383f34005 on theduckylittle:add-wms-legend-support into on boundlessgeo:master.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 39f2f01f21b66b827c1a495f2a457e6383f34005 on theduckylittle:add-wms-legend-support into on boundlessgeo:master.

ingenieroariel commented 7 years ago

Thanks @theduckylittle

I'll merge right away, but it would be nice if you can figure out a way to invoke the new code with the tests, right now the conditional is out of coverage.

theduckylittle commented 7 years ago

Test added here: https://github.com/boundlessgeo/registry/pull/117