Exemple #1
0
def getShape(shape_id):
  shape = db.session.query(Shape).filter(Shape.shape_id == shape_id)\
    .order_by(Shape.shape_pt_sequence).all()
  coords = [[pt.shape_pt_lon,pt.shape_pt_lat] for pt in shape]
  feature = geojson.feature(id=shape_id, feature_type="LineString",
    coords=coords, properties={})
  return jsonify(geojson.featureCollection([feature]))
Exemple #2
0
def getShape(shape_id):
  shape = ShapePath.query.get(shape_id)
  feature = geojson.feature(id=shape_id, feature_type="LineString",
    coords=shape.shape_path_array, properties={})
  return jsonify(geojson.featureCollection([feature]))