[geos-devel] WkbReader and Z-geometries
Oyvind Idland
oyvind.idland at gmail.com
Thu Aug 4 01:46:39 EDT 2011
Oh.. sweet chaos!
The lack of a WKB-spec with Z (and M) ordinates seems to have triggered a
bunch of WKB-flavours, such as
- OGR's "Two-and-a-half-D extensions for Simple Features"
- FDO's FGF-format
- Postgis EWKB
I found the EWKB proposal here, but probably not the latest:
http://postgis.refractions.net/pipermail/postgis-devel/2004-December/000710.html
As far as I can see, it is fairly similar in structure as the SQL/MM, except
for the optional SRID. The object-type ID's are of course not the same.
In addition, SQL/MM specifies CircularString/CurvePolygon/CompundCurve etc
aswell, would be nice to have these implemented in GEOS aswell (PostGIS has
done some work here, not sure what)
I got two versions of the SQL/MM spec in PDF, the earliest (2nd edtion)
dates from 2002. I'll send you the newest right away.
For now, I'll try to make a simple hack on the existing WkbReader.
Would be nice with a more united WKB-world...
-- Oyvind
On Thu, Aug 4, 2011 at 2:24 AM, Martin Davis <mtnclimb at telus.net> wrote:
> **
> The EWKB that JTS and GEOS implement is based on the PostGIS EWKB
> specification (which predates the SQL/MM spec, I think.)
>
> I don't have a good reference for the PostGIS spec - it would be nice if
> there was one online somewhere (hint, hint).
>
> It might be nice if JTS/GEOS supported the SQL/MM spec as well. Do you
> have a reference available for the spec?
>
> Martin
>
>
> On 8/3/2011 4:19 AM, Oyvind Idland wrote:
>
> Hello,
>
> i am trying to read WKB chunks based on the iso SQL/MM part3 spec. However,
> this doesn't seem to work.
>
> From the WkbReader source code doc:
> "This implementation supports the extended WKB standard for representing
> 3-dimensional coordinates. The presence of 3D coordinates is signified by
> setting the high bit of the wkbType word."
>
> Which extended WKB standard is being refered to here ?
>
>
>
> For example, In the SQL/MM spec, various point types are defined as the
> following unsigned values (not hex):
>
> <wkbpoint> 1
> <wkbpointz> 3000001
> <wkbpointzm> 2000001
> <wkbpointm> 4000001
>
> However, in the WkbReader.cpp the following logic is used:
>
> int typeInt = dis.readInt();
> int geometryType = typeInt & 0xff;
> ......
> bool hasZ = ((typeInt & 0x80000000) != 0);
> if (hasZ) inputDimension = 3;
> else inputDimension = 2; // doesn't handle M currently
>
>
>
>
> Is there any plans to implement support for SQL/MM ? (I can volunteer for
> a patch, if desired)
>
>
> -- Oyvind
>
>
> _______________________________________________
> geos-devel mailing listgeos-devel at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/geos-devel
>
>
>
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1390 / Virus Database: 1518/3807 - Release Date: 08/03/11
>
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geos-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geos-devel/attachments/20110804/c5057d27/attachment.html
More information about the geos-devel
mailing list