Skip to main content

An easy-to-use Python package that annotate location data with semantic labels from OpenStreetMap

Project description

location_annotation_with_openstreetmap

Easy-to-use python package for annotating location data with OpenStreetMap Point-of-interest tags

The SemanticAnnotator class aims to annotate location data using geofabrik database created by geofabrik_database.py.

There are three annotation methods: 1. annotate_single_point(lat, lon): annotate single point with semantic labels from OpenStreetMap database. - pro: return distances to all POI types - con: time-consuming (~1 hours/point). Method 3 is recommended for batch of points. 2. annotate_single_shape(lat_list, lon_list): annotate single shape (e.g., bounding box, polygon) with semantic labels from OpenStreetMap database. - pro: most accurate method - con: need a set of points define the query shape 3. annotate_batch_points(dataframe, latitude_colname, longitude_colname): annotate a batch of points (usually centroids of places) with semantic labels from OpenStreetMap database. - pro: fastest method. Fit for annotating many centroids of places simultaneously. - con: just return the label of the nearest POI and the distance.

This script uses the geodf and dist functions from the GPS2space package (https://gps2space.readthedocs.io/en/latest/).

Intall

pip install osm_annotation

Example of Method 1

Project details


Download files

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

Source Distribution

osm_annotation-0.1.0.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

osm_annotation-0.1.0-py3-none-any.whl (10.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page