Wrapper around OpenTravelData (OPTD) data sets, to be used by the OpenTREP components.
- Open Travel REquest Parser (OpenTREP):
- GitHub: https://trep.github.io/opentrep
- Docker Cloud repository: https://cloud.docker.com/u/opentrep/repository/docker/opentrep/metatrep
- Web applications:
- OpenTravelData (OPTD):
- GitHub: https://opentraveldata.github.io/opentraveldata
- Docker Cloud repository: https://cloud.docker.com/u/opentraveldata/repository/docker/opentraveldata/quality-assurance
- Published data sets: https://transport-search.org/data/optd/por/
- Meta-TREP umbrella project (to build and install OpenTREP and
get and use OPTD data):
- GitHub: https://github.com/trep/metatrep
- See the OpenTREP README for more details on how to install OpenTREP on most platforms.
- OpenTREP may also be installed by the meta-TREP project, which moreover downloads and injects OPTD data into it
- Typically, OpenTREP installs a
small sample data file
for the POR (points of reference) in its data directory
(e.g.,
/usr/share/opentrep/data/por
,~/dev/deliveries/opentrep/share/opentrep/data/por
) for testing purposes. - OpenTravelData (OPTD) regularly publishes POR data files, both on GitHub and on transport-search.org
- This project (OPTD data injector)
downloads the
optd_por_public_all.csv
POR data set from the OPTD sites (see above for the URLs) and injects it into the OpenTREP local installation directory, so that OpenTREP can then use it as a reference (for indexing and searching) - The Meta-TREP project eases the full
process:
- Download and install OpenTREP
- Download and inject the OPTD POR data set into the OpenTREP installation directory
- Clone the Git repository (one-time task):
$ mkdir -p ~/dev/geo && \
git https://github.com/trep/opentraveldata-wrapper.git ~/dev/geo/opentraveldata-wrapper
- Download and install the OPTD POR data file (where
<opentrep-install-dir>
is the installation directory of OpenTREP, for instance/usr
,/usr/llocal
,${HOME}/deliveries/opentrep-<version>
, etc):
$ pushd ~/dev/geo/opentraveldata-wrapper
$ export VERSION="99.99.99"
$ cmake -DVERSION="${VERSION}" -DCMAKE_INSTALL_PREFIX=${HOME}/dev/deliveries -DWITH_OPENTREP_PREFIX=<opentrep-install-dir> ..
$ ls -laFh ~/dev/deliveries/opentraveldata/share/data/por
total 85368
-rw-r--r-- 1 user staff 42M Sep 1 15:11 optd_por_public_all.csv
$ popd
TREP_DIR="workspace/install/opentrep"
POR_FILE="${TREP_DIR}/share/opentrep/data/por/optd_por_public_all.csv"
${TREP_DIR}/bin/opentrep-indexer -p ${POR_FILE} -t sqlite
TREP_DIR="/var/www/webapps/opentrep/trep"
POR_FILE="${TREP_DIR}/share/opentrep/data/por/optd_por_public_all.csv"
BUILD_DIR="${HOME}/dev/trep/opentrepgit/build"
${BUILD_DIR}/opentrep/opentrep-indexer -p ${POR_FILE} -d ${TREP_DIR}/traveldb -t sqlite -s ${TREP_DIR}/sqlite_travel.db
TREP_DIR="workspace/install/opentrep"
POR_FILE="${TREP_DIR}/share/opentrep/data/por/optd_por_public_all.csv"
SEARCH_STR="nce sna francisco"
${TREP_DIR}/bin/opentrep-searcher -t sqlite -q "${SEARCH_STR}"
TREP_DIR="/var/www/webapps/opentrep/trep"
BUILD_DIR="${HOME}/dev/trep/opentrepgit/build"
SEARCH_STR="nce sna francisco"
${BUILD_DIR}/opentrep/opentrep-searcher -d ${TREP_DIR}/traveldb -t sqlite -s ${TREP_DIR}/sqlite_travel.db -q "${SEARCH_STR}"