rasterio/examples/polygonize.py
2015-07-27 21:02:45 -07:00

13 lines
222 B
Python

import pprint
import rasterio
from rasterio.features import shapes
with rasterio.open('tests/data/shade.tif') as src:
image = src.read(1)
# Print the first two shapes...
pprint.pprint(
list(shapes(image))[:2]
)