Skip to main content

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.

crop area

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:

crop area

If you want more details see the notebook available in examples/

Best regards

Geovanny

Release files for region-grow 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for region-grow 1.0.4
File Size Uploaded
region_grow-1.0.4.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for region-grow 1.0.4
File Interpreter ABI Platform
region_grow-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / region_grow-1.0.4.tar.gz

Download URL region_grow-1.0.4.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1d3f3c176fb02abad1bd94efca101e7c14898d9f258fd8a337184c8bac6bc097
BLAKE2b-256 checksum
How to use checksums
ad8f2bdf010eec2f8ac07a1f522fcbef0980af86e318bfbde9be29f7cb67d1b3
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / region_grow-1.0.4-py3-none-any.whl

Download URL region_grow-1.0.4-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e3d3a45cec441acda6fc5029a0f0416f2ddd6b5b6a328013910a6a92cb7165d
BLAKE2b-256 checksum
How to use checksums
1720ff55e78543e99579474aa1c88009586d7cbadb80ed9baa7e607020ebfd59
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page