Crowd-sourcing lines on a map to solicit public input on ideal locations for fully protected bike routes as part of the Boston Cyclists' Union's Bikeways for Everybody initiative. See the live site here
- (Optional) Mac & Windows users can install the Github Desktop Software
- Fork the repository by clicking on the fork icon at the top right of this page, like the image below. To learn more about forking, click here.
- Create a new CartoDB dataset. The default dataset comes with the following fields:
{cartodb_id, the_geom, description, name}
. Addzipcode
(string) by creating a new column. Each row represents one submission from the map with the first field a unique id assigned by CartoDB to each geometry.the_geom
is the geographic object.description
is the user input description of the shape, andname
is the user's name. - In the view for the table, click on the "SQL" tab on the write to execute arbitrary SQL.
- Add an
insert_time
column by inputting the following code in the SQL pane:ALTER TABLE bikeways ADD COLUMN insert_time timestamp DEFAULT current_timestamp;
- Copy and paste the contents of
insert_function.sql
(located here) into the sql pane, and then modify the name of the table to be inserted:This function allows you to send data from the map to the CartoDB using a publicly accessible URL while limiting what functions the public can perform on the data (for example, modifying or deleting existing data). This function takes the drawn shape as a GeoJSON, the description, and the username. It converts the GeoJSON to a PostGIS geometry object and then inserts a new row in the table with the geometry, and the other two user-input values. Since it isn't easy to view saved functions in cartoDB, I recommend saving the function in a text file._the_table TEXT := 'bikeways';
If you have multiple tables see below for more information on keeping track of multiple files. - Go to step 2 in After Forking this Repository
If you have multiple tables: you need to create a unique function for each, it's probably a good idea to save each function as a separate file so you can recall what is on your CartoDB account. Alternatively you can see which functions have been created with the following sql
query (source):
SELECT proname, proargnames, prosrc
FROM pg_catalog.pg_namespace n
JOIN pg_catalog.pg_proc p
ON p.pronamespace = n.oid
WHERE n.nspname = 'public'
AND p.proowner <> 10
- In order to use the same basemap, download
emerald_nolabel.tm2z
above (click on the name, then click onraw
to initiate the download) - Login to Mapbox and then click on
Studio
in the top bar. - Note your Access token in the right bar.
- Click on
classic
in the left bar then Upload Classic style and locate the the file you downloaded in Step 1. - Note the ID for the basemap after the upload is successful, it's in a grey box on the same line as
emerald_nolabel
and should be something likeyourusername.rand0malphanum3r1c
- Perform all the steps under the CartoDB heading, then.
- Modify the following variables in
userconfig.js
, you can edit this after cloning, or you can edit directly in your web-browser by clicking on theuserconfig.js
filename above and then clicking on the pencil icon in the top right.
cartoDBusername
to your cartodb username
cartoDBinsertfunction
to the name of your insert function, if you changed it
mapboxAccessToken
your access token in Mapbox, see above
baseMap
the key for your mapbox basemap, see above - Go to http://YOURGITHUBUSERNAME.github.io/bikeways4everybody to see your own map, and start submitting data, you can see the submitted data by going to the data view for that table in your CartoDB account.
- Have a look at the Data Analysis README to learn how to process the data.
- Sarah Bindman's app to map bikeroutes (Great for the "snapping of lines to streets"--actually directions from MapBox. Currently with reduced functionality due to restricted APIs).
- Code for Philly with the Philadelphia Bike coalition developed an app to log people's routes and produced this web-map
- Mike Foster's work on crowdsourcing neighbourhoods
- BostonGIS tutorial For clipping osm tiles to a polygon
Basemap clipped to select cities(not sure if can work with Mapbox)- Crash data?
- Existing infrastructure
- Bikeways for Everybody corridors