Creates a new polygon locally given a set of points using a region grow algorithm approach and a satellite image in GeoTIFF format. The polygon output format is ESRI Shapefile
Project description
Region Grow
Creates a polygon using a set of points from a region of interest by grouping pixels whose spectral reflectance is similar. The polygons are created using a satellite image in GeoTIFF format. In this project several algorithms are implemented to build this figure. Among them are: Selection by similarity threshold (%), Euclidean distance and selection by confidence interval. The generated polygon is exported in ESRI Shapefile format.
Installation
You can install this package from PyPi.
pip install region-grow
Create a new polygon
Today, we are going to calculate a polygon for a sugar cane crop located in Boyaca, Colombia. The input data is a set of points near to the crop and the main goal is to find the mininum polygon which covers all the crop area only using a little number of the given examples and a satellite image. The satellite image is a 3 band raster of a Sentinel 2A scene. The bands we use are: Band 11 (Short Wave Infrared - I), Band 8 (Near Infrared) and Band 2 (Blue). The cell resolution is 10m X 10m per pixel. For band 11 we made a resampling process using a bilinear transformation.
The given points were taken at the sugar cane crop borders. Near to this crop we have other crops like yucca and corn and non crops areas like native forest. The blue area is the sugar cane area, manually delimited, we want to achieve. The pink area is the corn corp, the yellov the yucca crop and the orange area is the native forest. The green points are the points given and the red one is the first.
Finally, let's execute the algorithm to calculate this polygon. In this time, we will use the similarity threshold. This algorithm only use the first given point and expands the region scanning the 8-neighbors of the pixel. The pixel is chosen only if the refrectancy is on the +- range of reflectancy of the given point. When the the aproximately area is given. The algorithm recalculates the polygon minimizing the difference
rg.execute_with_area(
points_path=points_path,
raster_path=raster_path,
shape_path=shape_path,
classifier_tag="BD",
)
The result is:
If you want more details see the notebook available in examples/
Best regards
Geovanny
Project details
Release history Release notifications | RSS feed
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 region_grow-1.0.4.tar.gz
.
File metadata
- Download URL: region_grow-1.0.4.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d3f3c176fb02abad1bd94efca101e7c14898d9f258fd8a337184c8bac6bc097 |
|
MD5 | 2137b54a0959e2aef66b7ef5e6e0439e |
|
BLAKE2b-256 | ad8f2bdf010eec2f8ac07a1f522fcbef0980af86e318bfbde9be29f7cb67d1b3 |
File details
Details for the file region_grow-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: region_grow-1.0.4-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e3d3a45cec441acda6fc5029a0f0416f2ddd6b5b6a328013910a6a92cb7165d |
|
MD5 | 1f41c8972b09c9564b28e952b845ab7b |
|
BLAKE2b-256 | 1720ff55e78543e99579474aa1c88009586d7cbadb80ed9baa7e607020ebfd59 |