Skip to main content

Build cluster from multiple identical longitude and latitude coordinates

Project description

Cluster Coordinates

Given a longitude, and latitude, cluster_coords will create a new latitude and longitude randomly placing it anywhere between 5 and 25 meters from the original longitude and latitude. This is helpful when adding points to a map, you don't want to add a point directly on top of another point, so this module helps you create a cluster.

from cluster_coords import RandomCoord

longitude=-82.562800
latitude=27.488960

coords = RandomCoord(longitude,latitude).randomize_coords()
new_lat = coords.lat
new_lng = coords.lng

Installation

pip install cluster_coords

[sonnyparlin@localhost cluster_coords]$ python
Python 3.9.1 (default, Jan 20 2021, 00:00:00) 
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cluster_coords import RandomCoord
>>> coords=RandomCoord(-82.562800,27.488960).randomize_coords()
>>> coords.lng
-82.56268860928326
>>> coords.lat
27.489076780986935

Code borrowed from Stack Exchange answer: here, answer by haakon-d.

This project is open source and is located here.

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

cluster_coords-0.0.7.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

cluster_coords-0.0.7-py3-none-any.whl (3.9 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