Fix issue with layer def
This commit is contained in:
parent
d08e40d579
commit
53c2e359da
3 changed files with 5 additions and 5 deletions
|
@ -30,6 +30,7 @@ dependencies = [
|
||||||
"plotly>=5.20.0",
|
"plotly>=5.20.0",
|
||||||
"matplotlib>=3.8.3",
|
"matplotlib>=3.8.3",
|
||||||
"aiopath>=0.6.11",
|
"aiopath>=0.6.11",
|
||||||
|
"psycopg2-binary>=2.9.9",
|
||||||
]
|
]
|
||||||
requires-python = ">=3.11,<4"
|
requires-python = ">=3.11,<4"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
__version__: str = '2023.4.dev63+g52e1d21.d20240408'
|
__version__: str = '2023.4.dev68+gd08e40d.d20240420'
|
|
@ -19,7 +19,6 @@ from sqlmodel.ext.asyncio.session import AsyncSession
|
||||||
from sqlalchemy import BigInteger, String, func, and_, text
|
from sqlalchemy import BigInteger, String, func, and_, text
|
||||||
from sqlalchemy.sql import sqltypes
|
from sqlalchemy.sql import sqltypes
|
||||||
from sqlalchemy.orm import declared_attr
|
from sqlalchemy.orm import declared_attr
|
||||||
from psycopg import adapt
|
|
||||||
from geoalchemy2.shape import from_shape
|
from geoalchemy2.shape import from_shape
|
||||||
from geoalchemy2.types import Geometry, WKBElement
|
from geoalchemy2.types import Geometry, WKBElement
|
||||||
from shapely import wkb, from_wkb
|
from shapely import wkb, from_wkb
|
||||||
|
@ -237,7 +236,7 @@ class SurveyModel(BaseSurveyModel):
|
||||||
FROM (
|
FROM (
|
||||||
SELECT f.geom,
|
SELECT f.geom,
|
||||||
f.id::varchar,
|
f.id::varchar,
|
||||||
{description} || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || f.id as popup,
|
'{description}' || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || f.id as popup,
|
||||||
f.status
|
f.status
|
||||||
FROM "{schema}"."{table}" as f
|
FROM "{schema}"."{table}" as f
|
||||||
WHERE f.geom is not null
|
WHERE f.geom is not null
|
||||||
|
@ -258,7 +257,7 @@ class SurveyModel(BaseSurveyModel):
|
||||||
'geometry', ST_AsGeoJSON(geom)::jsonb,
|
'geometry', ST_AsGeoJSON(geom)::jsonb,
|
||||||
'properties', jsonb_build_object(
|
'properties', jsonb_build_object(
|
||||||
'popup',
|
'popup',
|
||||||
{description} || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || inputs.id::varchar,
|
'{description}' || ' [' || '{category.group}' || '-' || '{category.minor_group_1}' || '] #' || inputs.id::varchar,
|
||||||
'status', status
|
'status', status
|
||||||
)
|
)
|
||||||
) AS feature
|
) AS feature
|
||||||
|
@ -277,7 +276,7 @@ class SurveyModel(BaseSurveyModel):
|
||||||
#table=cls.__tablename__,
|
#table=cls.__tablename__,
|
||||||
# FIXME: should be __tablename__, but see SQLModel.__tablename__ which use lower(__name__)
|
# FIXME: should be __tablename__, but see SQLModel.__tablename__ which use lower(__name__)
|
||||||
table=cls.__name__,
|
table=cls.__name__,
|
||||||
description=adapt(category.description),
|
description=category.description,
|
||||||
)
|
)
|
||||||
result = await session.exec(text(query))
|
result = await session.exec(text(query))
|
||||||
return result.first()[0]
|
return result.first()[0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue