我最近收到了“ValueError: Record does not match collection schema:”
错误。我一直在使用
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'}})
我以为我是从输入文件中提取模式,所以我写的记录应该与原始模式匹配。对?是否有更好的方式与身材匀称?