def getAsGeoJson(self, session):
        """
        Retrieve the geometry in GeoJSON format.

        This method is a veneer for an SQL query that calls the ``ST_AsGeoJSON()`` function on the geometry column.

        Args:
            session (:mod:`sqlalchemy.orm.session.Session`): SQLAlchemy session object bound to PostGIS enabled database.

        Returns:
            str: GeoJSON string representation of geometry.
        """
        statement = """
                    SELECT ST_AsGeoJSON({0}) AS json
                    FROM {1}
                    WHERE id={2};
                    """.format(self.geometryColumnName,
                               self.tableName,
                               self.id)

        result = session.execute(statement)

        for row in result:
            return row.json
def getAsGeoJson ( self , session ) : statement = """
                    SELECT ST_AsGeoJSON({0}) AS json
                    FROM {1}
                    WHERE id={2};
                    """ . format ( self . geometryColumnName , self . tableName , self . id ) result = session . execute ( statement ) for row in result : return row . json
Retrieve the geometry in GeoJSON format.

        This method is a veneer for an SQL query that calls the ``ST_AsGeoJSON()`` function on the geometry column.

        Args:
            session (:mod:`sqlalchemy.orm.session.Session`): SQLAlchemy session object bound to PostGIS enabled database.

        Returns:
            str: GeoJSON string representation of geometry.