Skip to content
Permalink
Browse files

[bugfix] [MetaSearch] make gml:Envelope CRS explicit for spatial quer…

…ies (fixes #17739)
  • Loading branch information
tomkralidis committed Dec 23, 2017
1 parent ea983fa commit 96cc10c0f8d24bc8f507ae72eeb5c317ffa00058
Showing with 8 additions and 2 deletions.
  1. +4 −1 python/ext-libs/owslib/fes.py
  2. +4 −1 python/plugins/MetaSearch/dialogs/maindialog.py
@@ -340,12 +340,15 @@ def toXML(self):

class BBox(OgcExpression):
"""Construct a BBox, two pairs of coordinates (west-south and east-north)"""
def __init__(self, bbox):
def __init__(self, bbox, crs=None):
self.bbox = bbox
self.crs = crs
def toXML(self):
tmp = etree.Element(util.nspath_eval('ogc:BBOX', namespaces))
etree.SubElement(tmp, util.nspath_eval('ogc:PropertyName', namespaces)).text = 'ows:BoundingBox'
tmp2 = etree.SubElement(tmp, util.nspath_eval('gml:Envelope', namespaces))
if self.crs is not None:
tmp2.set('srsName', self.crs)
etree.SubElement(tmp2, util.nspath_eval('gml:lowerCorner', namespaces)).text = '%s %s' % (self.bbox[0], self.bbox[1])
etree.SubElement(tmp2, util.nspath_eval('gml:upperCorner', namespaces)).text = '%s %s' % (self.bbox[2], self.bbox[3])
return tmp
@@ -438,6 +438,8 @@ def search(self):
self.timeout = self.spnTimeout.value()

# bbox
# CRS is WGS84 with axis order longitude, latitude
# defined by 'urn:ogc:def:crs:OGC:1.3:CRS84'
minx = self.leWest.text()
miny = self.leSouth.text()
maxx = self.leEast.text()
@@ -448,7 +450,8 @@ def search(self):
# even for a global bbox, if a spatial filter is applied, then
# the CSW server will skip records without a bbox
if bbox != ['-180', '-90', '180', '90']:
self.constraints.append(BBox(bbox))
self.constraints.append(BBox(bbox,
crs='urn:ogc:def:crs:OGC:1.3:CRS84'))

# keywords
if self.leKeywords.text():

0 comments on commit 96cc10c

Please sign in to comment.
You can’t perform that action at this time.