This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from osgeo import gdal, ogr, osr | |
import sys | |
def initFields(in_lyr, out_lyr): | |
#Arbitrarily get the first feature | |
feat = in_lyr[0] | |
#loop over each field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from osgeo import gdal, ogr | |
import sys | |
def multipoly2poly(layer): | |
for feature in layer: | |
fid = feature.GetFID() | |
geom = feature.GetGeometryRef() | |
if geom.GetGeometryName() == 'MULTIPOLYGON': |