File: polygonize.py

package info (click to toggle)
rasterio 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,732 kB
  • sloc: python: 23,119; sh: 947; makefile: 275; xml: 29
file content (12 lines) | stat: -rw-r--r-- 222 bytes parent folder | download | duplicates (6)
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]
)