Skip to content

trep/opentraveldata-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTravelData (OPTD) data injector

Docker Repository on Quay

Wrapper around OpenTravelData (OPTD) data sets, to be used by the OpenTREP components.

References

Manual build and installation

OpenTREP

  • 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

OPTD injector

  • 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

Use cases

Indexing

Local installation

Meta-TREP installation

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

Web application

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

Searching

Meta-TREP installation

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}"

Web application

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}"

About

Wrapper for OpenTravelData (OPTD)

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published