Skip to main content

py-geo-nearby Package

This uses geopy package to identify the distance between two geo co-ordinates and arrange it based on the nearest distances.

e.g) Consider the below case,

A is the starting point
Distance between A and B = 3 Kms
Distance between A and C = 2 Kms
Distance between B and C = 3 kms
Distance between B and D = 4 kms
Distance between C and D = 2 kms

All the places ie) B, C and D has to be visited from A. However, the nearest place from A has to be visited first followed by the nearest place from the first visited place and so on..

In the above example,
From A, C is the nearest location.
From C, D is the nearest location.
From D, B is the nearest location.

Therefore the sequence based on nearest distance is A -> C -> D -> B
Total Distance = 2 + 2 + 4 = 8 kms

Installation

pip install geopy
pip install py-geo-nearby

Declare

import py_geo_nearby.py_geo_nearby as pygn

Parameters

Parameter Meaning Sample Values
list python variable containing the list of locations any variable name

NOTE: Each list entry should have exactly 3 values namely latitude, longitude and location Name. The 1st entry of the list will be considered as the starting location.

Usage Example

Code

import py_geo_nearby.py_geo_nearby as pygn

rows = [
 ['12.92509', '80.10087', 'Tambaram,Chennai'],
 ['12.95601', '80.14353', 'Saravana Stores,Chromepet, Chennai'],
 ['12.92264', '80.131151', 'Selaiyur,Chennai'],
 ['12.90885', '80.09903', 'Perungalathur,Chennai'],
 ['12.93675', '80.16917', 'Hasthinapuram, Chennai'],
 ['12.86956', '80.16775', 'Sholinganallur, Chennai'],
 ['12.96829', '80.0962', 'Thirumudivakkam, Chennai']
]
places,totalDistance = pygn.nearby(rows)
print(places,totalDistance)

Output

(['Tambaram,Chennai',
  'Perungalathur,Chennai',
  'Selaiyur,Chennai',
  'Saravana Stores,Chromepet, Chennai',
  'Hasthinapuram, Chennai',
  'Sholinganallur, Chennai',
  'Thirumudivakkam, Chennai'],
 33.881469236248286)

Metadata

Release files for py-geo-nearby 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-geo-nearby 0.0.3
File Size Uploaded Provenance
py_geo_nearby-0.0.3.tar.gz 2.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for py-geo-nearby 0.0.3
File Interpreter ABI Platform
py_geo_nearby-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 4.9 kB

Release files / py_geo_nearby-0.0.3.tar.gz

Download URL py_geo_nearby-0.0.3.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
89b820044d1034b2a875efca15d125e9c726d3d65e2c4c8a52df0aacc67ebc04
BLAKE2b-256 checksum
How to use checksums
b31ac0ace2fa7d0d4bfbc4e3b8e5da315ea544f43f7e065888359b837435270c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release files / py_geo_nearby-0.0.3-py3-none-any.whl

Download URL py_geo_nearby-0.0.3-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6a281bc87a5cea9d8ccd25fe8d999e4c7acdbd84212f849818ae26dd4d2f0af
BLAKE2b-256 checksum
How to use checksums
44620b21187dc4eb0a298faadbc4356b5e658a4b426e895ebb7869ce1b642363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Security for py-geo-nearby 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page