Scripts

Python scripts used in CVTS. These are installed with the python package.

Utilities for Individual Files

csv2json

Python script for converting CSVs to JSON appropriate for feeding to the trace_attributes service of Valhalla. This is convenient for converting single files when testing/playing/etc.

json2geojson

Python script for converting the json files produced by the trace_attributes service of Valhalla to GeoJSON files. This is also useful for testing/playing/ect.

createdb

TODO

loadvehicles

TODO

Entry Points for the (Luigi) Workflow

These scripts ensure that various tasks are complete.

The results of these scripts are saved in sub-folders of the

processtraces

Script for matching all raw data to the road network.

processall

Script for extracting:

  • stops by region,

  • stops on a (0.1 degree) raster,

  • source and destination counts,

  • speeds by way ids. These are calculated by road segment by time of day for each vehicle. These are first produced on disk, then saved in an SQL database (see cvts.models.Traversal for an ORM representation of the the rows).

Because of the dependencies, this would also trigger the (Luigi) tasks that would be run by processtraces if required.

Misc

createpgdb

Script to generate the database defined by the (ORM) classes in cvts.models.

BE CAREFUL WITH THIS… it will first drop tables and alike created previously and hence you can lose your data.