Skip to main content

Python library to calculate accurate distance between Point A and Point B in a given context or setup. It currently supports only geo-spatial distances and euclidean distances

Project description

Description

This package helps to calculate spatial and euclidean distance between two points of interest, say Point A and Point B.

How to Use

For calculating Geo spatial distance between two points in space.

Inputs : Latitude and Longitude pairs for Point A and Point B. Output : distance in meters between the two sets of coordinates

from pointa_to_pointb import geo_distance

longA = 52.370216
latA = 4.895168
longB = 52.520008
latB = 13.404954

geometrical_distance = geo_distance.haversine(longA, latA, longB, latB)
print(geometrical_distance)

For calculating Geo spatial distance between two bounding boxes.

Inputs : Bounding box coordinates (top left and bottom right) for for Point A and Point B pairs . Output : nanhattan distance inbetween the two sets of coordinates representing two bounding boxes

from pointa_to_pointb import bbox_distance

bbox1 = (20, 21, 25, 18)
bbox2 = (55, 55, 100, 10)

manh_distance = bbox_distance.manhanttan_distance(bbox1, bbox2)
print(manh_distance)

gap_distance = bbox_distance.gap_distance(bbox1, bbox2)
print(gap_distance)

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

pointa-to-pointb-0.1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pointa_to_pointb-0.1.0-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file pointa-to-pointb-0.1.0.tar.gz.

File metadata

  • Download URL: pointa-to-pointb-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pointa-to-pointb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab278fdf187b8b80c562caf03aea76cfa6f46acd5b50156e849021497c7ff729
MD5 9a117ae4a6b7d6dcb04dd50323e1fbdb
BLAKE2b-256 36ac95cebdfa7274d1d1139fc9a4e16d54b2396439510cfe5dce77999fd94951

See more details on using hashes here.

File details

Details for the file pointa_to_pointb-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pointa_to_pointb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 516127a9b9a3c2a212583d915a11aa73c1ea372324498b3145a84f9aed73c0ce
MD5 37570332662a2e7629b2024300fa22f3
BLAKE2b-256 78c8c41b4a338aafd8dea3cf7f50d579af9bfdee352f1a0aaadae5632ba6935d

See more details on using hashes here.

Supported by

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