OtherGeoObjects

class soika.src.geocoder.city_objects_extractor.OtherGeoObjects[исходный код]
static calculate_centroid(geometry) Point[исходный код]

Calculates the centroid for polygons.

static combine_city_obj(df_obj) DataFrame[исходный код]

Combines the found named urban objects and urban objects whose names are in the form of numbers.

static expand_toponym(df_obj) DataFrame[исходный код]

Splits the list of found entities into different rows for further analysis.

static extract_geo_obj(text, morph=None, extractor=None) List[str][исходный код]

Extracts location entities from the text using the Natasha library.

static find_geo_obj_tag(toponym, osm_combined_df) str[исходный код]

Finds the geo_obj_tag in the OSM array by the name of the city object.

static find_geometry(toponym, osm_combined_df) Point[исходный код]

Finds the coordinate in the OSM array by the name of the city object.

static find_num_city_obj(text) List[str][исходный код]

This function searches for urban objects in the text, the names of which are represented as a number. For example, «school No. 6».

static get_and_process_osm_data(osm_id: int, tags: dict) DataFrame[исходный код]

Retrieves and processes OSM data for different urban objects.

static get_unique_part_types(df)[исходный код]
static restoration_of_normal_form(other_geo_obj, osm_combined_df, threshold=0.7) List[str][исходный код]

This function compares the extracted location entity with an OSM array and returns a normalized form if the percentage of similarity is at least 70%.

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

Launches the module for extracting urban objects from texts that do not relate to streets.

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

Collects dataframes with OSM spatial data, finds centroids and combines them into one.