Skip to content

Commit

Permalink
[bugfix] [MetaSearch] make gml:Envelope CRS explicit for spatial quer…
Browse files Browse the repository at this point in the history
…ies (fixes #17739)
  • Loading branch information
tomkralidis committed Dec 23, 2017
1 parent ea983fa commit 96cc10c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/ext-libs/owslib/fes.py
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/MetaSearch/dialogs/maindialog.py
Expand Up @@ -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()
Expand All @@ -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():
Expand Down

0 comments on commit 96cc10c

Please sign in to comment.