Geometric Object Base¶
The GeometricObject
provides common methods for generating visualizations for geometry type objects. All
objects that contain geometry fields inherit from this base class.
-
class
gsshapy.base.
GeometricObjectBase
[source]¶ Abstract base class for geometric objects.
-
tableName
= None¶ Name of the table that the geometry column belongs to
-
id
= None¶ ID of the record with the geometry column in the table that will be retrieved
-
geometryColumnName
= None¶ Name of the geometry column
-
getAsKml
(session)[source]¶ Retrieve the geometry in KML format.
This method is a veneer for an SQL query that calls the
ST_AsKml()
function on the geometry column.Parameters: session ( sqlalchemy.orm.session.Session
) – SQLAlchemy session object bound to PostGIS enabled database.Returns: KML string representation of geometry. Return type: str
-
getAsWkt
(session)[source]¶ Retrieve the geometry in Well Known Text format.
This method is a veneer for an SQL query that calls the
ST_AsText()
function on the geometry column.Parameters: session ( sqlalchemy.orm.session.Session
) – SQLAlchemy session object bound to PostGIS enabled database.Returns: Well Known Text string representation of geometry. Return type: str
-
getAsGeoJson
(session)[source]¶ 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.Parameters: session ( sqlalchemy.orm.session.Session
) – SQLAlchemy session object bound to PostGIS enabled database.Returns: GeoJSON string representation of geometry. Return type: str
-
getSpatialReferenceId
(session)[source]¶ Retrieve the spatial reference id by which the geometry column is registered.
This method is a veneer for an SQL query that calls the
ST_SRID()
function on the geometry column.Parameters: session ( sqlalchemy.orm.session.Session
) – SQLAlchemy session object bound to PostGIS enabled database.Returns: PostGIS spatial reference ID. Return type: str
-