I am working with OWSLib in Python and I am trying to read a WMS of the Corine land cover in Ireland for the year 2000. Below you can see the request of the WMS.
from owslib.wms import WebMapService
ireland_wms = WebMapService('https://gis-test.epa.ie/geoserver/ows?SERVICE=WMS&')
Then I print some general info about the layer of interest.
def layer_report(service, layer_name):
print(f"WMS general info:\n")
print(f"WMS version: {service.identification.version}")
print(f"WMS title: {service.identification.title}")
print(f"WMS abstract: {service.identification.abstract}")
print(f"Provider name: {service.provider.name}")
print(f"Provider address: {service.provider.contact.address}")
print(f"\nLayer info:\n")
print('- Title: ', service.contents[layer_name].title)
print('- BoundingBox: ', service.contents[layer_name].boundingBox)
print('- BoundingBoxWGS84: ', service.contents[layer_name].boundingBoxWGS84)
print('- CrsOptions: ', service[layer_name].crsOptions)
print('- Format Options: ', service.getOperationByName('GetMap').formatOptions)
print('- Layer styles: ', service[layer_name].styles)
print('- Operations ', [op.name for op in service.operations])
layer_report(ireland_wms, 'EPA:LAND_CLC00Rev')
and I get the following output
Now I have the legend that corresponds to type of Land cover, If I click on link shown in the above picture I get the following legend.
Now I would like to know if there is any way to gain more information about the legend. In particular, I would like to get, if it is possible, the color codes of the legend in order to use them for plotting. Is there any way to do this using OWSLib or any other library which is compatible with Python?