Commit 693402d2 authored by Andreas Walter's avatar Andreas Walter 🤙
Browse files

SDI-1236 Fixed bug by adding a check of 'queryable' attribute in '<Layer>' tag...

SDI-1236 Fixed bug by adding a check of 'queryable' attribute in '<Layer>' tag in 'ServCat/ServCat/MetadataHarvester/AbstractHarvester.py'
parent f7e82972
......@@ -237,9 +237,13 @@ class AbstractHarvester(ABC):
return DotDict(to_request=lambda: '')
# Get Layer Names from OWSLib instance
content_names = self.known_layers if self.known_layers else [
layer for layer in list(self.service.contents)
]
def get_names():
for k, v in self.service.contents.items():
if hasattr(v, 'queryable') and not v.queryable:
continue
yield k
content_names = self.known_layers if self.known_layers else list(get_names())
# Check incoming variables
service_url = service_url if service_url else self.url
......
......@@ -302,19 +302,30 @@ class DescribeRequestESRI(dict):
if __name__ == '__main__':
describe = DescribeRequest(
# service_url='https://maps.awi.de/services/projects/reklim/arctic_coastal_dynamics/wms',
# service_layers=['Hallo', 'Anita'],
# service_url='https://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv',
# service_layers=['GEBCO_Grid', 'GEBCO_LATEST'],
# service_url='https://maps.dwd.de/geoserver/ows',
service_url='https://maps.awi.de/services/common/bathymetry/wms',
service_url='https://maps.dwd.de/geoserver/dwd/ows',
service_layers=['Fachlayer', 'Wetter', 'Kurzfristvorhersagen', 'dwd:Autowarn_Analyse'],
# service_layers=['dwd:Autowarn_Analyse'],
service_layers=['bathymetry:awi_bathy_files_marehub'],
service_type='WCS',
service_version='2.0.1',
service_type='WMS',
service_version='1.1.1',
# LIMIT=50
)
# describe = DescribeRequest(
# # service_url='https://maps.awi.de/services/projects/reklim/arctic_coastal_dynamics/wms',
# # service_layers=['Hallo', 'Anita'],
# # service_url='https://www.gebco.net/data_and_products/gebco_web_services/web_map_service/mapserv',
# # service_layers=['GEBCO_Grid', 'GEBCO_LATEST'],
# # service_url='https://maps.dwd.de/geoserver/ows',
# service_url='https://maps.awi.de/services/common/bathymetry/wms',
# # service_layers=['dwd:Autowarn_Analyse'],
# service_layers=['bathymetry:awi_bathy_files_marehub'],
# service_type='WCS',
# service_version='2.0.1',
# # LIMIT=50
# )
import requests
req = describe.to_request()
response = requests.get(req)
# logger.info(describe.to_request())
# describe_esri = DescribeRequestESRI(
# # service_url='https://maps.awi.de/services/projects/reklim/arctic_coastal_dynamics/wfs'
......
......@@ -550,24 +550,32 @@ if __name__ == '__main__':
# ======================================================
# How to use for 'GeoServer'
# ======================================================
# wms = WebMapService(url='https://maps.awi.de/services/common/marehub/wms',
# wms = WebMapService(url='https://maps.awi.de/services/common/pangaea_bathymetry/wms',
# wms = WebMapService(url='https://maps.awi.de/services/platforms/satellite/wms',
# wms = WebMapService(url='https://maps.awi.de/services/common/expedition/wms',
# software='GeoServer',
# version='1.3.0')
print('=' * 80)
# # wms = WebMapService(url='https://maps.awi.de/services/common/pangaea_bathymetry/wms',
# # wms = WebMapService(url='https://maps.awi.de/services/platforms/satellite/wms',
wms_awi = WebMapService(url='https://maps.awi.de/services/common/expedition/wms',
software='GeoServer',
version='1.3.0')
# servcat_json_awi = wms.to_servcat_json()
servcat_json_awi = wms_awi.to_servcat_json()
# wms_coastmap = WebMapService(url='https://coastmap.hzg.de/geoserver/coastmap/wms',
# software='GeoServer',
# version='1.3.0')
#
# servcat_json_coastmap = wms_coastmap.to_servcat_json()
print('=' * 80)
wms_dwd = WebMapService(url='https://maps.dwd.de/geoserver/dwd/ows',
software='GeoServer',
version='1.3.0')
servcat_json_dwd = wms_dwd.to_servcat_json()
print('=' * 80)
wms_coastmap = WebMapService(url='https://coastmap.hzg.de/geoserver/coastmap/wms',
software='GeoServer',
version='1.3.0')
servcat_json_coastmap = wms_coastmap.to_servcat_json()
# ======================================================
# How to use for 'rasdaman'
# ======================================================
print('=' * 80)
wms_rasdman = WebMapService(url='https://maps.awi.de/services/raster/ows',
software='rasdaman',
version='1.3.0')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment