|
5 | 5 | # Should not be importing anything from a specific dialect |
6 | 6 | # from sqlalchemy.dialects.mssql.base import BIT |
7 | 7 |
|
8 | | -from apiCustomType import Geometry |
9 | | -''' |
10 | | -from sqlalchemy.ext.declarative import declarative_base |
| 8 | +# from apiCustomType import Geometry |
11 | 9 |
|
12 | | -Base = declarative_base() |
13 | | -metadata = Base.metadata |
14 | | -''' |
15 | 10 |
|
16 | 11 | from geoalchemy import * |
17 | 12 |
|
@@ -563,17 +558,17 @@ class SamplingFeatures(Base): |
563 | 558 | Elevation_m = Column('elevation_m', Float(53)) |
564 | 559 | ElevationDatumCV = Column('elevationdatumcv', ForeignKey(CVElevationDatum.Name), index=True) |
565 | 560 | #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 |
568 | 563 |
|
569 | 564 |
|
570 | 565 | def __repr__(self): |
571 | 566 | from shapely import wkb |
572 | 567 | return "<SamplingFeatures('%s', '%s', '%s', '%s', '%s')>" % ( |
573 | 568 | self.SamplingFeatureCode, self.SamplingFeatureName, self.SamplingFeatureDescription, |
574 | | - self.Elevation_m, self.FeatureGeometry) |
| 569 | + self.Elevation_m, wkb.loads(str(self.FeatureGeometry.geom_wkb)).wkt if self.FeatureGeometry is not None else None)#self.FeatureGeometry) |
575 | 570 |
|
576 | | -#GeometryDDL(SamplingFeatures.__table__) #Geoalchemy1 |
| 571 | +GeometryDDL(SamplingFeatures.__table__) #Geoalchemy1 |
577 | 572 |
|
578 | 573 | class FeatureActions(Base): |
579 | 574 | __tablename__ = u'featureactions' |
|
0 commit comments