fix([2fd88f42]): normalize PLZ column name before final output
This commit is contained in:
@@ -132,6 +132,9 @@ async def get_heatmap_data(request: FilterRequest):
|
|||||||
# Rename columns to match frontend expectations ('lon' and 'lat')
|
# Rename columns to match frontend expectations ('lon' and 'lat')
|
||||||
merged_df.rename(columns={'x': 'lon', 'y': 'lat'}, inplace=True)
|
merged_df.rename(columns={'x': 'lon', 'y': 'lat'}, inplace=True)
|
||||||
|
|
||||||
|
# Also rename the original PLZ column to the consistent name 'plz'
|
||||||
|
merged_df.rename(columns={plz_column_name: 'plz'}, inplace=True)
|
||||||
|
|
||||||
# Convert to the required JSON format
|
# Convert to the required JSON format
|
||||||
heatmap_data = merged_df[['plz', 'lat', 'lon', 'count']].to_dict(orient='records')
|
heatmap_data = merged_df[['plz', 'lat', 'lon', 'count']].to_dict(orient='records')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user