aequilibrae.project.network.osm package#

Submodules#

aequilibrae.project.network.osm.model_area_gridding module#

aequilibrae.project.network.osm.model_area_gridding.geometry_grid(model_area, srid) GeoDataFrame[source]#

aequilibrae.project.network.osm.osm_builder module#

class aequilibrae.project.network.osm.osm_builder.OSMBuilder(data, project, model_area: Polygon, clean: bool)[source]#

Bases: WorkerThread

building#
doWork()[source]#
importing_network(conn)[source]#

aequilibrae.project.network.osm.osm_downloader module#

” Large portions of this code were adopted from OSMNx, by Geoff Boeing.

Although attempts to use OSMNx were made (including refactoring its entire code base as a contribution to that package), it became clear that its integration with libraries not available with QGIS’ Python distribution was too tight, and was therefore not practical to detach them in order to use OSMNx as a dependency or submodule

For the original work, please see gboeing/osmnx

class aequilibrae.project.network.osm.osm_downloader.OSMDownloader(polygons: List[Polygon], modes, logger: Logger | None = None)[source]#

Bases: WorkerThread

downloading#
doWork()[source]#
overpass_request(data, pause_duration=None, timeout=180, error_pause_duration=None)[source]#

Send a request to the Overpass API via HTTP POST and return the JSON response.

Arguments:

data**(:obj:`dict` or `OrderedDict`): key-value pairs of parameters to post to the API **pause_duration (int): how long to pause in seconds before requests, if None, will query API status endpoint to find when next slot is available timeout (int): the timeout interval for the requests library **error_pause_duration**(int): how long to pause in seconds before re-trying requests if error

Returns:

dict

get_osm_filter(modes: list) str[source]#

loosely adapted from http://www.github.com/gboeing/osmnx

aequilibrae.project.network.osm.osm_params module#

aequilibrae.project.network.osm.place_getter module#

aequilibrae.project.network.osm.place_getter.placegetter(place: str) Tuple[None | List[float], list][source]#

Send a request to the Nominatim API via HTTP GET and return a geometry polygon for the region we are querying

Parameters:
  • place (str) – Name of the place we want to download a network for

  • http (Adapted from) –

Module contents#