Helper functions to convert geo coords to pixel coords and back.
Project description
echo1-geopix
Installation
pip install echo1-geopix
Getting Started
from loguru import logger
from echo1_geopix.echo1_geopix import (
geo_point_2_pix_point,
geo_box_2_pixel_box,
pixel_point_2_geo_point,
pixel_box_2_geo_box,
)
x_min = 0.35596034
y_min = 0.94408214
x_max = 0.4102673
y_max = 0.9986186
top = 19.013473367825767
bottom = 19.003535899073533
left = -98.27081680297852
right = -98.26036944570143
##
# pixel_point_2_geo_point
##
tmp_geo_coords = pixel_point_2_geo_point(left, right, top, bottom, x_min, y_min)
logger.debug("pixel_point_2_geo_point: {}".format(tmp_geo_coords))
##
# geo_point_2_pix_point
##
tmp_pixel_coords = geo_point_2_pix_point(
left, right, top, bottom, tmp_geo_coords["lon"], tmp_geo_coords["lat"]
)
logger.debug("geo_point_2_pix_point: {}".format(tmp_pixel_coords))
##
# pixel_box_2_geo_box
##
tmp_geo_box = pixel_box_2_geo_box(
x_min, y_min, x_max, y_max, left, right, top, bottom
)
##
# geo_box_2_pixel_box
##
temp_pixel_box = geo_box_2_pixel_box(
tmp_geo_box["lon_min"],
tmp_geo_box["lat_min"],
tmp_geo_box["lon_max"],
tmp_geo_box["lat_max"],
left,
right,
top,
bottom,
)
logger.debug("geo_box_2_pixel_box: {}".format(temp_pixel_box))
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
echo1-geopix-0.1.2.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for echo1_geopix-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c92c0ad30743f563bdbc3836702b833270372d4842a10caeede4b8a2f07351ed |
|
MD5 | 71dcfebe3d6b5e91c9586f68cf4a2d4e |
|
BLAKE2b-256 | eea563dca076a344ef6ea5b6aee210a8e496bf1d7a53e4b714e4520e33e09aa3 |