Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add local OGC:WMTS endpoint for a given layer (#328) #329

Merged
merged 1 commit into from
Oct 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions hypermap/aggregator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,8 @@ def update_layers_wms(service):
# get or create layer
layer, created = Layer.objects.get_or_create(name=ows_layer.name, service=service, catalog=service.catalog)
if layer.active:
links = [['OGC:WMS', service.url]]
links = [['OGC:WMS', service.url],
['OGC:WMTS', settings.SITE_URL.rstrip('/') + '/' + layer.get_url_endpoint()]]
# update fields
layer.type = 'OGC:WMS'
layer.title = ows_layer.title
Expand Down Expand Up @@ -1172,7 +1173,8 @@ def update_layers_wmts(service):
LOGGER.debug('Updating layer %s' % ows_layer.name)
layer, created = Layer.objects.get_or_create(name=ows_layer.name, service=service, catalog=service.catalog)
if layer.active:
links = [['OGC:WMTS', service.url]]
links = [['OGC:WMTS', service.url],
['OGC:WMTS', settings.SITE_URL.rstrip('/') + '/' + layer.get_url_endpoint()]]
layer.type = 'OGC:WMTS'
layer.title = ows_layer.title
layer.abstract = ows_layer.abstract
Expand Down Expand Up @@ -1293,7 +1295,8 @@ def update_layers_wm(service, num_layers=None):
if created:
LOGGER.debug('Added a new layer in registry: %s, %s' % (name, uuid))
if layer.active:
links = [['Hypermap:WorldMap', endpoint]]
links = [['Hypermap:WorldMap', endpoint],
['OGC:WMTS', settings.SITE_URL.rstrip('/') + '/' + layer.get_url_endpoint()]]
# update fields
layer.type = 'Hypermap:WorldMap'
layer.title = title
Expand Down Expand Up @@ -1424,6 +1427,7 @@ def update_layers_warper(service):
layer, created = Layer.objects.get_or_create(name=name, service=service, catalog=service.catalog)
if layer.active:
# update fields
links = [['OGC:WMTS', settings.SITE_URL.rstrip('/') + '/' + layer.get_url_endpoint()]]
layer.type = 'Hypermap:WARPER'
layer.title = title
layer.abstract = abstract
Expand Down Expand Up @@ -1528,7 +1532,8 @@ def update_layers_esri_mapserver(service, greedy_opt=False):
)
if layer.active:
layer.type = 'ESRI:ArcGIS:MapServer'
links = [[layer.type, service.url]]
links = [[layer.type, service.url],
['OGC:WMTS', settings.SITE_URL.rstrip('/') + '/' + layer.get_url_endpoint()]]
layer.title = esri_layer.name
layer.abstract = esri_service.serviceDescription
layer.url = service.url
Expand Down Expand Up @@ -1606,7 +1611,8 @@ def update_layers_esri_imageserver(service):
layer, created = Layer.objects.get_or_create(name=obj['name'], service=service, catalog=service.catalog)
if layer.active:
layer.type = 'ESRI:ArcGIS:ImageServer'
links = [[layer.type, service.url]]
links = [[layer.type, service.url],
['OGC:WMTS', settings.SITE_URL.rstrip('/') + '/' + layer.get_url_endpoint()]]
layer.title = obj['name']
layer.abstract = esri_service.serviceDescription
layer.url = service.url
Expand Down