Example #1
0
    class Geometry(Base):
        """
        The dedicated model for all geometries in relation to their public law restriction.

        Attributes:
            t_id (int): The identifier. This is used in the database only and must not be set manually. If
                you  don't like it - don't care about.
            point (geoalchemy2.types.Geometry): Interlis type: GeometryCHLV95_V1.Coord2
            line (geoalchemy2.types.Geometry): Interlis type: GeometryCHLV95_V1.Line
            surface (geoalchemy2.types.Geometry): Interlis type: GeometryCHLV95_V1.Surface
            law_status (str): The status switch if the document is legally approved or not.
            published_from (datetime.date): The date when the geometry should be available for
                publishing on extracts. This directly affects the behaviour of extract
                generation.
            published_until (datetime.date): The date from when the geometry should not be available
                anymore for publishing on extracts. This directly affects the behaviour of extract
                generation.
            geo_metadata (str): A link to the metadata which this geometry is based on which delivers
                machine  readable response format (XML).
            public_law_restriction_id (str): The foreign key to the public law restriction this geometry
                is related to.
            public_law_restriction (pyramid_oereb.standard.models.land_use_plans
                .PublicLawRestriction): The dedicated relation to the public law restriction instance from
                database.
        """
        __table_args__ = {'schema': schema_name}
        __tablename__ = 'geometrie'
        t_id = Column(pk_type, primary_key=True, autoincrement=False)
        point = Column('punkt',
                       GeoAlchemyGeometry('POINT', srid=srid),
                       nullable=True)
        line = Column('linie',
                      GeoAlchemyGeometry('LINESTRING', srid=srid),
                      nullable=True)
        surface = Column('flaeche',
                         GeoAlchemyGeometry('POLYGON', srid=srid),
                         nullable=True)
        law_status = Column('rechtsstatus', String, nullable=False)
        published_from = Column('publiziertab', Date, nullable=False)
        published_until = Column('publiziertbis', Date, nullable=True)
        geo_metadata = Column('metadatengeobasisdaten', String, nullable=True)
        public_law_restriction_id = Column('eigentumsbeschraenkung',
                                           ForeignKey(
                                               PublicLawRestriction.t_id),
                                           nullable=False)
        public_law_restriction = relationship(PublicLawRestriction,
                                              backref='geometries')
Example #2
0
class Geometry(Base):
    """
    The dedicated model for all geometries in relation to their public law restriction.

    Attributes:
        id (int): The identifier. This is used in the database only and must not be set manually. If
            you  don't like it - don't care about.
        law_status (str): The status switch if the document is legally approved or not.
        published_from (datetime.date): The date when the document should be available for
            publishing on extracts. This  directly affects the behaviour of extract
            generation.
        geo_metadata (str): A link to the metadata which this geometry is based on which delivers
            machine  readable response format (XML).
        public_law_restriction_id (int): The foreign key to the public law restriction this geometry
            is  related to.
        public_law_restriction (pyramid_oereb.standard.models.airports_security_zone_plans
            .PublicLawRestriction): The dedicated relation to the public law restriction instance from
            database.
        office_id (int): The foreign key to the office which is responsible to this public law
            restriction.
        responsible_office (pyramid_oereb.standard.models.airports_security_zone_plans.Office):
            The dedicated relation to the office instance from database.
        geom (geoalchemy2.types.Geometry): The geometry it's self. For type information see
            geoalchemy2_.  .. _geoalchemy2:
            https://geoalchemy-2.readthedocs.io/en/0.2.4/types.html  docs dependent on the
            configured type.  This concrete one is MULTIPOLYGON
    """
    __table_args__ = {'schema': 'airports_security_zone_plans'}
    __tablename__ = 'geometry'
    id = sa.Column(sa.Integer, primary_key=True, autoincrement=False)
    law_status = sa.Column(sa.String, nullable=False)
    published_from = sa.Column(sa.Date, nullable=False)
    geo_metadata = sa.Column(sa.String, nullable=True)  # TODO: Check translation
    geom = sa.Column(GeoAlchemyGeometry('MULTIPOLYGON', srid=srid), nullable=False)
    public_law_restriction_id = sa.Column(
        sa.Integer,
        sa.ForeignKey(PublicLawRestriction.id),
        nullable=False
    )
    public_law_restriction = relationship(
        PublicLawRestriction,
        backref='geometries'
    )
    office_id = sa.Column(
        sa.Integer,
        sa.ForeignKey(Office.id),
        nullable=False
    )
    responsible_office = relationship(Office)
Example #3
0
 class Geometry(base):
     """
     The dedicated model for all geometries in relation to their public law restriction.
     Attributes:
         id (str): The identifier. This is used in the database only and must not be set manually. If
             you  don't like it - don't care about.
         law_status (str): The status switch if the document is legally approved or not.
         published_from (datetime.date): The date when the geometry should be available for
             publishing on extracts. This directly affects the behaviour of extract
             generation.
         published_until (datetime.date): The date from when the geometry should not be available
             anymore for publishing on extracts. This directly affects the behaviour of extract
             generation.
         geo_metadata (str): A link to the metadata which this geometry is based on which delivers
             machine  readable response format (XML).
         public_law_restriction_id (str): The foreign key to the public law restriction this geometry
             is  related to.
         public_law_restriction (PublicLawRestriction): The dedicated relation to the public law
             restriction instance from database.
         geom (geoalchemy2.types.Geometry): The geometry it's self. For type information see
             geoalchemy docs (https://geoalchemy-2.readthedocs.io/en/0.4.2/types.html) dependent on the
             configured type.  This concrete one is LINESTRING
     """
     __table_args__ = {'schema': schema_name}
     __tablename__ = 'geometry'
     id = Column(pk_type, primary_key=True, autoincrement=False)
     law_status = Column(String, nullable=False)
     published_from = Column(Date, nullable=False)
     published_until = Column(Date, nullable=True)
     geo_metadata = Column(String, nullable=True)
     geom = Column(GeoAlchemyGeometry(geometry_type, srid=srid), nullable=False)
     public_law_restriction_id = Column(
         ForeignKey(PublicLawRestriction.id),
         nullable=False
     )
     public_law_restriction = relationship(
         PublicLawRestriction,
         backref='geometries'
     )