Utility for image and math related operation in GIS
Project description
py-gis-utility
A GIS utility library which contains some regularly required math and image operations.
Installation
pip install git+https://github.com/fuzailpalnak/py-gis-utility.git#egg=py_gis_utility
Requirements
- Geopandas - installation
- Rasterio - installation
- GDAL 2.4.4 - installation
- Fiona - installation
- Shapely - installation
Math Operations
- Get perpendicular point with reference to start and end point of the segment
- Get perpendicular distance from point to line_segment
- Given a Point find a new point at an given 'angle' with given 'distance'
- Calculate a new point on the line segment given the distance from the start
- Euclidean computation
Image Operations
- Generate bitmap from shape file
from py_gis_utility.helper import (
read_data_frame,
save_image_with_geo_transform,
)
from py_gis_utility.image_func import shape_geometry_to_bitmap_from_data_frame_generator
data_frame = read_data_frame(r"path_to_geometry_file")
bitmap_gen = shape_geometry_to_bitmap_from_data_frame_generator(data_frame, (50, 50), (1, 1),
allow_output_to_overlap=True)
for i, bitmap in enumerate(bitmap_gen):
save_image_with_geo_transform(f"{i}.tiff", bitmap.array, bitmap.transform)
- Generate shape geometry from geo reference bitmap
from py_gis_utility.helper import (read_image_with_geo_transform,
)
from py_gis_utility.image_func import image_obj_to_coordinates_generator, image_obj_to_shape_generator
img_obj = read_image_with_geo_transform(r"path_to_geo_referenced_file")
# output in format {'geometry': <shapely.geometry.polygon.Polygon object at 0x0000022009E5EC08>, 'properties': {'id': 255.0, 'crs': CRS.from_epsg(4326)}}
shape_gen = image_obj_to_shape_generator(img_obj)
for g in shape_gen:
print(g)
# output in format {'geometry': {'type': 'Polygon', 'coordinates': [[(621000.0, 3349500.0), .... ,(621000.0, 3349489.5)]]}, 'properties': {'id': 255.0, 'crs': CRS.from_epsg(4326)}}
co_ord_gen = image_obj_to_coordinates_generator(img_obj)
for g in co_ord_gen:
print(g)
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
py-gis-utility-0.1.0.tar.gz
(11.4 kB
view details)
Built Distribution
File details
Details for the file py-gis-utility-0.1.0.tar.gz
.
File metadata
- Download URL: py-gis-utility-0.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf96f177e916a20b492e0ba3b1041a84076d48d9780358f8932398c141f255b5 |
|
MD5 | 125bc96d1f57f541b8254d8c92a09c3a |
|
BLAKE2b-256 | 784987c5a95d1d67718328446b4d8333e5a5c1d0086e6a0a760d2b328fa6e3aa |
File details
Details for the file py_gis_utility-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: py_gis_utility-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d71beff9741bc2e7b5a7cca4ff395a20d54215940dd5afbd1f19606f05ccb1f |
|
MD5 | 2d9d0b9f490280d056223ea8577fce6a |
|
BLAKE2b-256 | 729aeb54c7b58a6b97b54adef70ada148eb973c47a9be687664bef8af6394d93 |