WFP GIS Unit web site and applications
-
Clone the project::
$ cd ~/git $ git clone https://github.com/WorldFoodProgramme/imaps.git
-
create a virtual environment and activate it::
$ virtualenv --no-site-packages env $ . env/bin/activate
-
Install requirements::
$ pip install -r requirements.txt
-
add a local_settings.py file::
$ cp local_settings.py.tmpl local_settings.py
-
edit the local_settings.py file with your database and other credentials
-
sync the database and create a superuser::
$ python manage.py syncdb --all
-
Download the GeoNames database (needed by sm@rtfeeds)::
$ wget http://download.geonames.org/export/dump/allCountries.zip $ unzip allCountries.zip
-
Import GeoNames using a GDAL virtual driver. Create this geonames.vrt file::
CSV:allCountries.txt wkbPoint EPSG:4326 -
Then run ogr2ogr to import the .csv file to PostGIS::
$ ogr2ogr -f PostgreSQL PG:"dbname='imaps' host='localhost' port='5432' user='imaps' password='imaps'" geonames.vrt
-
Create the index to speed the text search::
CREATE INDEX geonames_lower_idx ON geonames USING btree (lower(name::text) COLLATE pg_catalog."default" );
-
Schedule the importing processes in crontab. Copy the crontab.sh.tmpl file to crontab.sh and modify it as needed::
$ cp crontab.sh.tmpl crontab.sh
-
Open the crontab and schedule it as per your need::
$ crontab -e */5 * * * * /home/capooti/git/github/capooti/smartfeeds/crontab.sh > /tmp/smartfeeds.log 2>&1
-
Run the server, create a Search object and wait for tweets and feeds