add geom to maj

This commit is contained in:
Colas Geier 2025-09-22 10:11:08 +02:00
parent 2833ff1a3a
commit 5bc595ace0

View File

@ -7,11 +7,15 @@ PATH = '/home/colas/Documents/9_PROJETS/1_ZH/2024/CARTO/Couches SIG'
FILE = 'ZH_zh DDT 2024_MJ_modif 2025.shp' FILE = 'ZH_zh DDT 2024_MJ_modif 2025.shp'
df = (gpd.read_file(path.join(PATH, FILE)) df = (gpd.read_file(path.join(PATH, FILE))
.rename(columns={'Code ZH':'code','date':'update_date'})) .rename(columns={'Code ZH':'code','date':'update_date'})
.rename_geometry('geom')
)
df.geom = df.geom.buffer(0).to_crs(4326)
df['update_author'] = 24 # 24 = Mathieu Juton df['update_author'] = 24 # 24 = Mathieu Juton
update_to_sql( update_to_sql(
df[['code','update_author', 'update_date']], df[['code','update_author', 'update_date','geom']],
con_gn, con_gn,
't_zh', 't_zh',
'pr_zh', 'pr_zh',