Skip to content

Commit df7fe56

Browse files
authored
Merge pull request OSGeo#12716 from geographika/gtfs-examples
Doc: Add GTFS examples
1 parent 3facaa4 commit df7fe56

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

doc/source/drivers/vector/gtfs.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,65 @@ Driver capabilities
3939

4040
.. supports_virtualio::
4141

42+
Examples
43+
--------
44+
45+
List the contents of a GTFS local zip file:
46+
47+
.. tabs::
48+
49+
.. code-tab:: bash
50+
51+
ogrinfo GTFS_Realtime.zip
52+
53+
.. code-tab:: bash gdal CLI
54+
55+
gdal vector info GTFS_Realtime.zip
56+
57+
List the contents of a GTFS local directory:
58+
59+
.. tabs::
60+
61+
.. code-tab:: bash
62+
63+
# specifying the driver
64+
ogrinfo GTFS:"/data/GTFS_Realtime"
65+
# specifying the input format
66+
ogrinfo /data/GTFS_Realtime -if GTFS
67+
68+
.. code-tab:: bash gdal CLI
69+
70+
# specifying the driver
71+
gdal vector info GTFS:"/data/GTFS_Realtime"
72+
# specifying the input format
73+
gdal vector info /data/GTFS_Realtime --input-format GTFS
74+
75+
List the contents of a GTFS file at a URL:
76+
77+
.. tabs::
78+
79+
.. code-tab:: bash
80+
81+
ogrinfo /vsicurl/https://www.transportforireland.ie/transitData/Data/GTFS_Realtime.zip
82+
83+
.. code-tab:: bash gdal CLI
84+
85+
gdal vector info /vsicurl/https://www.transportforireland.ie/transitData/Data/GTFS_Realtime.zip
86+
87+
Extract the stops from the GTFS file and save into a FlatGeobuf file:
88+
89+
.. tabs::
90+
91+
.. code-tab:: bash
92+
93+
ogr2ogr stops.fgb GTFS_Realtime.zip stops
94+
95+
.. code-tab:: bash gdal CLI
96+
97+
gdal vector convert GTFS_Realtime.zip stops.fgb --input-layer stops
4298

4399
Links
44100
-----
45101

46102
- `GTFS Wikipedia page <https://en.wikipedia.org/wiki/GTFS>`__
103+
- `GTFS.org <https://gtfs.org>`__

0 commit comments

Comments
 (0)