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

Recognize GeoPortal-style service/link type code types (WMS, WFS, WCS) #43

Merged
merged 2 commits into from
Mar 23, 2014
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
40 changes: 21 additions & 19 deletions plugin/MetaSearch/dialogs/maindialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,33 +570,35 @@ def find_services(self, record, item):
if link_type is not None:
link_type = link_type.upper()

# if the link type exists, and it is one of the acceptable
# interactive link types, then set
if all([link_type is not None,
link_type in ['OGC:WMS', 'OGC:WMTS',
# acceptable interactive link types
wmswmst_link_types = ['OGC:WMS', 'OGC:WMTS',
'OGC:WMS-1.1.1-HTTP-GET-MAP',
'OGC:WMS-1.1.1-HTTP-GET-CAPABILITIES',
'OGC:WMS-1.3.0-HTTP-GET-MAP',
'OGC:WMS-1.3.0-HTTP-GET-CAPABILITIES',
'OGC:WFS',
'OGC:WFS-1.0.0-HTTP-GET-CAPABILITIES',
'OGC:WFS-1.1.0-HTTP-GET-CAPABILITIES',
'OGC:WCS',
'OGC:WCS-1.1.0-HTTP-GET-CAPABILITIES']]):
if link_type in ['OGC:WMS', 'OGC:WMTS',
'OGC:WMS-1.1.1-HTTP-GET-MAP',
'OGC:WMS-1.1.1-HTTP-GET-CAPABILITIES',
'OGC:WMS-1.3.0-HTTP-GET-MAP',
'OGC:WMS-1.3.0-HTTP-GET-CAPABILITIES']:
'urn:x-esri:specification:ServiceType:wms:url',
'urn:x-esri:specification:ServiceType:Gmd:URL.wms']
wfs_link_types = ['OGC:WFS',
'OGC:WFS-1.0.0-HTTP-GET-CAPABILITIES',
'OGC:WFS-1.1.0-HTTP-GET-CAPABILITIES',
'urn:x-esri:specification:ServiceType:wfs:url',
'urn:x-esri:specification:ServiceType:Gmd:URL.wfs']
wcs_link_types = ['OGC:WCS',
'OGC:WCS-1.1.0-HTTP-GET-CAPABILITIES',
'urn:x-esri:specification:ServiceType:wcs:url',
'urn:x-esri:specification:ServiceType:Gmd:URL.wcs']

# if the link type exists, and it is one of the acceptable
# interactive link types, then set
if all([link_type is not None,
link_type in wmswmst_link_types + wfs_link_types + wcs_link_types]):
if link_type in wmswmst_link_types:
services['wms'] = link['url']
self.btnAddToWms.setEnabled(True)
if link_type in ['OGC:WFS',
'OGC:WFS-1.0.0-HTTP-GET-CAPABILITIES',
'OGC:WFS-1.1.0-HTTP-GET-CAPABILITIES']:
if link_type in wfs_link_types:
services['wfs'] = link['url']
self.btnAddToWfs.setEnabled(True)
if link_type in ['OGC:WCS',
'OGC:WCS-1.1.0-HTTP-GET-CAPABILITIES']:
if link_type in wcs_link_types:
services['wcs'] = link['url']
self.btnAddToWcs.setEnabled(True)

Expand Down