Skip to content

Commit

Permalink
Merge pull request #577 from EOxServer/getlegendgraphic
Browse files Browse the repository at this point in the history
Getlegendgraphic
  • Loading branch information
baloola authored Dec 4, 2024
2 parents dcab537 + 6100a61 commit e35a94e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion eoxserver/services/ows/wms/basehandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def handle(self, request):
encoder.encode_capabilities(
conf, request.build_absolute_uri(reverse('ows')),
crss.getSupportedCRS_WMS(format_function=crss.asShortCode),
map_renderer.get_supported_formats(), [],
map_renderer.get_supported_formats(), [], get_legend_renderer().get_supported_formats(),
layer_descriptions
),
pretty_print=settings.DEBUG
Expand Down
15 changes: 14 additions & 1 deletion eoxserver/services/ows/wms/v10/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


class WMS10Encoder(XMLEncoder):
def encode_capabilities(self, config, ows_url, srss, formats, info_formats,
def encode_capabilities(self, config, ows_url, srss, formats, info_formats, legend_formats,
layer_descriptions):

mime_to_name = {
Expand Down Expand Up @@ -88,6 +88,19 @@ def encode_capabilities(self, config, ows_url, srss, formats, info_formats,
)
)
),
E("LegendGraphic",
E("Format", *[
E(mime_to_name[frmt.mimeType])
for frmt in legend_formats
if frmt.mimeType in mime_to_name
]
),
E("DCPType",
E("HTTP",
E("Get", onlineResource=ows_url)
)
)
),
),
E("Exception",
E("Format",
Expand Down
8 changes: 7 additions & 1 deletion eoxserver/services/ows/wms/v11/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@


class WMS11Encoder(XMLEncoder):
def encode_capabilities(self, config, ows_url, srss, formats, info_formats,
def encode_capabilities(self, config, ows_url, srss, formats, info_formats, legend_formats,
layer_descriptions):
return E("WMT_MS_Capabilities",
E("Service",
Expand Down Expand Up @@ -91,6 +91,12 @@ def encode_capabilities(self, config, ows_url, srss, formats, info_formats,
),
self.encode_dcptype(ows_url)
),
E("GetLegendGraphic",*[
E("Format", frmt.mimeType)
for frmt in legend_formats
] + [
self.encode_dcptype(ows_url)
]),
# TODO: describe layer?
),
E("Exception",
Expand Down
14 changes: 7 additions & 7 deletions eoxserver/services/ows/wms/v13/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


class WMS13Encoder(XMLEncoder):
def encode_capabilities(self, config, ows_url, srss, formats, info_formats,
def encode_capabilities(self, config, ows_url, srss, formats, info_formats, legend_formats,
layer_descriptions):
return WMS("WMS_Capabilities",
WMS("Service",
Expand Down Expand Up @@ -98,12 +98,12 @@ def encode_capabilities(self, config, ows_url, srss, formats, info_formats,
),
self.encode_dcptype(ows_url)
),
WMS("GetLegendGraphic",
WMS("Format",
# TODO
),
self.encode_dcptype(ows_url)
),
WMS("GetLegendGraphic",*[
WMS("Format", frmt.mimeType)
for frmt in legend_formats
] + [
self.encode_dcptype(ows_url)
]),
# TODO: describe layer?
),
WMS("Exception",
Expand Down

0 comments on commit e35a94e

Please sign in to comment.