diff --git a/heatmap-tool/backend/main.py b/heatmap-tool/backend/main.py index dac02b78..47d0c17a 100644 --- a/heatmap-tool/backend/main.py +++ b/heatmap-tool/backend/main.py @@ -132,6 +132,9 @@ async def get_heatmap_data(request: FilterRequest): # Rename columns to match frontend expectations ('lon' and 'lat') 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 heatmap_data = merged_df[['plz', 'lat', 'lon', 'count']].to_dict(orient='records')