Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP!] BNA station ID collision fix #62

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions charging_stations_pipelines/pipelines/de/bna_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ def map_station_bna(row):
new_station = Station()
datasource = "BNA"
new_station.country_code = "DE"

# FIXME Currently the source_id value for BNA's charging stations is filled with the has value over lat/long.
# This leads to the situation that some charging stations have the same hash value,
# because they have the same lat/long values set (most likely by error) and this in turn leads
# to the fact that some stations cannot be imported because of a unique key constraint
# error (source_id has to be unique). I think we should generate the hash over all attributes of
# the BNA's charging station to avoid the described situation
# see https://github.com/comsysto/eCharm/issues/30
new_station.source_id = lat_long_hash(lat, long, datasource)

new_station.operator = row["Betreiber"]
new_station.data_source = datasource
new_station.point = from_shape(Point(float(long), float(lat)))
Expand Down