Difference between revisions of "Setting up walkyourplace"
From stgo
(→Modify code for Santiago) |
(→Install for Calgary) |
||
Line 43: | Line 43: | ||
# test ic Calgary works | # test ic Calgary works | ||
#* this is how a request for the pedestrian network model for calgary looks like: <pre>GET call_wps.php?wps=pedestrian&start_point=51.05747321278561,-114.0794563293457&walking_time_period=15&walking_speed=1.38&distance_decay_function=false</pre> | #* this is how a request for the pedestrian network model for calgary looks like: <pre>GET call_wps.php?wps=pedestrian&start_point=51.05747321278561,-114.0794563293457&walking_time_period=15&walking_speed=1.38&distance_decay_function=false</pre> | ||
+ | #* this will do a call to the pedestrian-network '''crime WPS''' and return features in the given walkshed: | ||
+ | #** Calgary server <pre>http://136.159.122.90:8080/geoserver/ows?service=wps&version=1.0.0&request=execute&identifier=gs:Crime_Pedestrian&datainputs=Walkshed=%7B%22type%22:%22Polygon%22,%22coordinates%22:%5B%5B%5B-114.09364571378056,51.057144582993836%5D,%5B-114.09286815708892,51.05359381755474%5D,%5B-114.09101115708,51.050834058520664%5D,%5B-114.09075927937053,51.05080998647081%5D,%5B-114.0870286,51.0516827%5D,%5B-114.08586777200182,51.04970977429437%5D,%5B-114.0835059,51.0489783%5D,%5B-114.08184778623112,51.0498709384076%5D,%5B-114.081181,51.0536508%5D,%5B-114.0793914,51.0547065%5D,%5B-114.077687,51.0557314%5D,%5B-114.0756248,51.0568823%5D,%5B-114.0750158,51.0570965%5D,%5B-114.0736901,51.0573512%5D,%5B-114.06926177015508,51.055915080229724%5D,%5B-114.06619893997784,51.05694155563417%5D,%5B-114.06579011626843,51.0581622658825%5D,%5B-114.067673398873,51.058916548778726%5D,%5B-114.07143185670641,51.061423362491404%5D,%5B-114.07184987616904,51.06168921938163%5D,%5B-114.0741837,51.0613545%5D,%5B-114.07794224224338,51.06228401160695%5D,%5B-114.07918450576179,51.06260346516831%5D,%5B-114.07993046849634,51.06280359284396%5D,%5B-114.08066137191179,51.062350982627464%5D,%5B-114.08244401432806,51.06127600012983%5D,%5B-114.08582266933304,51.061346817139835%5D,%5B-114.08616082731021,51.06129711945887%5D,%5B-114.0888935,51.0575163%5D,%5B-114.09170271289915,51.05843118482227%5D,%5B-114.09364571378056,51.057144582993836%5D%5D%5D%7D</pre> | ||
+ | #** Stgo test server <pre>http://146.155.17.113:17088/geoserver/ows?service=wps&version=1.0.0&request=execute&identifier=gs:Crime_Pedestrian&datainputs=Walkshed={%22type%22:%22Polygon%22,%22coordinates%22:[[[-114.09364571378056,51.057144582993836],[-114.09286815708892,51.05359381755474],[-114.09101115708,51.050834058520664],[-114.09075927937053,51.05080998647081],[-114.0870286,51.0516827],[-114.08586777200182,51.04970977429437],[-114.0835059,51.0489783],[-114.08184778623112,51.0498709384076],[-114.081181,51.0536508],[-114.0793914,51.0547065],[-114.077687,51.0557314],[-114.0756248,51.0568823],[-114.0750158,51.0570965],[-114.0736901,51.0573512],[-114.06926177015508,51.055915080229724],[-114.06619893997784,51.05694155563417],[-114.06579011626843,51.0581622658825],[-114.067673398873,51.058916548778726],[-114.07143185670641,51.061423362491404],[-114.07184987616904,51.06168921938163],[-114.0741837,51.0613545],[-114.07794224224338,51.06228401160695],[-114.07918450576179,51.06260346516831],[-114.07993046849634,51.06280359284396],[-114.08066137191179,51.062350982627464],[-114.08244401432806,51.06127600012983],[-114.08582266933304,51.061346817139835],[-114.08616082731021,51.06129711945887],[-114.0888935,51.0575163],[-114.09170271289915,51.05843118482227],[-114.09364571378056,51.057144582993836]]]}</pre> | ||
+ | #** if the python server/script is started, the crime data can be also be called using <pre>http://127.0.0.1:8366/crime?walkshed={%22type%22:%22Polygon%22,%22coordinates%22:[[[-114.09364571378056,51.057144582993836],[-114.09286815708892,51.05359381755474],[-114.09101115708,51.050834058520664],[-114.09075927937053,51.05080998647081],[-114.0870286,51.0516827],[-114.08586777200182,51.04970977429437],[-114.0835059,51.0489783],[-114.08184778623112,51.0498709384076],[-114.081181,51.0536508],[-114.0793914,51.0547065],[-114.077687,51.0557314],[-114.0756248,51.0568823],[-114.0750158,51.0570965],[-114.0736901,51.0573512],[-114.06926177015508,51.055915080229724],[-114.06619893997784,51.05694155563417],[-114.06579011626843,51.0581622658825],[-114.067673398873,51.058916548778726],[-114.07143185670641,51.061423362491404],[-114.07184987616904,51.06168921938163],[-114.0741837,51.0613545],[-114.07794224224338,51.06228401160695],[-114.07918450576179,51.06260346516831],[-114.07993046849634,51.06280359284396],[-114.08066137191179,51.062350982627464],[-114.08244401432806,51.06127600012983],[-114.08582266933304,51.061346817139835],[-114.08616082731021,51.06129711945887],[-114.0888935,51.0575163],[-114.09170271289915,51.05843118482227],[-114.09364571378056,51.057144582993836]]]}</pre> | ||
== '''Modify code for Santiago''' == | == '''Modify code for Santiago''' == |
Revision as of 13:29, 8 April 2014
>> return to Cedeus IDE
Steps to Install the WalkYourPlace tool for Santiago
General prep steps
- create new Ubuntu 12.04 VM with LA(M)PS ( 7773, lautaro:17022)
- install tomcat 7 (or jetty)
- install GeoServer + WPS plugin
- install Php cURL (http://php.net/curl)
- geoserver should run on port 8080, otherwise modify "call_wps.php".
- 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
- install PostgreSQL + PostGIS (17032 : db: wypdb)
- install PostgreSQL
Install for Calgary
- 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
- 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, seemap.setMaxBounds(bounds);
)
- get backend code
- GeoServer WPS servers *.jar files = on for each model => install in GeoServers */WEB-INF/lib folder => restart GeoServer
- check if it works with http://146.155.17.113:8080/geoserver/ows?service=wps&version=1.0.0&request=GetCapabilities
- 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 run.py (causes error at the moment) since I am not having gnome-terminal available via command line. At the moment I am starting the scripts using commandline
python xxx.py &
.- 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 Aggregation Service will listen on http://0.0.0.0:8364/
- 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)
- it may be necessary to change run.py (causes error at the moment) since I am not having gnome-terminal available via command line. At the moment I am starting the scripts using commandline
- 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???)
- GeoServer WPS servers *.jar files = on for each model => install in GeoServers */WEB-INF/lib folder => restart GeoServer
- 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
- this will do a call to the pedestrian-network crime WPS and return features in the given walkshed:
- Calgary server
http://136.159.122.90:8080/geoserver/ows?service=wps&version=1.0.0&request=execute&identifier=gs:Crime_Pedestrian&datainputs=Walkshed=%7B%22type%22:%22Polygon%22,%22coordinates%22:%5B%5B%5B-114.09364571378056,51.057144582993836%5D,%5B-114.09286815708892,51.05359381755474%5D,%5B-114.09101115708,51.050834058520664%5D,%5B-114.09075927937053,51.05080998647081%5D,%5B-114.0870286,51.0516827%5D,%5B-114.08586777200182,51.04970977429437%5D,%5B-114.0835059,51.0489783%5D,%5B-114.08184778623112,51.0498709384076%5D,%5B-114.081181,51.0536508%5D,%5B-114.0793914,51.0547065%5D,%5B-114.077687,51.0557314%5D,%5B-114.0756248,51.0568823%5D,%5B-114.0750158,51.0570965%5D,%5B-114.0736901,51.0573512%5D,%5B-114.06926177015508,51.055915080229724%5D,%5B-114.06619893997784,51.05694155563417%5D,%5B-114.06579011626843,51.0581622658825%5D,%5B-114.067673398873,51.058916548778726%5D,%5B-114.07143185670641,51.061423362491404%5D,%5B-114.07184987616904,51.06168921938163%5D,%5B-114.0741837,51.0613545%5D,%5B-114.07794224224338,51.06228401160695%5D,%5B-114.07918450576179,51.06260346516831%5D,%5B-114.07993046849634,51.06280359284396%5D,%5B-114.08066137191179,51.062350982627464%5D,%5B-114.08244401432806,51.06127600012983%5D,%5B-114.08582266933304,51.061346817139835%5D,%5B-114.08616082731021,51.06129711945887%5D,%5B-114.0888935,51.0575163%5D,%5B-114.09170271289915,51.05843118482227%5D,%5B-114.09364571378056,51.057144582993836%5D%5D%5D%7D
- Stgo test server
http://146.155.17.113:17088/geoserver/ows?service=wps&version=1.0.0&request=execute&identifier=gs:Crime_Pedestrian&datainputs=Walkshed={%22type%22:%22Polygon%22,%22coordinates%22:[[[-114.09364571378056,51.057144582993836],[-114.09286815708892,51.05359381755474],[-114.09101115708,51.050834058520664],[-114.09075927937053,51.05080998647081],[-114.0870286,51.0516827],[-114.08586777200182,51.04970977429437],[-114.0835059,51.0489783],[-114.08184778623112,51.0498709384076],[-114.081181,51.0536508],[-114.0793914,51.0547065],[-114.077687,51.0557314],[-114.0756248,51.0568823],[-114.0750158,51.0570965],[-114.0736901,51.0573512],[-114.06926177015508,51.055915080229724],[-114.06619893997784,51.05694155563417],[-114.06579011626843,51.0581622658825],[-114.067673398873,51.058916548778726],[-114.07143185670641,51.061423362491404],[-114.07184987616904,51.06168921938163],[-114.0741837,51.0613545],[-114.07794224224338,51.06228401160695],[-114.07918450576179,51.06260346516831],[-114.07993046849634,51.06280359284396],[-114.08066137191179,51.062350982627464],[-114.08244401432806,51.06127600012983],[-114.08582266933304,51.061346817139835],[-114.08616082731021,51.06129711945887],[-114.0888935,51.0575163],[-114.09170271289915,51.05843118482227],[-114.09364571378056,51.057144582993836]]]}
- if the python server/script is started, the crime data can be also be called using
http://127.0.0.1:8366/crime?walkshed={%22type%22:%22Polygon%22,%22coordinates%22:[[[-114.09364571378056,51.057144582993836],[-114.09286815708892,51.05359381755474],[-114.09101115708,51.050834058520664],[-114.09075927937053,51.05080998647081],[-114.0870286,51.0516827],[-114.08586777200182,51.04970977429437],[-114.0835059,51.0489783],[-114.08184778623112,51.0498709384076],[-114.081181,51.0536508],[-114.0793914,51.0547065],[-114.077687,51.0557314],[-114.0756248,51.0568823],[-114.0750158,51.0570965],[-114.0736901,51.0573512],[-114.06926177015508,51.055915080229724],[-114.06619893997784,51.05694155563417],[-114.06579011626843,51.0581622658825],[-114.067673398873,51.058916548778726],[-114.07143185670641,51.061423362491404],[-114.07184987616904,51.06168921938163],[-114.0741837,51.0613545],[-114.07794224224338,51.06228401160695],[-114.07918450576179,51.06260346516831],[-114.07993046849634,51.06280359284396],[-114.08066137191179,51.062350982627464],[-114.08244401432806,51.06127600012983],[-114.08582266933304,51.061346817139835],[-114.08616082731021,51.06129711945887],[-114.0888935,51.0575163],[-114.09170271289915,51.05843118482227],[-114.09364571378056,51.057144582993836]]]}
- Calgary server
- this is how a request for the pedestrian network model for calgary looks like:
Modify code for Santiago
- 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
- OTP location in backend (jar file)
- remove crime calculation in ManagementService.py
- 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)
- Test