Skip to content

Commit

Permalink
[NW] handle "null" values for EPSG column
Browse files Browse the repository at this point in the history
  • Loading branch information
k-nut committed Apr 16, 2024
1 parent 7db7a83 commit 9ebb1ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jedeschule/spiders/nordrhein_westfalen.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ def normalize(item: Item) -> School:
).strip()
helper = NordRheinWestfalenHelper()
right, high = item.get("UTMRechtswert"), item.get("UTMHochwert")
transformer = Transformer.from_crs(item.get("EPSG"), "EPSG:4326")
# There are some entries which have the string "null" in the EPSG
# column. All others have "EPSG:25832". It seems save enough to assume
# that this is a mistake in the data and should also be "EPSG:25832".
source_crs = item.get("EPSG")
if source_crs == 'null':
source_crs = "EPSG:25832"
transformer = Transformer.from_crs(source_crs, "EPSG:4326")
lon, lat = transformer.transform(right, high)

return School(
Expand Down

0 comments on commit 9ebb1ab

Please sign in to comment.