Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vgrichina/mtv-projects

Mountain View, CA – Map of active construction projects
https://github.com/vgrichina/mtv-projects

geodata google-maps mountain-view open-data open-government opendata opengov

Last synced: 16 days ago
JSON representation

Mountain View, CA – Map of active construction projects

Awesome Lists containing this project

README

        

# Mountain View, CA – Map of active construction projects

This isn't official information, it is based on official development project list available here:
http://mountainview.gov/depts/comdev/planning/activeprojects/list.asp

Data is scraped from PDF files and may contain inaccuracies. Please consult linked PDF files for accurate official information.

Your contributions are welcome -- please fork and submit pull requests.

## Hacking on

`index.html` contains map frontend code itself. Change it if you want to change the way information is displayed.

`data/projects.json` contains scraped data. It is generated by combination of `download.py` and `preprocess.py`

`download.py` downloads pdfs from Mountain View website into `data/` folder. It also converts them to text and parses using `parse.py` module. Results are written to `data/projects.json`.

`preprocess.py` prepares `data/projects.json` for use on map. It tries to parse addresses from project titles and geocodes them using Google Maps API.

## Running locally

### Requirements

- Python 2.7.x
- [requests](http://docs.python-requests.org/en/master/)
- [geopy](https://pypi.python.org/pypi/geopy)
- [poppler](https://poppler.freedesktop.org), `pdftotext` utility specifically

### Download data

```
python download.py
```

### Preprocess data

Create `secrets.sh` file with following contents:

```
export GOOGLE_API_KEY=
```

API key can be obtained here https://console.developers.google.com/apis/credentials

```
python preprocess.py
```

### Run local web server

```
python -m SimpleHTTPServer 8000
```

This will start webserver available on [http://localhost:8000](http://localhost:8000). It is important to open web page from server as JS cannot load data if you open it locally from file system.