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
coords = RandomCoord(<lomgitude>,<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(-87,40).randomize_coords()
>>> coords.lng
-86.9997771932092
>>> coords.lat
40.00013474729262
Code borrowed from Stack Exchange answer: here, answer by haakon-d.
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.3.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for cluster_coords-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b949f889cc690ba0bd94b993ca7d3146f474d3af6cfd089eae9301bbc63792 |
|
MD5 | 52f65d1b8970d77f3b2dd38f97cef552 |
|
BLAKE2b-256 | a363d6f5384db4c11ef33f1e7cfea031e42e1ecad772f35406edc4475413e23e |