Streets

A class for working with street data.

class soika.src.utils.data_getter.street_getter.Streets[исходный код]

This class encapsulates functionality for retrieving street data for a specified city from OSM and processing it to extract useful information for geocoding purposes.

static clear_names(streets_df: DataFrame) DataFrame[исходный код]

This function pre-process the street names from the OSM. This step is necessary to match recognised street addresses later. We need to do this match because Nominatim is very sensitive geocoder and requires almost exact match between addresses in the OSM database and the geocoding address.

static drop_words_from_name(x: str) str[исходный код]

This function drops parts of street names that are not the name of the street (e.g. avenue).

static find_toponim_words_from_name(x: str) str[исходный код]

A method to find toponim words from the given name string.

Параметры:

x (str) – The input name string.

Результат:

The found toponim word from the input name string, or None if not found.

Тип результата:

str

static get_street_names(gdf: GeoDataFrame) DataFrame[исходный код]

Method extracts the unique street names from a GeoDataFrame of street segments.

static run(osm_id: int) DataFrame[исходный код]

A static method to run the process of getting street data based on the given OSM id, returning a pandas DataFrame.