- add geometry observations (without csearch_path in model.py)

This commit is contained in:
Arno Kaimbacher 2022-04-07 11:24:43 +02:00
parent 5b78dede0b
commit 86c3c6eb32
3 changed files with 22 additions and 21 deletions

View file

@ -34,7 +34,7 @@ def create_pg_session() -> sessionmaker:
db_url = os.environ.get("POSTGIS_DBURL")
engine = create_engine(
"postgresql+psycopg2://" + db_user + ":" + db_password + "@" + db_url,
connect_args={'options': f'-csearch_path={dbschema}'},
# connect_args={'options': f'-csearch_path={dbschema}'},
isolation_level="READ UNCOMMITTED")
session_maker = sessionmaker(bind=engine)
_session = session_maker()
@ -190,7 +190,7 @@ class Observation(Base):
value_identifier = Column('value_identifier', String)
value_quantity = Column('value_quantity', Numeric(20, 10), nullable=True)
value_text = Column('value_text', String, nullable=True)
value_geometry = Column(Geometry(geometry_type='POLYGON', srid=4326, dimension=3), nullable=True)
value_geometry = Column(Geometry(geometry_type='POINTZ', srid=4326, dimension=3), nullable=True)
fk_dataset_id = Column(Integer, ForeignKey(
'gba.dataset.dataset_id'), nullable=False)