There are two organizations producing spatial standards of particular importance, the ISO (International Organization for Standardization) and OGC (Open GIS Consortium).
OGC provides a wide range of Standards and Specifications. The OGC Simple Features Interface Standard (SFS) is specially important. It provides a well-defined and common way for applications to store and access feature data in relational or object-relational databases. There are three versions of this Standard, though the first two ones are deprecated.
Table 4.1. OGC SFS Standards
Version | Document Title | Document |
---|---|---|
1.1 | OpenGIS Simple Features Implementation Specification for SQL | 99-049 |
1.1.0 | OpenGIS Implementation Specification for Geographic information - Simple feature access | 05-134 |
1.2.0 | OpenGIS Implementation Specification for Geographic information - Simple feature access - Part 2: SQL option | 06-104r3 |
The 1.2.0 specification, appeared in 2006, develops the previous specifications to support "Z" and "M" (measure) coordinates.
OGC Specifications can be found in:
The ISO/IEC 13249 SQL Multi-Media and Application Packages standard is specially important. This standard, known as SQL/MM, is divided in the following parts:
Part 1: Framework
Part 2: Full-Text
Part 3: Spatial
Part 5: Still Image
Part 6: Data Mining
SQL/MM- Part 3 standardizes spatial types and routines to store, manage and retrieve spatial data using SQL.
In the chapter JASPA Reference, a definition of each function can be found. It includes the section of the spatial standards that are implemented. For instance, the method ST_Area implements the following standard methods:
Table 4.2. Spatial Standards Support
OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
---|---|---|---|
2.1.9.1 | 7.2.14.1 | 7.2.12.2 | 8.1.2 - 9.5.3 |
There are several differences between the spatial specifications and the implementation in JASPA.
Each spatial feature has a spatial reference identifier (SRID). The default SRID for geometry instances in the SQL-MM standard is 0, whereas in JASPA the default value is -1.
In the following example JASPA sets the ST_GeomCollection SRID to -1, instead of 0 (zero) as stated in SQL-MM. It it done to keep PostGIS compatibility.
SELECT ST_SRID(ST_GeomCollFromText('GEOMETRYCOLLECTION(POINT (5 5))')); st_srid --------- -1 (1 row)
The return type of boolean methods (e.g. ST_IsValid, ST_IsClosed, ST_Crosses ...) in JASPA differs from the spatial specifications.
Returns 1 if TRUE, 0 if FALSE or NULL
Returns "t" if TRUE, "f" if FALSE, null if the Geometry is NULL.
Returns "TRUE" if TRUE, "FALSE" if FALSE, null if the Geometry is NULL.
(1) SELECT ST_IsValid(ST_GeomFromText('POINT (0 0 )')); --JASPA for PostgreSQL st_isvalid ------------ t (1 row) --JASPA for H2 TRUE (2) SELECT ST_IsClosed(ST_GeomFromText('POINT EMPTY')); --JASPA for PostgreSQL st_isclosed ------------- (1 row) --JASPA for H2 null