Open blewis opened 8 years ago
@bglewis do OGC service metadata in GetCapabilities provide such an information? /cc @tomkralidis
I think scale dependency info is optional in WMS. If it is present we should use it. For service registries there is a need to handle this address the situation when neither valid default map extent nor scale dependency information is not provided. This is a huge unsolved problem for service sharing. Automated approaches are difficult but an admin tool / crowd-source tool that lets users set both scale dependencies and default map extent for remote services would be very useful.
WMS 1.3.0 provides optional Layer MinScaleDenominator
and MinScaleDenominator
elements; the WMS 1.1.1 equivalent being ScaleHint@min/@max
. This should be supported in OWSLib proper which you can use to satisfy this use case.
It would be interesting to figure out how many services/layers expose this before adding this to django models
@capooti: something like the below may help in the analysis:
from hypermap.aggregator.utils import get_wms_version_negotiate
num_services = 0
num_services_with_scale = 0
num_layers = 0
num_layers_with_scale = 0
wms_urls = ['http://geo.woudc.org/ows']
for wms_url in wms_urls:
scalehint_found = False
wms = get_wms_version_negotiate(wms_url)
num_services += 1
num_layers += len(wms.contents.keys())
for layer in wms.contents:
if wms.contents[layer].scaleHint is not None:
scalehint_found = True
num_layers_with_scale += 1
if scalehint_found:
num_services_with_scale += 1
print('Number of services: {}'.format(num_services))
print('Number of layers: {}'.format(num_layers))
print('Number of services implementing scale hint: {}'.format(
num_services_with_scale))
print('Number of layers implementing scale hint: {}'.format(
num_layers_with_scale))
Thanks, I was exactly thinking to something like this. Let me try this on our WMS list to figure out what is the % of services which are exposing scales /cc @bglewis
Use in determination of validity (map might not display at global scale but will display at zoomed-in scale) and to message user regarding view scale.