Example #1
0
def routes_qgis():

    bounds = Route.get_bounds(app.db)

    # datasource = "http://trondheim.routr.dk/data"
    datasource = "http://127.0.0.1:5000/data"

    rt = render_template('routes.qgs',
                         datasource = datasource,
                         xmin = bounds[0],
                         ymin = bounds[1],
                         xmax = bounds[2],
                         ymax = bounds[3]
                         )

    response= make_response(rt)
    response.headers["Content-Type"] = "application/x-qgis-project"

    return response
Example #2
0
def routes_geojson():
    """
    :return: Returns a dict containing the bundaries of the table and a list of guids of the routes.
    {
  "bounds": [
    10.26912689208984,
    63.38337070759972,
    10.45074462890625,
    63.4445238395574
  ],
  "guids": [
    "75ab78e8-63a5-459a-b580-61f67c45db94",
    "f82d1581-2649-4fbb-8716-270da989538c",
    "01407688-2237-4f87-ba66-697097517cbc",
    "d25184ca-a76a-4e52-b474-aadc80d26626"
  ]
}
    """
    return jsonify(
        {
            'bounds': Route.get_bounds(app.db),
            'guids': [r.guid for r in Route.all(app.db)]
        })