Origins and Destinations
Usually, single buildings or other infrastructure (e.g., shops, work places, public transport halts) are used as origins and as destinations for computing accessibility measures. You may, for example, think about computing the accessibility to the next public transport halt. In this case, you would have single buildings as origins and public transport halts as destinations.
Each of these “locations”, origins and destinations, consists of:
- a numeric ID (identifier);
- a position (geo-location);
- optionally a weighting factor.
The following options are used in combination with this data type:
- --from <SOURCES>: defines where to load origins from;
- --to <DESTINATIONS>: defines where to load destinations from.
We often use locations from OpenStreetMap. A tool for importing them into a database is supported.
Database Format
An origin or a destination is represented using the following attributes in the database:
| Default Column Name | Type | Purpose |
|---|---|---|
| id | long | Names the object |
| geom | PostGIS-Geometry | Defines the object's position in space |
| N/A (optional) | double | Weights the object |
To load objects from a database, you have to give the complete path to the according database table as well as the credentials needed to access it. As such, the call to load origins from a database looks like: --from jdbc:postgresql:<DB_HOST>,<SCHEMA>.<TABLE>,<USER>,<PASSWORD> where:
- <DB_HOST> is the address of the database server
- <SCHEMA> is the database schema the table is located within
- <TABLE> is the name of the database table
- <USER> is the name of the user that can read the table
- <PASSWORD> is the database password of this user
The information where to read the “weight” of an object can be defined using the options --weight <COLUMN_NAME> for origins and --variable <COLUMN_NAME> for destinations.
When loading origins / destinations from a database, additional options can be used to change some defaults:
- --from.filter <FILTER>: defines a filter that is added to the select statement as a
WHERE-clause. - --from.id <COLUMN_NAME>: sets the name of the database column to read the object ID from (default is id).
- --from.geom <COLUMN_NAME>: sets the name of the database column to read the object geometry from (default is geom).
The same options are available for destinations (--to.filter <FILTER>, --to.id <COLUMN_NAME>, --to.geom <COLUMN_NAME>), origin aggregation areas (--from-agg.filter <FILTER>, --from-agg.id <COLUMN_NAME>, --from-agg.geom <COLUMN_NAME>), and destination aggregation areas (--to-agg.filter <FILTER>, --to-agg.id <COLUMN_NAME>, --to-agg.geom <COLUMN_NAME>).
Please note that currently, UrMoAC uses the centroid of a given geometry as the respectively starting / ending position. This means, the geometry of an origin or a destination is arbitrary as long as it can be converted into a point using the PostGIS-function ST_Centroid.
File (.csv) Format
You may load origins / destinations from .csv-files. Here, every origin / destination is stored in one line individually. They should consist of an ID, followed by the x- and the y-coordinate of the respective location's position or centroid in meters. The following example defines an origin or a destination with the ID 2000, x-position -200 and y-position 0:
2000;-200;0
Lines with a leading ‘#’ and empty lines are omitted.
If the object shall be weighted, the value can be added as an additional field, e.g. (the weight is 5):
2000;-200;0;5
Please note that no projection is applied to locations stored in .csv files, thereby you should set --epsg 0.
The file type is recognized by the extension, i.e. use --from <MYFILE>.csv and --to <MYFILE>.csv to load origins or respectively destinations from .csv-files.
File (.wkt) Format
You may load origins / destinations from .wkt-files. Here, every origin / destination is stored in one line individually. They should consist of an ID, followed by the location's position or centroid in meters. The following example defines an origin / a destination with the ID 2000, x-position -200 and y-position 0:
2000;POINT(-200 0)
If the object shall be weighted, the value can be added as an additional field, e.g. (the weight is 5):
2000;POINT(-200 0);5
Lines with a leading ‘#’ and empty lines are omitted.
Please note that no projection is applied to locations stored in .wkt files, thereby you should set --epsg 0.
The file type is recognized by the extension, i.e. use --from <MYFILE>.wkt; and --to <MYFILE>.wkt to load origins or respectively destinations from .wkt-files.
SUMO (.poi.xml)
You may load origins / destinations from SUMO shapefiles.
Please note that currently only numerical shape IDs are accepted.
Please note that no projection is applied to locations stored in SUMO shapefiles files, thereby you should set --epsg 0.
Please note that SUMO shapes do not store a weight.
The file type is recognized by the extension, i.e. use --from <MYFILE>.poi.xml and --to <MYFILE>.poi.xml to load origins or respectively destinations from SUMO shapefiles.