Skip to content

Commit

Permalink
Add exception for one more EPSG
Browse files Browse the repository at this point in the history
  • Loading branch information
Belén Torrente committed Sep 30, 2024
1 parent 7b6c572 commit af28c5e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions python/lib/adaguc/AdagucTestTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,19 @@ def removeBBOX(root):
removeBBOX(obj1)
removeBBOX(obj2)

# Remove contents of <gml:Envelope srsName="EPSG:28992"> because they are inconsistent
def removeGmlEnvelope28992(root):
envelopes = root.xpath(".//gml:Envelope[@srsName='EPSG:28992']", namespaces={"gml": "http://www.opengis.net/gml"})
# Remove contents of problem envelopes EPSG:28992 and EPSG:7399 because they are inconsistent
def removeGmlEnvelope(root, epsg_code):
xpath_query = f".//gml:Envelope[@srsName='EPSG:{epsg_code}']"
envelopes = root.xpath(
xpath_query, namespaces={"gml": "http://www.opengis.net/gml"})
for envelope in envelopes:
for child in envelope.getchildren():
envelope.remove(child)

removeGmlEnvelope28992(obj1)
removeGmlEnvelope28992(obj2)
removeGmlEnvelope(obj1, "28992")
removeGmlEnvelope(obj2, "28992")
removeGmlEnvelope(obj1, "7399")
removeGmlEnvelope(obj2, "7399")

result = etree.tostring(obj1)
expect = etree.tostring(obj2)
Expand Down

0 comments on commit af28c5e

Please sign in to comment.