diff --git a/jitenshea/controller.py b/jitenshea/controller.py index 9c2d5e7..fd2cdfe 100644 --- a/jitenshea/controller.py +++ b/jitenshea/controller.py @@ -92,6 +92,7 @@ def time_window(day, window, backward): order_reference_date = start return TimeWindow(start, stop, order_reference_date) + def station_geojson(stations): """Process station data into GeoJSON """ @@ -137,7 +138,7 @@ def clustered_station_geojson(stations): "properties": { "id": data['id'], "cluster_id": data['cluster_id'], - "name": data['nom'], + "name": data['name'], "start": data['start'], "stop": data['stop'] }}) diff --git a/tests/test_webapi.py b/tests/test_webapi.py index 7b5f7cc..65a62c7 100644 --- a/tests/test_webapi.py +++ b/tests/test_webapi.py @@ -101,6 +101,9 @@ def test_api_clustering_stations(client): data = json.loads(resp.data)['data'] # there are just 4 clusters assert {0, 1, 2, 3} == set(x['cluster_id'] for x in data) + resp = client.get('/api/bordeaux/clustering/stations', + query_string={"geojson": True}) + assert resp.status_code == 200 def test_api_clustering_centroids(client):