Vectorized functions for transforming latitude and longitude coordinates to Map Tile coordinates, Map Pixel coordinates or QuadKeys
Project description
Vec_GeoHash
Short Description
Vectorized functions that allow efficient transformation of latitude and longitude coordinates into Map Tile coordinates
, Map Pixel coordinates
or QuadKeys
. This can be particularly useful in (GIS) geographic information systems and mapping applications. By utilizing vectorized functions, transformation can be performed on large datasets, with minimal impact on performance. Additionally, only using numpy as dependency these functions can be easily incorporated into existing code and workflows.
Instalation
The project can be installed using `pip`:
pip install vec_geohash
To install from this repo:
git clone https://github.com/FJakovljevic/vec_geohash.git
cd vec_geohash
pip install -e .
Usage
Vector example
import vec_geohash
lat_vector = [53.1231276599, 41.85]
lon_vector = [82.6978699112, -87.65]
zoom = 9
# getting tiles as [tile_x] vector and [tile_y] vector
vec_geohash.lat_lon_to_tile(lat_vector, lon_vector, zoom)
>>> (array([373, 131]), array([166, 190]))
# getting tiles as [[tile_x, tile_y]] vector
vec_geohash.lat_lon_to_tile(lat_vector, lon_vector, zoom)
>>> array([[373, 166],
[131, 190]])
# getting quadkey
vec_geohash.lat_lon_to_quadkey(lat_vector, lon_vector, zoom)
>>> array(['121310321', '030222231'], dtype='<U9')
# getting pixels as [pixel_x] vector and [pixel_y] vector
vec_geohash.lat_lon_to_pixel(lat_vector, lon_vector, zoom)
>>> (array([95645, 33623]), array([42622, 48729]))
# getting pixels as [[pixel_x, pixel_y]] vector
vec_geohash.lat_lon_to_pixel(lat_vector, lon_vector, zoom)
>>> array([[95645, 42622],
[33623, 48729]])
Scalar example
import vec_geohash
lat = 53.1231276599
lon = 82.6978699112
zoom = 9
# getting tiles
vec_geohash.lat_lon_to_tile(lat, lon, zoom)
>>> (373, 166)
# getting quadkey
vec_geohash.lat_lon_to_quadkey(lat, lon, zoom)
>>> array(['121310321'], dtype='<U9')
# getting pixels
vec_geohash.lat_lon_to_pixel(lat, lon, zoom)
>>> (95645, 42622)
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
Built Distribution
File details
Details for the file vec_geohash-0.0.3.tar.gz
.
File metadata
- Download URL: vec_geohash-0.0.3.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c728662ca3f8a89816d5484a54d4492da35351e2e8d91a622baab6118e6fc09a |
|
MD5 | d17fe646443703daa903cb2d69cf5886 |
|
BLAKE2b-256 | 70d0952fd268fb6a0d8d23cd1b2829dd60d2c9d9897c3f4b39bb7bd9ae3dfff9 |
File details
Details for the file vec_geohash-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: vec_geohash-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | caaea64f689b780f00358969507e97d2215200884c4b5000cbc7e65e0ad27ec0 |
|
MD5 | 3de2ff1d79c97f73897f43bddb985acf |
|
BLAKE2b-256 | ddb6245e81639a8e567913d2b9e8a5cc9bbbf998a8ea4d8fb1615ab59df3e3c5 |