Difference between revisions of "Setting up walkyourplace"

From stgo
Jump to: navigation, search
(Install for Calgary)
m (Install for Calgary)
Line 34: Line 34:
 
#* start each model with "run.py"  
 
#* start each model with "run.py"  
 
#** it may be necessary to change in run.py since I am not having gnome-terminal available via command line. At the moment I am starting the scripts using commandline <code>python xxx.py &</code>.  
 
#** it may be necessary to change in run.py since I am not having gnome-terminal available via command line. At the moment I am starting the scripts using commandline <code>python xxx.py &</code>.  
#** the Management Service (for pedestrian network) will listen on http://0.0.0.0:8363/
+
#**# the Management Service (for pedestrian network) will listen on http://0.0.0.0:8363/
#** the Crime Service will listen on http://0.0.0.0:8366/
+
#**# the Crime Service will listen on http://0.0.0.0:8366/
#** the Aggregation Service will listen on http://0.0.0.0:8364/
+
#**# the Aggregation Service will listen on http://0.0.0.0:8364/
#** the POI Service will listen on http://0.0.0.0:8365/
+
#**# the POI Service will listen on http://0.0.0.0:8365/
 
#** My running processes I can see then with <code>ps -u ssteinig</code>
 
#** My running processes I can see then with <code>ps -u ssteinig</code>
 
#** ToDo: check if it is possible to use "subprocess.Popen" or "Multiprocess" (see examples on stackoverflow and [http://stackoverflow.com/questions/3781851/run-a-python-script-from-another-python-script-passing-in-args here])
 
#** ToDo: check if it is possible to use "subprocess.Popen" or "Multiprocess" (see examples on stackoverflow and [http://stackoverflow.com/questions/3781851/run-a-python-script-from-another-python-script-passing-in-args here])

Revision as of 18:14, 4 April 2014

>> return to Cedeus IDE


Steps to Install the WalkYourPlace tool for Santiago

General prep steps

  1. create new Ubuntu 12.04 VM with LA(M)PS ( 7773, lautaro:17022)
  2. install tomcat 7 (or jetty)
  3. install GeoServer + WPS plugin
  4. install Php cURL (http://php.net/curl)
    • geoserver should run on port 8080, otherwise modify "call_wps.php".
  5. install OpenTripPlanner (running on GeoNode VM (146.155.17.54:8080) - and compile graph with
    • Santiago OSM data
    • Santiago GTFS data
    • => test if it works
  6. install PostgreSQL + PostGIS (17032 : db: wypdb)
    • install PostgreSQL

Install for Calgary

  1. Install DBs
    • install crime DB (for the crimes, we considered 12 types of crime as listed in http://crimemap.calgarypolice.ca/ : weighing is in AggregationService.py)
    • install GTFS DB
  2. get Browser client code "WPSClient"
    • modify browser client end point (WPS, etc.) in file call_wps.php to http://146.155.17.113:17088/geoserver/
    • put in apache's /var/www/ (i.e. /var/www/wypwps)
    • note: the map tiles, as defined in js/main.js, will still come from http://136.159.122.90/PHPTileServer/CalgaryGrey/{z}/{x}/{y}.png However, in case the TileServer is down its possible to add OSM map with
      var osmmap = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'});
      plus adding this to the layer selection plus as default layer (PS: also remove setting of the map bounds, see map.setMaxBounds(bounds);)
  3. get backend code
    • GeoServer WPS servers *.jar files = on for each model => install in GeoServers */WEB-INF/lib folder => restart GeoServer
    • GeoProcessing Engine (access model code in Python) => put in any folder
    • modify the postgres DB access in postgis.conf
    • next I would also need modify the OpenTripPlaner URL in in the jar of the WPS module = model. However, I am not having the sources right now, so the Walkshed request is send to the GISciencegroup server.
    • install "psycopg2" python modul which allows access to PostgrSQL pip install psycopg2 (for that, install before "python-dev" and "libpq-dev")
    • start each model with "run.py"
      • it may be necessary to change in run.py since I am not having gnome-terminal available via command line. At the moment I am starting the scripts using commandline python xxx.py &.
        1. the Management Service (for pedestrian network) will listen on http://0.0.0.0:8363/
        2. the Crime Service will listen on http://0.0.0.0:8366/
        3. the Aggregation Service will listen on http://0.0.0.0:8364/
        4. the POI Service will listen on http://0.0.0.0:8365/
      • My running processes I can see then with ps -u ssteinig
      • ToDo: check if it is possible to use "subprocess.Popen" or "Multiprocess" (see examples on stackoverflow and here)
    • Note, not sure, but in ManagementService.py the GeoServer URL is defined with http://127.0.0.1:8080/geoserver - maybe this needs to be changed (for use in a VM???)
  4. test ic Calgary works
    • this is how a request for the pedestrian network model for calgary looks like:
      GET call_wps.php?wps=pedestrian&start_point=51.05747321278561,-114.0794563293457&walking_time_period=15&walking_speed=1.38&distance_decay_function=false

Modify code for Santiago

  1. install PyCharm to modify client code and backend code
    • GeoServer WPS location (IP/address)
    • Postgres location and access: postgis.conf
    • Tileserver location/code in client
    • remove crime calculation in ManagementService.py
  2. deploy code:
    • client side code => install on var/www/ of apache server
    • if there are no changes: GeoProcessing Engine(s) => put in whatever folder and run "run.py"
    • GeoServer WPS servers *.jar files => put in GeoServers */WEB-INF/lib folder (requires restart of GeoServer)
  3. Test