convert stops feed to GeoJSON
This commit is contained in:
parent
68e18398fd
commit
1c16d27d99
|
@ -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
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user