GeoServer Integration
GeoServer is an open source server for geospatial data. It can be integrated with Teiid Spring Boot to serve geospatial data from a variety of sources.
Prerequisites
-
Have GeoServer installed. Teiid Spring Boot integration was initially tested with GeoServer version 2.6.x, and is compatible with versions 2.8.x and 2.12.x. See TEIID-5236
-
Your Teiid Spring Boot installation should already be setup for pg/ODBC access. This allows the built-in compatibility with GeoServer for PostGIS/PostgreSQL to be used.
-
Have a VDB deployed that exposes one or more tables containing an appropriate Geometry column.
-
The Teiid Spring Boot system table GEOMETY_COLUMNS will be used by GeoServer. Please ensure that the relevant geometry columns have the appropriate srid and coord_dimensions, which may require setting the {http://www.teiid.org/translator/spatial/2015}srid and {http://www.teiid.org/translator/spatial/2015}coord_dimension extension property on the geometry column.
-
GeoServer Configuration
This process will need to be repeated for each VDB schema you are exposing that contains geospatial data.
-
Using the GeoServer admin web application, select Stores → Add new Store. Under Vector Data Sources, select PostGIS.
-
Using the non-JNDI connection, fill in the Teiid Spring Boot server host, ODBC port, database (VDB Name with optional version), user, and password, schema (schema/model from the target VDB).
-
If your VDBs contain target schema or table names with % or _, Teiid Spring Boot must be configured to use the same default like escape character '\' as PostgreSQL to properly respond to metadata queries. Either the system property org.teiid.backslashDefaultMatchEscape must be set to true or the Teiid Spring Boot session variable backslashDefaultMatchEscape must be set to true - for example enter "select cast(teiid_session_set('backslashDefaultMatchEscape', true) as boolean)" in the "Session startup SQL" to configure just this GeoServer connection pool.
-
-
Follow the typical GeoServer instructions for creating a Layer based upon the Teiid Spring Boot store.
-
Note that Teiid Spring Boot is not compatible with the PostGIS function ST_Estimated_Extent and attempts to compute the bounding box from the data, result in log errors.
-
Additional Considerations
-
If you are integrating a PostgreSQL source, you must not re-expose the geometry_columns or geography_columns tables. This is because GeoServer makes unqualified queries that reference geometry_columns and the query should resolve against the Teiid Spring Boot system table instead.
-
Teiid Spring Boot does not by default expose a GT_PK_METADATA, which is optionally used by GeoServer