Skip to content

Commit 9d92d38

Browse files
author
sreeder
committed
change model to use geoalchemy
1 parent d16b7ec commit 9d92d38

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/api/ODM2/models.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@
55
# Should not be importing anything from a specific dialect
66
# from sqlalchemy.dialects.mssql.base import BIT
77

8-
from apiCustomType import Geometry
9-
'''
10-
from sqlalchemy.ext.declarative import declarative_base
8+
# from apiCustomType import Geometry
119

12-
Base = declarative_base()
13-
metadata = Base.metadata
14-
'''
1510

16-
#from geoalchemy import *
11+
from geoalchemy import *
1712

1813
#from base import modelBase as Base
1914

@@ -563,8 +558,8 @@ class SamplingFeatures(Base):
563558
Elevation_m = Column('elevation_m', Float(53))
564559
ElevationDatumCV = Column('elevationdatumcv', ForeignKey(CVElevationDatum.Name), index=True)
565560
#FeatureGeometry = Column('featuregeometry', Geometry) # Geoalchemy 2
566-
#FeatureGeometry = GeometryColumn('featuregeometry', Point) #Geoalchemy 1, #wkb.loads(str(self.FeatureGeometry.geom_wkb)).wkt if self.FeatureGeometry is not None else None
567-
FeatureGeometry = Column('featuregeometry', BLOB)# custom geometry queries
561+
FeatureGeometry = GeometryColumn('featuregeometry', Point) #Geoalchemy 1, #wkb.loads(str(self.FeatureGeometry.geom_wkb)).wkt if self.FeatureGeometry is not None else None
562+
# FeatureGeometry = Column('featuregeometry', BLOB)# custom geometry queries
568563

569564

570565
def __repr__(self):
@@ -573,7 +568,7 @@ def __repr__(self):
573568
self.SamplingFeatureCode, self.SamplingFeatureName, self.SamplingFeatureDescription,
574569
self.Elevation_m, self.FeatureGeometry)
575570

576-
#GeometryDDL(SamplingFeatures.__table__) #Geoalchemy1
571+
GeometryDDL(SamplingFeatures.__table__) #Geoalchemy1
577572

578573
class FeatureActions(Base):
579574
__tablename__ = u'featureactions'

0 commit comments

Comments
 (0)