Skip to main content

amarillo-stops

Carpool stop import library with shared code for Amarillo GTFS-generator and Enhancer. Provides stop import functions in multiple formats and the StopsStore class with a couple of function to manage and query the stops.

Supported import formats

Import stops from:

.csv:

Example format:

stop_id;stop_code;stop_lat;stop_lon;stop_name
mfdz:x;x;52.11901;14.2;Stop x
mfdz:y;y;53.1;14.01;Stop y
mfdz:z;z;54.11;14.0;Stop z
mfdz:Ang001;Ang001;53.11901;14.015776;Mitfahrbank Biesenbrow

GeoJSON:

Example format:

{
  "data": {
    "pointsOfInterest": [
      {
        "id": "14622",
        "externalId": "bbnavi:12073:0001",
        "name": "Parkbank",
        "description": "Parkbank",
        "dataProvider": {
          "id": "1",
          "name": "Administrator"
        },
        "addresses": [
          {
            "street": "Hauptstrasse",
            "city": "Wittenberge",
            "zip": "12345",
            "geoLocation": {
              "latitude": 52.9932971109789,
              "longitude": 11.767383582547
            }
          }
        ],
        "openStreetMap": {
          "capacity": 112,
          "capacityCharging": "2",
          "capacityDisabled": "",
          "fee": "No",
          "lit": "Yes",
          "parking": "",
          "shelter": "No",
          "surface": "",
          "utilization": "",
          "website": ""
        }
      }
    ]
  }
}

Overpass

Makes a request to https://overpass-api.de/api/interpreter with the query below and imports the result:

[out:csv(::"type", ::"id", ::"lat", ::"lon", name,parking,park_ride,operator,access,lit,fee,capacity,"capacity:disabled",supervised,surface,covered,maxstay,opening_hours)][timeout:60];
area{area_selector}->.a;
nwr(area.a)[park_ride][park_ride!=no][access!=customers];
out center;

GTFS

Opens stops.txt inside the zip file and imports it as .csv

StopsStore class

Constructor parameters:

  • stop_sources: array of stop source urls. Can point to local or remote resources. vicinity controls how far from the trip path they can still be associated with a trip. Example:
[
    {"url": "https://datahub.bbnavi.de/export/rideshare_points.geojson", "vicinity": 50},
    {"url": "https://data.mfdz.de/mfdz/stops/stops_zhv.csv", "vicinity": 50},
    {"url": "https://data.mfdz.de/mfdz/stops/parkings_osm.csv", "vicinity": 500}
]
  • internal_projection: optionally override the used projection. Default value is EPSG:32632.

load_stop_sources(self): Imports stops from stop_sources and registers them with the distance they are still associated with a trip. E.g. bus stops should be registered with a distance of e.g. 30m, while larger carpool parkings might be registered with e.g. 500m.

Subsequent calls of load_stop_sources will reload all stop_sources but replace the current stops only if all stops could be loaded successfully.

find_additional_stops_around(self, line, stops): Returns a GeoDataFrame with all stops in vicinity of the given line, sorted by distance from origin of the line. Note: for internal projection/distance calculations, the lat/lon geometries of line and stops are converted to

find_closest_stop(self, carpool_stop, max_search_distance): Returns the closest stop to the given carpool stop, searching within the max_search_distance

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amarillo_stops-2.0.0.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amarillo_stops-2.0.0-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file amarillo_stops-2.0.0.tar.gz.

File metadata

  • Download URL: amarillo_stops-2.0.0.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.2

File hashes

Hashes for amarillo_stops-2.0.0.tar.gz
Algorithm Hash digest
SHA256 04e3a8ff3a31f801e45498d5c58b5f5db0cadac295f78b815ff245acb5a36580
MD5 48d6b564e0b4305bef1be04beb330031
BLAKE2b-256 0c3e5a7690bcbd31c442ece81d954dac8b3e32682c272422b0ded4995de0b1a7

See more details on using hashes here.

File details

Details for the file amarillo_stops-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: amarillo_stops-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.2

File hashes

Hashes for amarillo_stops-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66b97fc8d5a54263beff6d6e4f94c30c61ac4e6a53f7ec584e96e6282913a45e
MD5 030105ab97581158b26398ead4fe510c
BLAKE2b-256 ab0bd5749664d2991b60d921358320cb66c35b1d6e51c2089821b42a41060a6a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page