API to serve and calculate isochrones
Isochrone calculation stages:
- Spanning tree generation (time_annotated_spanning_tree_v5.sql):
- Define starting point as the nearest osm node
- Define possible area as 2 hours walk/drive time from starting point
- Calculate driving distance(time) for each road segment
- Resulted spanning tree is returned to FrontEnd in WKB format in order to speed up calculation process for a user
- Calculate point isochrone based on spanning tree. Split isochrone into 5min sections. (calculate_isochrones_dumppoints_v5.sql)
- Calculate isochrone for the whole user input (which might be more than one point) (closest_voronoi_v3.sql)
To start Jetty Server run app without any options. After server is run it restarts processing for uncalculated isochrones.
Due to MyBatis integration -h option requires DB connection and either should be run with --config=<yaml_location> or environment variables with db connection should be set.
Example: java -jar isochrone-api-1.0-SNAPSHOT.jar --config=<yaml_location> -h
Here is list of available options and env variables:
--calculation-restart
Restarts isochrone calculation.
--catalog=catalog_name
Catalog against which 'liquibase dropAll' will be executed.
--config=yaml_location
Specifies YAML config location, which can be a file path or a URL.
-h, --help
Prints this message.
-H, --help-config
Prints information about application modules and their configuration
options.
--lb-changelog-sync
Mark all changes as executed in the database.
--lb-changelog-sync-sql
Writes SQL to mark all changes as executed in the database to STDOUT.
--lb-clear-check-sums
Clears all checksums in the current changelog, so they will be
recalculated next update.
-x [val], --lb-context[=val]
Specifies Liquibase context to control which changeSets will be
executed in migration run.
-d [val], --lb-default-schema[=val]
Specifies the default schema to use for managed database objects and
for Liquibase control tables.
--lb-drop-all
Drops all database objects in the configured schema(s). Note that
functions, procedures and packages are not dropped.
-u, --lb-update
Updates DB with available migrations
-v, --lb-validate
Checks the changelog for errors.
-s schema_name, --schema=schema_name
Schema against which 'liquibase dropAll' will be executed.
DB_MAX_POOL_SIZE
DB_PASSWORD
DB_URL
DB_USER
PostGIS should be installed with --with-sfcgal option
Install pgRouting: https://docs.pgrouting.org/3.1/en/pgRouting-installation.html
http extension for postgresql:
https://github.com/pramsey/pgsql-http.git
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_sfcgal;
CREATE EXTENSION uuid-ossp;
CREATE EXTENSION btree_gist;
CREATE EXTENSION pgRouting;
CREATE EXTENSION http;
install functions from https://github.com/mapbox/postgis-vt-util