-
Notifications
You must be signed in to change notification settings - Fork 4
Creating the map
There are two main components to the map we are creating: the physical attributes of the path/road and then the crime data. We plan to use three main inputs of the road attributes: sidewalks, street lights, and road type/speed limit. This will be the biggest priority for determining how safe a particular road segment is, regardless of crime data (e.g. even if there has been no crime on a 45mph highway, if there are no sidewalks or street lights, it probably isn't very safe to walk that road at night). The crime data will be supplementary to the road attributes, informing users that, for example, there have been 2 assaults that occurred on this block in the past 6 months. How to display this data to best inform users will probably undergo some debate and changes as we implement and test.
To create the road segment dataset, we have to combine three different geospatial datasets of road segments, sidewalks, and street lighting. We'll use a custom script to associate the sidewalks and street lighting with the nearest road segment. This should be a fairly simple process of looking at the point(s) and querying the closest road segment (from a PostGIS instance or other method), then storing the associated ID of the road segment with information indicating whether there are sidewalks and street lights present. Town of Blacksburg street data already includes speed limits in the attribute table. Once these attributes are associated with the road segments, we can do some basic coloring of roads like the examples below.
- Green - safest
- Yellow - use caution
- Red - probably shouldn't walk here
So for example if a road segment had no sidewalk, if the speed limit were <= 25 it could be shown in yellow, anything above that speed limit could be red. If it had a sidewalk but no lighting, under 40mph could be green, above that yellow. And if there were both lighting and sidewalks we could just make it green.
Then we have to decide whether to include crime data in that same coloring scheme, giving weighted values to each road segment to determine how safe it is, or just display crime data as an overlay (which still involves weighting different crimes).
Google Maps API key AIzaSyBHGXXbCN6EbaMwJS3A5wf0gniggDpSEn4