Skip to content

Commit

Permalink
Merge pull request #27 from via-cs/feature/migration-map
Browse files Browse the repository at this point in the history
Added Heatmap
  • Loading branch information
jbvogt authored May 7, 2024
2 parents f2c0292 + d8d2b66 commit 957262e
Show file tree
Hide file tree
Showing 6 changed files with 12,233 additions and 2,880 deletions.
13 changes: 13 additions & 0 deletions backend/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,18 @@ def simplify_line(coordinates, tolerance=0.1):
simplified_line = line.simplify(tolerance, preserve_topology=False)
return list(zip(*simplified_line.xy))

@api.route('/get_heatmap_data')
@cross_origin()
def get_kde_data():
selected_bird = request.args.get('bird')
filename = f'./data/{selected_bird}.csv'

try:
df = pd.read_csv(filename, low_memory=False)
heatmap_data = df[['LATITUDE', 'LONGITUDE']].values.tolist()
return jsonify(heatmap_data)
except Exception as e:
return jsonify(error=str(e)), 400

if __name__ == '__main__':
api.run(debug=True)
Loading

0 comments on commit 957262e

Please sign in to comment.