[postgis-devel] wkb geometry type codes: PostGIS vs OGC

Raven Kopelman raven.kopelman at safe.com
Tue May 4 14:10:31 PDT 2010


Hi PostGIS developers,

I'm working on PostGIS support for Safe Software's FME and have a couple
questions about the way PostGIS does things.

In particular, it looks like the WKB geometry type codes used by PostGIS
don't line up with those specified by the OGC.

For example, from liblwgeom.h:

> #define CURVEPOLYTYPE 13
> #define MULTICURVETYPE 14
> #define MULTISURFACETYPE 15
>

Whereas the OGC has

> CurvePolygon 10
> MultiCurve 11
> MultiSurface 12
> Curve 13
> Surface 14
> PolyhedralSurface 15
>

SQLMM of course offers some completely different alternate choices,
something like:

> CurvePolygon 1000003
> Multicurve 1000004
> Multisurface 1000005
>

which, if I recall the values correctly, have an unexpected (and possibly
coincidental) alignment with the PostGIS choices...

I'm curious about this apparent discrepancy, and what it implies about my
chances of keeping our WKB parser more or less vendor neutral.

And I haven't tested this yet, but I presume that ST_AsBinary() will return
the same PostGIS specific type codes as ST_AsEWKB()?

Thanks,
Raven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20100504/ad7b7da5/attachment.html>


More information about the postgis-devel mailing list