[CG] : add read gn.t_zh
This commit is contained in:
parent
d038d4c1a1
commit
aadf7313b6
3
pycen/geonature/__init__.py
Normal file
3
pycen/geonature/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
22
pycen/geonature/pr_zh.py
Normal file
22
pycen/geonature/pr_zh.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
|
||||
def __read_gn__(sql,code):
|
||||
from ..params import con_gn
|
||||
from geopandas import read_postgis
|
||||
return read_postgis(
|
||||
sql,con_gn,
|
||||
params={'code': tuple(code)} if code else None
|
||||
)
|
||||
|
||||
|
||||
def t_zh(code:str|list=None):
|
||||
sql = 'SELECT * FROM pr_zh.t_zh'
|
||||
if code:
|
||||
sql += ' WHERE code IN %(code)s'
|
||||
return __read_gn__(sql,code)
|
||||
|
||||
def v_synthese_for_export():
|
||||
sql = 'SELECT * FROM gn_synthes.v_synthese_for_export'
|
||||
return __read_gn__(sql)
|
||||
Loading…
x
Reference in New Issue
Block a user