Circuit problems with Fiona

I have been getting an error lately "ValueError: Record does not match collection schema:"

. I used

form fiona import collection
form shapely.geometry import mapping, shape 
with collection(path_in, "r") as input:
    schema = input.schema.copy()
    with collection(path_out, "w", "ESRI Shapefile", schema) as output:
        list = []
        for f in input:
            list.append(shape(f['geometry']))
    do stuff with shapely 
    output.write({'geometry': mapping(somethingIDid), 'properties':{'somethingFromSchema':'somethingToMakeThisValid'}})

      

I thought I was extracting the shape of the schema from the input file so that the entries I write match the original schema. Right? Is there a better way to work beautiful?

+3


source to share





All Articles