def collisions_choropleth_map(): pageopts = { 'uppercase': 'Traffic Collisions', 'lowercase': 'traffic collisions', 'maptype': 'Choropleth Map', } mapdata = {} if request.method == 'POST': userfilters = models.get_userfilters(request.form) filters = userfilters region_type = request.form['region_type'] mapdata['geojson'], mapdata['colorbar'] = models.choropleth_geojson( app.df_collisions, region_type, filters) else: filters = models.get_defaultfilters() region_type = 'nhood' mapdata['filename'] = 'collisions-choropleth-default.json' mapdata[ 'colorbar_filename'] = 'collisions-choropleth-default-colorbar.json' return render_template('map.html', pageopts=pageopts, maptype='choropleth', regionopts=models.get_regionopts()[region_type], mapdata=mapdata, filtersdisplay=models.build_filtersdisplay(filters))
def collisions_choropleth_map(): pageopts = { 'uppercase' : 'Traffic Collisions', 'lowercase' : 'traffic collisions', 'maptype' : 'Choropleth Map', } mapdata = {} if request.method == 'POST': userfilters = models.get_userfilters(request.form) filters = userfilters region_type = request.form['region_type'] mapdata['geojson'],mapdata['colorbar'] = models.choropleth_geojson(app.df_collisions,region_type,filters) else: filters = models.get_defaultfilters() region_type = 'nhood' mapdata['filename'] = 'collisions-choropleth-default.json' mapdata['colorbar_filename'] = 'collisions-choropleth-default-colorbar.json' return render_template('map.html', pageopts=pageopts, maptype='choropleth', regionopts=models.get_regionopts()[region_type], mapdata=mapdata, filtersdisplay=models.build_filtersdisplay(filters) )
def thefts_heat_map(): if request.method == 'POST': userfilters = models.get_userfilters(request.form) filters = userfilters else: filters = models.get_defaultfilters() pageopts = { 'uppercase': 'Thefts', 'lowercase': 'thefts', 'maptype': 'Heat Map', } return render_template('map.html', pageopts=pageopts, maptype='heat', mapdata=models.heat_listcoords( app.df_thefts, filters), filtersdisplay=models.build_filtersdisplay(filters))
def thefts_heat_map(): if request.method == 'POST': userfilters = models.get_userfilters(request.form) filters = userfilters else: filters = models.get_defaultfilters() pageopts = { 'uppercase' : 'Thefts', 'lowercase' : 'thefts', 'maptype' : 'Heat Map', } return render_template('map.html', pageopts=pageopts, maptype='heat', mapdata=models.heat_listcoords(app.df_thefts,filters), filtersdisplay=models.build_filtersdisplay(filters) )
def theft_markers_map(): pageopts = { 'uppercase': 'Thefts', 'lowercase': 'thefts', 'maptype': 'Individual Incidents Map', } mapdata = {} if request.method == 'POST': userfilters = models.get_userfilters(request.form) filters = userfilters mapdata['geojson'] = models.markers_geojson(app.df_thefts, filters) else: filters = models.get_defaultfilters() mapdata['filename'] = 'thefts-markers-default.json' return render_template('map.html', pageopts=pageopts, maptype='markers', mapdata=mapdata, filtersdisplay=models.build_filtersdisplay(filters))
def theft_markers_map(): pageopts = { 'uppercase' : 'Thefts', 'lowercase' : 'thefts', 'maptype' : 'Individual Incidents Map', } mapdata = {} if request.method == 'POST': userfilters = models.get_userfilters(request.form) filters = userfilters mapdata['geojson'] = models.markers_geojson(app.df_thefts,filters) else: filters = models.get_defaultfilters() mapdata['filename'] = 'thefts-markers-default.json' return render_template('map.html', pageopts=pageopts, maptype='markers', mapdata=mapdata, filtersdisplay=models.build_filtersdisplay(filters) )