From 1c16d27d9914d25bbb66be8ad185484be07280ae Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 19 Feb 2012 17:44:19 +0530 Subject: [PATCH] convert stops feed to GeoJSON --- chaloBEST/mumbai/apiviews.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chaloBEST/mumbai/apiviews.py b/chaloBEST/mumbai/apiviews.py index dfdf441..5e31772 100644 --- a/chaloBEST/mumbai/apiviews.py +++ b/chaloBEST/mumbai/apiviews.py @@ -3,8 +3,11 @@ from ox.django.shortcuts import get_object_or_404_json, render_to_json_response def route(request, code): route = get_object_or_404_json(Route, code=code) - stops = [r.stop.get_dict() for r in RouteDetail.objects.filter(route=route)] + stops = [r.stop.get_geojson() for r in RouteDetail.objects.filter(route=route)] return render_to_json_response({ 'route': route.get_dict(), - 'stops': stops + 'stops': { + 'type': 'FeatureCollection', + 'features': stops + } })