Generate GeoJSON from google spreadsheet
This is a fork of https://github.com/nycoliver/nycmesh-nodes
The paths have been changed to work with the nycmesh.net site
The paths assume this folder, "map-nodes", and the "nycmeshnet.github.io" folder are both in the top level of the same directory. It will write directly to ../nycmeshnet.github.io/map/nodes. It will also look for pictures in ../nycmeshnet.github.io/panorama/
Dependencies
Install node.js, if you don't already have it. Then, in this directory, run:
npm install
to install dependencies
Google Sheets API
- Go to the Google Developers Console
- Create a new project (and then select it)
- Enable the Drive API for your project
- In the sidebar on the left, expand APIs & auth > APIs
- Search for "drive"
- Click on "Drive API"
- click the blue "Enable API" button
- Create a service account for your project
- In the sidebar on the left, expand APIs & auth > Credentials
- Click blue "Add credentials" button
- Select the "Service account" option
- Select the "JSON" key type option
- Click blue "Create" button
- your JSON key file is generated and downloaded to your machine (it is the only copy!)
- note your service account's email address (also available in the JSON key file)
- Share the doc (or docs) with your service account using the email noted above
- Move the JSON key file to ./credentials.json (put it in the root of this project)
- Create file ./spreadsheetid.json and place the google sheet id, e.g.
{
"id": "1234qwer1234qwerasdfqwer1234qwerASDF1234qwerr"
}
npm start
Writes a GeoJSON file to ./nodes.json
The script will look for photos in the ../nycmeshnet.github.io/panorama/ folder