Skip to main content

A Python package for geospatial distance calculations and proximity-related functions.

Project description

GeoProximity Package Usage Guide

Introduction

GeoProximity is a Python package designed to facilitate geospatial distance calculations, point projections, and related operations. It includes functions for both Haversine distance (great-circle distance) and Euclidean distance calculations. GeoProximity is suitable for applications that require proximity analysis, spatial operations, and basic geospatial functionality.

Installation

Ensure Python is installed on your system, then install the geoproximity package using pip:

pip install geoproximity

Calculate harversine distance

import geoproximity
geoproximity.haversine_distance(coord1, coord2)

It returns the haversine distance between two points in km.

Find the nearest neighbor from the list of coordinates to the referece point

geoproximity.nearest_neighbor(reference_point, coordinates_list)

It returns a tuple containing the nearest point and distance of the nearest point from the reference point in km.

Example:

reference_point = (37.7749, -122.4194)
other_points = [(34.0522, -118.2437), (40.7128, -74.0060), (41.8781, -87.6298)]

nearest_point, min_distance = geoproximity.nearest_neighbor(reference_point, other_points)

Calculate the area of a polygon

geoproximity.calculate_polygon_area(polygon_geojson)

We need to pass the polygon geojson as a parameter to the calculate_polygon_area function. It returns the area of the polygon in square km.

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

geoproximity-0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

geoproximity-0.1-py3-none-any.whl (4.6 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