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

Paul Ramsey pramsey at cleverelephant.ca
Tue May 4 14:19:00 PDT 2010


Raven,

The WKB emitted by PostGIS will use the standard OGC type codes. The
internal structure of PostGIS will use its own type codes. Even the
EWKB emitted by PostGIS will use the OGC type codes. So your parser
shouldn't know/care what values we have in liblwgeom.h

Yours,

Paul

On Tue, May 4, 2010 at 2:10 PM, Raven Kopelman <raven.kopelman at safe.com> wrote:
> 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
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
>



More information about the postgis-devel mailing list