thinkingmachines / geowrangler

🌏 A python package for wrangling geospatial datasets
https://geowrangler.thinkingmachin.es/
MIT License
48 stars 15 forks source link

Create module for converting vector to raster mask #180

Closed tm-abby-moreno closed 2 years ago

tm-abby-moreno commented 2 years ago

This PR addresses the issue: #170

This PR adds a new module called vector_to_raster_mask.py with 2 functions: _explode and generate_mask. The core function is the generate_mask and _explode is just an internal helper function. This function converts vectors into rasters where each pixel is a numerical representation of a feature in the vector data. The intended use is to convert vector annotations into raster labels/masks that align with satellite images.

User will need to provide a reference raster image (for this PR we used a TIF image for now), a shapefile that contains the area of the raster image and this shapefile must have a column/feature that contains labels/categories. They must also provide a dictionary of their desired labels and values to be added to the masks.

Other updates:

review-notebook-app[bot] commented 2 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

butchtm commented 2 years ago

hi @tm-abby-moreno

I forgot to add - can I request you to add the files