Skip to content

Commit

Permalink
[BE] Update to new WFS structure
Browse files Browse the repository at this point in the history
  • Loading branch information
k-nut committed Jun 24, 2024
1 parent 0776e38 commit 5f149be
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions jedeschule/spiders/berlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ def parse(self, response):
"gml": "http://www.opengis.net/gml",
"fis": "http://www.berlin.de/broker",
}
for school in tree.findall("gml:featureMember", namespaces):
for school in tree.find('gml:featureMembers', namespaces).findall("{schulen}schulen", namespaces):
data_elem = {}
for entry in school[0]:
if entry.tag == "{http://www.berlin.de/broker}geom":
for entry in school:
if entry.tag == '{http://www.opengis.net/gml}boundedBy':
continue
if entry.tag == "{schulen}geom":
# This nested entry contains the coordinates that we would like to expand
lat, lon = entry.findtext(
"gml:Point/gml:pos", namespaces=namespaces
Expand All @@ -33,7 +35,7 @@ def parse(self, response):

@staticmethod
def normalize(item: Item) -> School:
return School(name=item.get('name'),
return School(name=item.get('schulname'),
id='BE-{}'.format(item.get('bsn')),
address=" ".join([item.get('strasse'), item.get('hausnr')]),
zip=item.get('plz'),
Expand Down

0 comments on commit 5f149be

Please sign in to comment.