WHAT:
Milanography is a partecipative mapping project focused on Milan's neighborhoods.
It aims to make visible the "shared" image of the city, as perceived by its inhabitants, by mapping the closest spatial unit to their daily life. Which is precisely the neighborhood.
It's basically a shameless adaptation of the great Bostonography project to la cità la pusee bèla ad mùnd (A.K.A. Milan), but has also been inspired by Areas of Edinburgh and The Neighborhood Project.
Here's a Live version
WHY:
I liked all those experiences and wanted to replicate them in milan, but I missed the tools. Hence I decided to build it myslef.
This time though, entirely onto an open-stack: Postgres / PostGIS + Flask + LeafletJS
HOW:
Milanography allows the user to draw a shape representing a neighborhood, from a list of suggest places. The user can then save and submit such shape, which is consequently saved on a Postgres instance via Flask.
Everyone is warmly encouraged to contribute to and to improve the project!
Disclaimer!
This is my first project with Python Flask, hence it's a truly crude application. Fork it and make it better!
##Update:
Of course the minute I finished this project I discovered somebody else did the same -but better! :)
Props to @nichom for his amazing piece of code: neighborhoods
I'm in love with it!
Nonetheless, if you want to have the complete control of your infrastructure and run your own instances, this is still a good, yet basic, starting point to develop your own draw-collecting app.
I assume you have the following tools in your system:
- Python (v. 2.7)
- PostgreSQL (latest) If you are running on an Apple machine you might want to check out PostgresApp
Common front-end dependencies are managed through Bower
Run on bower.json
bower install
Other dependencies are:
-
Python dependencies are contained within a virtualenv
-
Activate it
source env/bin/activate
-
Install (via pip) Flask + Psycopg2 + SQLAlchemy
pip install Flask pip install psycopg2 pip install Flask-SQLAlchemy
-
Run Flask
python app.py
-
Once done, deactivate the virtualenv
deactivate
Download or git clone
the repo.
Then cd dist
if you want to use a raw, unstylized version of the app.
Otherwise you can cd examples/milan
to use a simple theme.
Create PostgreSQL Db. The data is stored as JSON data type, es:
CREATE TABLE shapes (id integer, data json);
source env/bin/activate
Run postgres.py script:
python app.py
See the result (localhost) 127.0.0.1:5000
So far I've only tested the app on a virtual server running Ubuntu server (v. 14.0) and a combination of Gunicorn + NGINX, but flask it's a pretty versatile framework.