File: polygonize.py

package info (click to toggle)
rasterio 1.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 22,744 kB
  • sloc: python: 22,881; sh: 795; makefile: 275; xml: 29
file content (12 lines) | stat: -rw-r--r-- 222 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
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]
)