ใช้rasterioของ Sean Gillies สามารถใช้ร่วมกับฟิโอน่าได้อย่างง่ายดาย(อ่านและเขียนรูปร่างไฟล์) และหุ่นดีของผู้เขียนคนเดียวกัน
ในสคริปต์rasterio_polygonize.py
จุดเริ่มต้นคือ
import rasterio
from rasterio.features import shapes
mask = None
with rasterio.drivers():
    with rasterio.open('a_raster') as src:
        image = src.read(1) # first band
        results = (
        {'properties': {'raster_val': v}, 'geometry': s}
        for i, (s, v) 
        in enumerate(
            shapes(image, mask=mask, transform=src.affine)))
ผลลัพธ์คือตัวกำเนิดของคุณสมบัติ GeoJSON
 geoms = list(results)
 # first feature
 print geoms[0]
 {'geometry': {'type': 'Polygon', 'coordinates': [[(202086.577, 90534.3504440678), (202086.577, 90498.96207), (202121.96537406777, 90498.96207), (202121.96537406777, 90534.3504440678), (202086.577, 90534.3504440678)]]}, 'properties': {'raster_val': 170.52000427246094}}
ที่คุณสามารถแปลงร่างเป็นรูปทรงที่ดี
from shapely.geometry import shape
print shape(geoms[0]['geometry'])
POLYGON ((202086.577 90534.35044406779, 202086.577 90498.96206999999, 202121.9653740678 90498.96206999999, 202121.9653740678 90534.35044406779, 202086.577 90534.35044406779))
สร้างฐานข้อมูล Geopandas และเปิดใช้งานฟังก์ชันการเข้าร่วมเชิงพื้นที่การพล็อตการบันทึกเป็น geojson, รูปร่างไฟล์ ESRI เป็นต้น
geoms = list(results)
import geopandas as gp
gpd_polygonized_raster  = gp.GeoDataFrame.from_features(geoms)