- Clone this repository
- Navigate to its root directory
- Run
pip install -e .
from travel_regions import TravelRegions
travel_regions = TravelRegions()
The examples section shows how TravelRegions
can be utilized for various use cases.
Results are exported in the form of region files, which are serialized representations, following a standardized structure, of an instance of TravelRegions at a specific hierarchical level.
Four region files for the first four hierarchical levels of the default region
model are already available
in region_files. These are what's used when
TravelRegions
is instantiated without any arguments (default instantiation).
If, however, a region model is provided, i.e.
TravelRegions(region_model="path/to/my_region_model.csv", levels=3)
, then that
region model is used as a point of origin instead. For an example of how the CSV
file representing a region model should be structured, refer to the travel
region
model.
The serialized class representation of any region model can be exported as a region file
for a specific hierarchical level by
calling the export_regions()
method of TravelRegions
.
Travel Regions Visualizer is a simple JavaScript map tool built to interpret region files and visualize them using Leaflet.