C-ASAP project aims to develop a software platform for coordinating the activities around reporting missing persons, notifying volunteers in the vicinity, and coordinating the activities of volunteers who may encounter these missing persons, the family members and the police.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Virtualenv/Virtualenvwrapper
- Python 3.5.1
- PostgreSQL and postgis
- settings_server.py from Carlo Oliva or Yuxuan Zhao
- Clone this repository
- cd into the casap directory and add the settings_server.py file here
- Create a Virtual Environment using python3
- Follow the instructions to install the required geospatial libraries, and postgis
- Linux example for step 4. OSX users follow similar steps.
- Credit to Falon Scheers for Linux instructions.
$ sudo apt-get install binutils libproj-dev gdal-bin
- GEOS download and configure:
$ wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
$ tar xjf geos-3.4.2.tar.bz2
$ cd geos-3.4.2
$ ./configure
$ make
$ sudo make install
$ cd ..
- PROJ.4 is a library for converting geospatial data to different coordinate reference systems:
wget http://download.osgeo.org/proj/proj-4.9.1.tar.gz
$ wget http://download.osgeo.org/proj/proj-datumgrid-1.5.tar.gz
Next, untar the source code archive, and extract the datum shifting files in the nad subdirectory. This must be done prior to configuration:
$ tar xzf proj-4.9.1.tar.gz
$ cd proj-4.9.1/nad
$ tar xzf ../../proj-datumgrid-1.5.tar.gz
$ cd ..
Finally, configure, make and install PROJ.4:
$ ./configure
$ make
$ sudo make install
$ cd ..
- GDAL open source geospatial library that has support for reading most vector and raster spatial data formats:
$ wget http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz
$ tar xzf gdal-1.11.2.tar.gz
$ cd gdal-1.11.2
Configure, make and install:
$ ./configure --with-python
$ make # Go get some coffee, this takes a while.
$ sudo make install
$ cd ..
- Install postgis for your machine: http://postgis.net/install/
for Ubuntu first check what release you have:
$ sudo lsb_release -a
- Then lookup your release for your_tagname here and insert:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt your_tagname-pgdg main" >> /etc/apt/sources.list'
Add Keys:
$ wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
Install postgresql 9.5, PostGIS 2.2, PGAdmin3, pgRouting 2.1 :
$ sudo apt-get install postgresql-9.5-postgis-2.2 pgadmin3 postgresql-contrib-9.5
To Install pgRouting 2.1 package:
$ sudo apt-get install postgresql-9.5-pgrouting
* after PostGIS is installed create database and then put this db name in your settings.py file:
$ createdb < db name >
$ psql < db name >
$ > CREATE EXTENSION postgis;
- Modify settings_server.py for your own computer and database
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': '<db name>',
}
}
- Install requirements.txt
$ pip install -r requirements.txt
- Make database migrations and migrate to the database
$ python manage.py makemigrations casap
$ python manage.py migrate casap
- If you get database errors run this:
python manage.py migrate --run-syncdb
- Load Open Street Maps location data for Alberta
- Courtesy from Falon Scheers
- Ask for the /OSMdataProcess folder
- First read comments in and run file '/OSMdataProcess/getMapModelInfo.py'
- Then inspect the output file, '/OSMdataProcess/OSMmapModelInfo.txt' and note the desired layer numbers for buildings and POI
- Then read comments, mend, and run the file 'Load.py' to store OSM locations into your local database
$ python manage.py runserver
The project is deployed on the RAC server: C-ASAP Server
In order to make any changes to the production server, ask@olivaCfor a .pem file for access to the server.
- Ssh in the server:
- Activate the virtual environment:
source django-env/bin/activate
- cd into the casap project
cd casap
- pull changes into either the master/development branch (whichever is being used)
git pull origin development
- Enter your github credentials
- If any static files were changed, you will need to serve these.
./manage.py collectstatic
- Github - Where the source code lives
- Django - The web framework used
- PostgreSQL - Database
- OpenLayers - Location based layers
- OpenStreetMap - Location finder
- Google Maps - Location
- Twilio - SMS notifications
- Rapid Access Cloud - Cybera Server
- Nginx - Serve web pages on RAC server
- Twitter - Tweets
- Bitly - URL shortener
- Sina Jalali - Initial work
- Carlo Oliva
- Yuxuan Zhao
- Falon Scheers - Location and Activity functionality using OpenLayers and OpenStreetMap