[gdal-dev] Geometry as EWKB (PostGIS)

Even Rouault even.rouault at mines-paris.org
Wed Jun 29 16:29:00 EDT 2011


Le mercredi 29 juin 2011 22:20:27, Paul Ramsey a écrit :
> I'll read closer. Indeed, I see EWKBToGeometry is already there.
> However, I'm pretty sure that feature *creation* still uses WKT, which
> would explain the drift in my round-trip case. So, a different patch
> 
> :) that should not require any guidance about where's and how's.

Yes, when reading, geometries should be returned as EWKB since OGR 1.8.0.

AFAIR, for the writing side, if you use the --config PG_USE_COPY YES 
configuration option (which uses COPY instead of INSERT TO), the geometry will 
be passed as EWKB. But it would be reasonable to use EWKB too.

> 
> Thanks Frank,
> P.
> 
> On Wed, Jun 29, 2011 at 1:04 PM, Frank Warmerdam <warmerdam at pobox.com> 
wrote:
> > On 11-06-29 03:56 PM, Paul Ramsey wrote:
> >> Hi all (Evan!):
> >> 
> >> In my FGDB project, the participants compared a file I generated with
> >> FGDB>PostGIS>FGDB and noticed that the coordinates had drifted a
> >> little in some cases. Turns out, the PostGIS OGR driver using WKT as
> >> the transit format, so that's allowing occasional coordinate drift.
> >> I'd like to write up an EWKB encoder for OGR geometries (or maybe add
> >> an option to the current encoder to generate EWKB?). Could you
> >> recommend whether I should do another big utility method like the
> >> shapeBuffer code, or a method on the OGRGeometry? whether you prefer
> >> an alteration to existing WKB writer or a separate code path?
> >> 
> >> I want to avoid what happened last time, having to re-jig the whole
> >> thing at the end.
> > 
> > Paul,
> > 
> > I think, perhaps, that in trunk and perhaps 1.8.0 EWKB is already used.
> > I based this partly on the following changeset.  I imagine Even will fill
> > in the details.
> > 
> >  http://trac.osgeo.org/gdal/changeset/20697/trunk/gdal/ogr/ogrsf_frmts/pg
> > 
> > Best regards,
> > --
> > ---------------------------------------+---------------------------------
> > ----- I set the clouds in motion - turn up   | Frank Warmerdam,
> > warmerdam at pobox.com
> > light and sound - activate the windows | http://pobox.com/~warmerdam
> > and watch the world go round - Rush    | Geospatial Programmer for Rent
> > 
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list