Skip to content

Commit ae1b813

Browse files
committed
Added more detailed descriptions for Transportation and LevelOfDetail
1 parent 9b0f4f1 commit ae1b813

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

README.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,3 +752,119 @@ async def main():
752752

753753
asyncio.run(main())
754754
```
755+
756+
## Parameter usage examples
757+
758+
### Transportation
759+
760+
In [traveltime.py](https://github.com/traveltime-dev/traveltime-python-sdk/blob/master/traveltimepy/dto/transportation.py)
761+
you can find all implemented transportation types, their sub-parameters and their default values.
762+
763+
These examples don't apply to proto / fast endpoints. For more examples you can always refer to [Unit Tests](https://github.com/traveltime-dev/traveltime-python-sdk/tree/master/tests)
764+
765+
#### Driving
766+
767+
```python
768+
from traveltimepy import Driving
769+
770+
transportation=Driving()
771+
transportation=Driving(disable_border_crossing = True)
772+
```
773+
774+
#### Walking
775+
776+
```python
777+
from traveltimepy import Walking
778+
779+
transportation=Walking()
780+
```
781+
782+
#### Cycling
783+
784+
```python
785+
from traveltimepy import Cycling
786+
787+
transportation=Cycling()
788+
```
789+
790+
#### Ferry
791+
792+
```python
793+
from traveltimepy import Ferry
794+
795+
transportation=Ferry()
796+
transportation=Ferry(type="cycling+ferry")
797+
transportation=Ferry(type="driving+ferry")
798+
transportation=Ferry(type="cycling+ferry", boarding_time = 300)
799+
```
800+
801+
#### DrivingTrain
802+
803+
```python
804+
from traveltimepy import DrivingTrain, MaxChanges
805+
806+
transportation=DrivingTrain()
807+
808+
transportation=DrivingTrain(
809+
pt_change_delay = 300,
810+
driving_time_to_station=1800,
811+
parking_time=800,
812+
walking_time=500,
813+
max_changes=MaxChanges(enabled=True, limit=3)
814+
)
815+
```
816+
817+
#### PublicTransport
818+
819+
```python
820+
from traveltimepy import PublicTransport, MaxChanges
821+
822+
transportation=PublicTransport() # type="public_transport" - any public transport
823+
transportation=PublicTransport(type="train")
824+
transportation=PublicTransport(type="bus")
825+
transportation=PublicTransport(type="coach")
826+
827+
transportation=PublicTransport(
828+
pt_change_delay = 300,
829+
walking_time=500,
830+
max_changes=MaxChanges(enabled=True, limit=3)
831+
)
832+
```
833+
834+
#### CyclingPublicTransport
835+
836+
```python
837+
from traveltimepy import CyclingPublicTransport, MaxChanges
838+
839+
transportation=CyclingPublicTransport()
840+
841+
transportation=CyclingPublicTransport(
842+
walking_time=500,
843+
pt_change_delay = 300,
844+
cycling_time_to_station=300,
845+
parking_time=800,
846+
boarding_time=300,
847+
max_changes=MaxChanges(enabled=True, limit=3)
848+
)
849+
```
850+
851+
### Level of Detail
852+
853+
`level_of_detail` can be used to specify how detailed the isochrone result should be.
854+
855+
For a more detailed description of how to use this parameter, you can refer to our [API Docs](https://docs.traveltime.com/api/reference/isochrones#arrival_searches-level_of_detail)
856+
857+
#### Examples
858+
859+
```python
860+
from traveltimepy import LevelOfDetail
861+
862+
# scale_type "simple"
863+
level_of_detail=LevelOfDetail(scale_type="simple", level="lowest")
864+
865+
# scale_type "simple_numeric"
866+
level_of_detail=LevelOfDetail(scale_type="simple_numeric", level=0)
867+
868+
# scale_type "coarse_grid"
869+
level_of_detail=LevelOfDetail(scale_type="coarse_grid", square_size=600)
870+
```

0 commit comments

Comments
 (0)