Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
736 B
3
Indexable
Never
popdd_final = pd.read_csv('Old/full_pop_with_sal_matched2.csv')

import shapely
from shapely.geometry import shape, Point
import geopandas

salpoppc = pd.read_csv('Old/fullsalpop_with_everything.csv')


filename = "Old/SAL_2021_AUST_GDA2020.geojson"
file = open(filename)
sal2021gj = geopandas.read_file(file)

len(sal2021gj)

salpopall = pd.merge(salpoppc,sal2021gj,left_on='attributes.SAL_NAME_2021',right_on='SAL_NAME21')

salpopall['polygon_geojson'] = salpopall['geometry'].apply(lambda x: shapely.to_geojson(x))

salpopall['polygon_geojson_view'] = salpopall['geometry'].apply(lambda x: shape(x))

popdd_final['Point_to_apply'] = popdd_final.apply(lambda x: Point(x['Longitude_All'],x['Latitude_All']),axis=1)
Leave a Comment