-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'otp/dev-2.x' into otp2_not_allowed_tran…
…sfers
- Loading branch information
Showing
266 changed files
with
11,001 additions
and
3,654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Performance test | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev-2.x | ||
|
||
jobs: | ||
perf-test: | ||
if: github.repository_owner == 'opentripplanner' | ||
runs-on: performance-test | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Set up Maven | ||
uses: stCarolas/[email protected] | ||
with: | ||
maven-version: 3.8.2 | ||
|
||
- name: Cache local Maven repository | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Cache graph input files | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
graph/*.osm.pbf | ||
graph/*.zip | ||
key: graph | ||
|
||
- name: Build jar | ||
run: mvn -DskipTests --batch-mode package | ||
|
||
- name: Download OSM & Netex data | ||
run: | | ||
mkdir -p graph | ||
wget https://download.geofabrik.de/europe/norway-210101.osm.pbf -O graph/norway.osm.pbf --no-clobber -q --show-progress --progress=bar:force || true | ||
wget https://leonard.io/otp/rb_norway-aggregated-netex-2021-12-11.zip -O graph/rb_norway-aggregated-netex.zip --no-clobber -q --show-progress --progress=bar:force || true | ||
- name: Build Norway graph | ||
run: | | ||
cp test/ci-performance-test/build-config.json graph/build-config.json | ||
cp target/otp-2.1.0-SNAPSHOT-shaded.jar otp.jar | ||
java -Xmx32G -jar otp.jar --build --save graph | ||
- name: Copy graph, run speed test | ||
env: | ||
PERFORMANCE_INFLUX_DB_PASSWORD: ${{ secrets.PERFORMANCE_INFLUX_DB_PASSWORD }} | ||
MEASUREMENT_ENVIRONMENT: CI | ||
run: | | ||
mv graph/graph.obj test/ci-performance-test/ | ||
mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.raptor.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/ci-performance-test/ -p md -n 4" | ||
- name: Archive travel results file | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: travelSearch-results.csv | ||
path: | | ||
test/ci-performance-test/travelSearch-results.csv | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Data Overlay | ||
Use grid data in NetCDF format to populate the graph. Also provides custom route endpoint parameters for the data "penalty" and "threshold". This allows route planning to be based on the custom data calculated penalties. Data examples: air quality, environmental, and other data types that are tied to certain geographical locations. | ||
|
||
|
||
## Contact Info | ||
Developed and maintained by <strong>Metatavu OY</strong>, Finland. | ||
|
||
Developers: | ||
|
||
<strong>Katja Danilova</strong> - [email protected]\ | ||
<strong>Simeon Platonov</strong> - [email protected]\ | ||
<strong>Daniil Smirnov</strong> - [email protected] | ||
|
||
In case of any questions please contact any of the people above by emails. We would like to continue developing and improving this feature and would love to hear any ideas from the community. | ||
|
||
Company email: [email protected] | ||
|
||
## Changelog | ||
- Initial version (December 2021) | ||
|
||
|
||
## Documentation | ||
|
||
We have been working with OTP since version 1 mainly for producing the Air Quality affected routing for the city of Helsinki, Finland. That project required us to modify the original OTP quite a lot so we didn't propose our efforts for the community. | ||
|
||
With the OTP2 release we decided to create a dedicated layer on top of OTP2 which not only leaves the initial structure of the OpenTripPlanner intact, but also brings some additional features for those, who actually need them. This layer's main feature is populating the graph with a grid data (i.e air quality, temperature, humidity, pressure, wind speed and direction, and e.t.c). For this to work two files are required: the actual data file (i.e in NetCDF format) and a .json settings file which describes the contents of the data file. Please refer to the diagram for more information. | ||
|
||
It is a sandbox feature. | ||
|
||
Please see the configuration part for setup instructions and examples. | ||
|
||
### Configuration | ||
|
||
Enable the feature by including it to the ```otp-config.json```: | ||
|
||
```json | ||
// otp-config.json | ||
{ "otpFeatures": { "DataOverlay" : true } } | ||
``` | ||
|
||
Plugin configuration should explain the NetCDF data file and request parameters that use the data file. | ||
* _fileName_ points to the data file | ||
* _latitudeVariable_, _longitudeVariable_ and _timeVariable_ should be equal to the corresponding variable names of the data file | ||
* _timeFormat_ options: MS_EPOCH, SECONDS, HOURS | ||
* _indexVariables_ contain a list of variables of data file that will affect the routing. | ||
* _name_ can have any value and exists to act as a reference for _requestPatameters_ (see below) | ||
* _displayName_ is a variable name in human-readable form that should make it more understandable | ||
* _variable_ is the actual name of the variable from data file | ||
* _requestParameters_ contains the list of REST request parameters that affects the cost calculation. | ||
* _name_ should be chosen from the list of enums: org.opentripplanner.ext.dataoverlay.api.ParameterName | ||
* _variable_ should correspond to the _name_ of one of the entries from _indexVariables_ list and explain which data field this parameter corresponds to | ||
* _formula_ should use the keywords VALUE and THRESHOLD and describe the way the penalty is calculated. Note: if the result of the formula is negative it is ignored. | ||
|
||
Example of build-config.json that includes the dataOverlay plugin configuration: | ||
```json | ||
// build-config.json | ||
{ | ||
"dataOverlay" : | ||
{ | ||
"fileName": "graphs/data-file.nc4", | ||
"latitudeVariable": "lat", | ||
"longitudeVariable": "lon", | ||
"timeVariable": "time", | ||
"timeFormat": "HOURS", | ||
"indexVariables": [ | ||
{ | ||
"name": "harmfulMicroparticlesPM2_5", | ||
"displayName": "Harmful micro particles pm 2.5", | ||
"variable": "cnc_PM2_5" | ||
}, | ||
{ | ||
"name": "harmfulMicroparticlesPM10", | ||
"displayName": "Harmful micro particles pm 10", | ||
"variable": "cnc_PM10" | ||
} | ||
], | ||
"requestParameters": [ | ||
{ | ||
"name": "PARTICULATE_MATTER_2_5", | ||
"variable": "harmfulMicroparticlesPM2_5", | ||
"formula": "(VALUE + 1 - THRESHOLD) * PENALTY" | ||
}, | ||
{ | ||
"name": "PARTICULATE_MATTER_10", | ||
"variable": "harmfulMicroparticlesPM10", | ||
"formula": "(VALUE + 1 - THRESHOLD) * PENALTY" | ||
} | ||
] | ||
} | ||
|
||
} | ||
``` | ||
|
||
Default values for Data overlay plugin can also be included in router-config instead of being sent with each request. If any Data overlay parameters are passed in user query, all the default values from router-config are ignored. | ||
```json | ||
// router-config.json | ||
{ | ||
"routingDefaults": { | ||
"dataOverlay" : { | ||
"particulate_matter_10_threshold" : 100, | ||
"particulate_matter_10_penalty" : 19 | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Vehicle Parking Updaters - OTP Sandbox Extension | ||
|
||
## Contact Info | ||
- For HSL Park and Ride updater: Digitransit team, HSL, Helsinki, Finland | ||
|
||
## Changelog | ||
- Create initial sandbox implementation (January 2022, https://github.com/opentripplanner/OpenTripPlanner/pull/3796) | ||
|
||
## Documentation | ||
This sandbox contains vehicle parking updaters. Unlike for some other sandbox features, | ||
this is not enabled/disabled through `otp-config.json` but from `router-config.json` updaters. | ||
|
||
Currently contains the following updaters: | ||
- HSL Park and Ride (https://p.hsl.fi/docs/index.html) | ||
- ParkAPI (https://github.com/offenesdresden/ParkAPI) | ||
- KML (Keyhole Markup language) placemark parks. Use name as bike park name and point coordinates. | ||
|
||
### Configuration | ||
These sandboxed vehicle parking updaters can be enabled by editing the `updaters` section | ||
in the `router-config.json` according to the following examples. | ||
|
||
All updaters have the following parameters in common: | ||
- `type`: this needs to be `"vehicle-parking"` | ||
- `feedId`: this is used as a "prefix" for park ids, entrance ids and sometimes also for tags. | ||
|
||
<b>To use HSL park updater:</b> | ||
``` | ||
{ | ||
"type": "vehicle-parking", | ||
"sourceType": "hsl-park", | ||
"feedId": "hslpark", | ||
"facilitiesFrequencySec": 3600, | ||
"facilitiesUrl": "https://p.hsl.fi/api/v1/facilities.json?limit=-1", | ||
"utilizationsFrequencySec": 600, | ||
"utilizationsUrl": "https://p.hsl.fi/api/v1/utilizations.json?limit=-1" | ||
} | ||
``` | ||
- `sourceType`: needs to be `"hsl-park"` | ||
- `facilitiesUrl`: URL that contains the basic information for the parks | ||
- `facilitiesFrequencySec`: how often should the basic information for parks be refetched. | ||
Should be more than `utilizationsFrequencySec` and if it's <= 0, parks are only fetched once. Default `600`. | ||
- `utilizationsUrl`: URL that contains realtime updates to parks | ||
- `utilizationsFrequencySec`: how often should the basic information for parks be refetched. | ||
Should be less than `facilitiesFrequencySec` and if it's < 0, | ||
realtime information is never refetched. Default `3600`. | ||
|
||
<b>To use KML park updater:</b> | ||
``` | ||
{ | ||
"type": "vehicle-parking", | ||
"sourceType": "kml", | ||
"feedId": "kml", | ||
"frequencySec": 600, | ||
"url": "https://foo.bar", | ||
"namePrefix": "foo", | ||
"zip": true | ||
} | ||
``` | ||
- `sourceType`: needs to be `"kml"` | ||
- `url`: URL that contains the park data in KML format | ||
- `frequencySec`: how often park data is refetched. Default `60`. | ||
- `namePrefix`: Adds this prefix to park names | ||
- `zip`: Tells if the data is zipped or not. | ||
|
||
<b>To use ParkAPI updater:</b> | ||
``` | ||
{ | ||
"type": "vehicle-parking", | ||
"sourceType": "park-api", | ||
"feedId": "parkapi", | ||
"frequencySec": 600, | ||
"url": "https://foo.bar", | ||
"headers": {"Cache-Control": "max-age=604800"}, | ||
"tags": ["source:parkapi"] | ||
} | ||
``` | ||
- `sourceType`: needs to be `"park-api"` if car parks are fetched, `"bicycle-park-api"` if bicycle parks. | ||
- `url`: URL that contains the park data in KML format | ||
- `frequencySec`: how often park data is refetched. Default `60`. | ||
- `headers`: Use these headers for requests | ||
- `tags`: Add these tags to all parks. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.