0

使用 fiona.open("../data/shapefiles/Census_2011/2011_Dist.shx") 作为 fiona_collection:

dict_censuscodes = {}
fiona_collections_list = list(fiona_collection)

for i in range(0,len(df_pop)):
    x = df_pop.x.iloc[i]
    y = df_pop.y.iloc[i]
    guid = df_pop.guid.iloc[i]

    point = Point(y, x)

    for shapefile_record in fiona_collections_list:
        if point.within(shape(shapefile_record['geometry'])):
            dict_censuscodes[str(guid)]=shapefile_record['properties']['censuscode']
4

0 回答 0