Skip to content

Commit

Permalink
Merge pull request #397 from DOV-Vlaanderen/ligging_mv-mtaw_fixes
Browse files Browse the repository at this point in the history
Update mv_mtaw fields based on updated DOV XML schema (fixes)
  • Loading branch information
Roel committed Oct 5, 2023
2 parents 060d6ce + ec48ec6 commit 9583ed9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pydov/types/ligging.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ def calculate(self, cls, tree):
'.//ligging/{http://www.opengis.net/gml/3.2}Point/'
'{http://www.opengis.net/gml/3.2}pos'
)
hoogte = float(point.split(' ')[-1])
return hoogte
coords = point.split(' ')
if len(coords) == 3:
hoogte = float(coords[-1])
return hoogte
else:
return np.nan
2 changes: 1 addition & 1 deletion tests/test_types_ligging.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def test_new_xml_noheight(self):
<naam>Universiteit Gent</naam>
</uitvoerder>
<betrouwbaarheid>onbekend</betrouwbaarheid>
<referentiepunt_type>Aanvangspeil</referentiepunt_type>
<referentiepunt_type>Maaiveld</referentiepunt_type>
</metadata_hoogtebepaling>
</ligging>
<diepte_van>0.00</diepte_van>
Expand Down

0 comments on commit 9583ed9

Please sign in to comment.