DOV-Vlaanderen/pydov

Example in notebook `remote_wfs_gml_query.ipynb` only functional with `lxml` installed

stijnvanhoey opened this issue · 1 comments

In the tutorial notebook remote_wfs_gml_query.ipynb, the following code elements only works when lxml package is installed, but this is not done by default:

tree = etree.fromstring(to_bytes(bekkens.getfeature('VHAZones:Bekken', propertyname='BEKNAAM').read()))
set((i.text for i in tree.findall('.//{%s}BEKNAAM' % tree.nsmap['VHAZones'])))

# ...
tree = etree.fromstring(to_bytes(hhz.getfeature('gw_varia:hhz', propertyname='hhz_naam').read()))
set((i.text for i in tree.findall('.//{%s}hhz_naam' % tree.nsmap['gw_varia'])))

The reason is that the nsmap is only created when lxml is available.

@Roel should we opt for a small workaround or make it a 'requirement'?

Roel commented

I will check if I can work around this!