Repository navigation
Description
Add the EWKT decoding strategy and spatial reference support
As a user of the spatial decoder,
I want to decode Extended Well-Known Text (EWKT) representations,
so that geometries containing PostGIS spatial reference information can be
converted into the corresponding spatial objects.
Context
PostGIS EWKT extends Well-Known Text with spatial reference information using
an SRID=<value>; prefix.
The decoder already provides WKT decoding and a lexer shared between WKT and
EWKT capable of recognizing SRID tokens. The EWKT strategy should reuse this
existing infrastructure rather than duplicate WKT parsing behavior.
An SRID is optional in EWKT. Spatial objects require an SRID and use 0 by
default. Consequently, an EWKT representation without an explicit SRID must
behave like the equivalent WKT representation and produce a spatial object
with SRID 0.
The SRID prefix belongs to the root EWKT geometry. Nested geometries do not
carry independent SRID prefixes.
Acceptance Criteria
- An EWKT decoding strategy implementing
DecoderStrategyInterfaceis
available. - The EWKT strategy uses the lexer infrastructure shared with the WKT
strategy. - An EWKT representation prefixed with
SRID=<value>;is decoded into the
correspondingSpatialInterface. - The SRID declared by the EWKT prefix is preserved in the resulting
spatial object. - An EWKT representation without an SRID prefix is accepted.
- When the SRID prefix is absent, the resulting spatial object uses SRID
0, consistently with WKT decoding and the default behavior of
spatial-types. - The SRID prefix is accepted only for the root geometry and is rejected
when used on a nested geometry. - Existing WKT decoding behavior is reused where the EWKT syntax does not
introduce EWKT-specific information. - Invalid SRID or EWKT syntax is reported through the decoder exception
model. - Existing WKT decoding behavior remains unchanged.
- Automated tests cover EWKT decoding with an explicit SRID, without an
explicit SRID, and invalid SRID placement.
References
- PostGIS
ST_GeomFromEWKTdocumentation. - PostGIS
liblwgeomEWKT lexer and parser. - OGC Simple Feature Access for the underlying WKT geometry syntax.
- ISO/IEC 13249-3 for the underlying spatial geometry model and WKT semantics
where applicable.
Activity
[-]Add the EWKT decoding strategy and spatial reference support[/-][+]Story: Add the EWKT decoding strategy and spatial reference support[/+]