[geos-devel] WKB representation is EWKB, not OGC

Paul Ramsey pramsey at cleverelephant.ca
Thu Dec 5 11:52:39 PST 2013


That thread includes a (dead) link to the (approved) OGC change that
added PostGIS-style 2.5 D handling of WKB
(http://lists.osgeo.org/pipermail/postgis-devel/2004-December/000695.html)

Unfortunately, that change was promptly thrown down the memory hole,
and when the time came to go 3d OGC instead adopted the ISO "add a few
thousand" scheme for 2.5 D WKB types instead of the PostGIS "flip the
high bit" approach.

P.

On Thu, Dec 5, 2013 at 1:40 AM, Mike Toews <mwtoews at gmail.com> wrote:
> Ok, the WKB Reader/Writer APIs make sense from the perspective of a
> 2D-only OGC spec, which is when they were written. I think the GEOS
> documentation just needs to be a bit more clear
> http://trac.osgeo.org/geos/ticket/677
>
> Yeah, it would be wise if WKBReader could parse the OGC WKB too (sort
> of http://trac.osgeo.org/geos/ticket/466), as PostGIS does via
> ST_AsBinary or even ST_AsEWKT with a warning. The WKBWriter could also
> add an option to emit OGC-spec outputs, but that's just getting fancy.
> I'm not aware of anyone actually reading/writing non-2D WKB with GEOS
> that would benefit from this, but you never know.
>
> GEOS correctly parses EWKB 3D-M and 4D-ZM geometries, but completely
> ignores the M value (http://trac.osgeo.org/geos/ticket/460). Note that
> the WKT reader also reads 3D-M geometries, but misinterprets M as Z,
> which is different than the behaviour with WKB, which just makes a 2D
> geometry http://trac.osgeo.org/geos/ticket/676
>
> Great backgrounder from 9 years ago here:
> http://lists.osgeo.org/pipermail/postgis-devel/2004-December/000694.html
>
> -Mike
>
> On 5 December 2013 18:38, Paul Ramsey <pramsey at cleverelephant.ca> wrote:
>> Right, at the time JTS/GEOS came into being, the only standard WKB was
>> 2D WKB, so from an interop point of view, it was golden.
>>
>> It might be time to update the reader to ingest more variants, and the
>> writer to emit ISO standard 3D/4D variants. That would imply also
>> updating the WKT writer and reader, etc, etc. And how about an M
>> coordinate? :)
>>
>> P.
>>
>> On Wed, Dec 4, 2013 at 8:51 PM, Martin Davis <mtnclimb at telus.net> wrote:
>>> The JTS doc for the WKBReader says:
>>>
>>> "It also partially handles the Extended WKB format used by PostGIS".
>>>
>>> My recollection is that at the time JTS was original developed, the OGC SFS
>>> spec was at version 1.1 (99-049), and did not specify 3D support for WKB.
>>> PostGIS extended the spec to allow this - but when the OGC got around to
>>> specifying it, it did so in a different way. Hence the discrepancy.
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel


More information about the geos-devel mailing list