gtfs_kit 2.0.0__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/PKG-INFO +1 -1
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/__init__.py +1 -1
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/cleaners.py +4 -1
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/trips.py +19 -16
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/pyproject.toml +1 -1
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/setup.py +1 -1
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/LICENSE.txt +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/README.rst +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/calendar.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/constants.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/feed.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/helpers.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/miscellany.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/routes.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/shapes.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/stop_times.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/stops.py +0 -0
- {gtfs_kit-2.0.0 → gtfs_kit-2.1.0}/gtfs_kit/validators.py +0 -0
|
@@ -255,7 +255,10 @@ def aggregate_stops(
|
|
|
255
255
|
nid_by_oid.update(d)
|
|
256
256
|
i += 1
|
|
257
257
|
|
|
258
|
-
stops["stop_id"] = stops.stop_id.map(
|
|
258
|
+
stops["stop_id"] = stops.stop_id.map(nid_by_oid)
|
|
259
|
+
if "parent_station" in stops:
|
|
260
|
+
stops["parent_station"] = stops.parent_station.map(nid_by_oid)
|
|
261
|
+
|
|
259
262
|
stops = stops.groupby(by).first().reset_index()
|
|
260
263
|
feed.stops = stops
|
|
261
264
|
|
|
@@ -485,11 +485,15 @@ def map_trips(
|
|
|
485
485
|
color_palette: List[str] = cs.COLORS_SET2,
|
|
486
486
|
*,
|
|
487
487
|
include_stops: bool = False,
|
|
488
|
+
include_arrows: bool = False,
|
|
488
489
|
):
|
|
489
490
|
"""
|
|
490
491
|
Return a Folium map showing the given trips and (optionally)
|
|
491
492
|
their stops.
|
|
492
493
|
If any of the given trip IDs are not found in the feed, then raise a ValueError.
|
|
494
|
+
If ``include_arrows``, then use the Folium plugin PolyLineTextPath to draw arrows
|
|
495
|
+
on each trip polyline indicating its direction of travel; this fails to work in some
|
|
496
|
+
browsers, such as Brave 0.68.132.
|
|
493
497
|
"""
|
|
494
498
|
# Initialize map
|
|
495
499
|
my_map = fl.Map(tiles="cartodbpositron")
|
|
@@ -504,6 +508,7 @@ def map_trips(
|
|
|
504
508
|
# Create a feature group for each route and add it to the map
|
|
505
509
|
for i, trip_id in enumerate(trip_ids):
|
|
506
510
|
collection = trips_to_geojson(feed, [trip_id], include_stops=include_stops)
|
|
511
|
+
|
|
507
512
|
group = fl.FeatureGroup(name=f"Trip {trip_id}")
|
|
508
513
|
color = colors[i]
|
|
509
514
|
|
|
@@ -524,26 +529,24 @@ def map_trips(
|
|
|
524
529
|
|
|
525
530
|
# Add trip
|
|
526
531
|
else:
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
style_function=lambda x: {"color": x["properties"]["color"]},
|
|
532
|
+
path = fl.PolyLine(
|
|
533
|
+
[[x[1], x[0]] for x in f["geometry"]["coordinates"]],
|
|
534
|
+
color=color,
|
|
535
|
+
popup=hp.make_html(prop),
|
|
532
536
|
)
|
|
533
|
-
|
|
537
|
+
|
|
534
538
|
path.add_to(group)
|
|
535
539
|
bboxes.append(sg.box(*sg.shape(f["geometry"]).bounds))
|
|
536
540
|
|
|
537
|
-
#
|
|
538
|
-
#
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
# ).add_to(group)
|
|
541
|
+
# Direction arrows, assuming, as GTFS does, that
|
|
542
|
+
# trip direction equals LineString direction
|
|
543
|
+
fp.PolyLineTextPath(
|
|
544
|
+
path,
|
|
545
|
+
" \u27A4 ",
|
|
546
|
+
repeat=True,
|
|
547
|
+
offset=5.5,
|
|
548
|
+
attributes={"fill": color, "font-size": "18"},
|
|
549
|
+
).add_to(group)
|
|
547
550
|
|
|
548
551
|
group.add_to(my_map)
|
|
549
552
|
|
|
@@ -19,7 +19,7 @@ install_requires = \
|
|
|
19
19
|
|
|
20
20
|
setup_kwargs = {
|
|
21
21
|
'name': 'gtfs-kit',
|
|
22
|
-
'version': '2.
|
|
22
|
+
'version': '2.1.0',
|
|
23
23
|
'description': 'A Python 3.6+ library for analyzing GTFS feeds.',
|
|
24
24
|
'long_description': 'GTFS Kit\n********\n.. image:: https://travis-ci.org/mrcagney/gtfs_kit.svg?branch=master\n :target: https://travis-ci.org/mrcagney/gtfs_kit\n\nGTFS Kit is a Python 3.6+ kit for analyzing `General Transit Feed Specification (GTFS) <https://en.wikipedia.org/wiki/GTFS>`_ data in memory without a database.\nIt uses Pandas and Shapely to do the heavy lifting.\n\nThis project supersedes `GTFSTK <https://github.com/mrcagney/gtfstk>`_.\n\n\nInstallation\n=============\n``pip install gtfs_kit``.\n\n\nExamples\n========\nYou can play with ``ipynb/examples.ipynb`` in a Jupyter notebook.\n\n\nAuthors\n=========\n- Alex Raichev, 2019-09\n\n\nDocumentation\n=============\nOn Github Pages `here <https://mrcagney.github.io/gtfs_kit_docs>`_.\n\n\nNotes\n=====\n- Development status is Alpha\n- This project uses semantic versioning\n- Thanks to `MRCagney <http://www.mrcagney.com/>`_ for donating to this project\n- Constructive feedback and code contributions welcome. Please issue pull requests into the ``develop`` branch and include tests.\n',
|
|
25
25
|
'author': 'Alex Raichev',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|