init depot renew
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
import geopandas as gpd
|
||||
from pycen import con_gn, update_to_sql
|
||||
from os import path
|
||||
|
||||
PATH = '/media/cgeier/SRV/FICHIERS'
|
||||
FILE = 'OUTILS/CARTOGRAPHIE/ESPACE DE TRAVAIL/ETUDES/Zones humides/diag_zh_GAM/ZH_Séchilienne/zh_sapey.gpkg'
|
||||
df = (gpd.read_file(path.join(PATH, FILE))
|
||||
.rename(columns={'code_zh':'code'})
|
||||
.rename_geometry('geom'))
|
||||
|
||||
if df.crs.srs.lower() != 'epsg:4326':
|
||||
df = df.to_crs(4326)
|
||||
|
||||
update_to_sql(
|
||||
df[['code','geom']],
|
||||
con_gn,
|
||||
't_zh',
|
||||
'pr_zh',
|
||||
'code'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user