[fdo-dev] [Proposal] FGF<->WKB converters as common utils

Gavin Cramer gavin.cramer at autodesk.com
Tue Aug 8 17:36:51 EDT 2006


Ah, sorry about that.  I guess that I did not see Geometry.c and
Geometry.h as meriting collection into a common spot because they are so
small.  If it were just that, fdocore/trunk/Utilities/Common would
indeed be a good place for providers to use.  There is also the
GisSpatial package, though that's a DLL currently.  However, there is
more:

 - the MySQL RDBI driver is in fact compiled as C++;
   If there were no other factors, one could probably
   just call FdoGeometry directly

 - The MySQL driver's WkbFromGeometry() contains part of a
   workaround for a MySQL oddity:  the inclusion
   of a 4-byte SRID (unused) in the byte stream.  
   The other part is in fix_geometries() in fetch.c.  So,
   just refactoring Geometry.c would not give the right results
   for other providers; more variations are required.  It is so 
   little code that copying it is probably the better way.

BTW, I did some searching with Google on PostGIS and WKB, and found
various discussions of whether PostGIS is using OGC WKB or a variation.
Do you know the current status?

Gavin

-----Original Message-----
From: Mateusz Loskot [mailto:mateusz at loskot.net] 
Sent: Tuesday, August 08, 2006 5:16 PM
To: dev at fdo.osgeo.org
Subject: Re: [fdo-dev] [Proposal] FGF<->WKB converters as common utils

Gavin Cramer wrote:
> Those functions are part of the FDO SDK.  Any provider can use them,
> as well as any client.
> 
> Excluding the factory, FdoGeometry is a pure API too -- one can even 
> re-implement it to be a wrapper around any other geometry package,
> and just call FdoGeometryFactoryAbstract::CreateGeometry(FdoIGeometry
> * geometry) to do all conversions.  Note that FdoFgfGeometryFactory 
> extends the non-FGF-specific FdoGeometryFactoryAbstract, and that all
>  FGF-specific methods are in that one FdoFgfGeometryFactory class.

Gavin,

Excause me, but I think there is some misunderstanding.
The purpose of FdoGeometry and FdoFgfGeometryFactory APIs
is clear for me.

I'm talking about GeometryFromWkb() and WkbFromGeometry()
functions (which are not a part of the SDK and public API) from:

fdordbms/trunk/Providers/GenericRdbms/Src/MySQL/Driver/Geometry.h
fdordbms/trunk/Providers/GenericRdbms/Src/MySQL/Driver/Geometry.c

I'm working on PostGIS provider and I need exactly the same functions.
So, there are two options:
1) copy Geometry.c and Geometry.h to the PostGIS provider directory
fdordbms/trunk/Providers/GenericRdbms/Src/PostGIS/Driver
2) copy Geometry.c and Geometry.h to some common place for all providers


The second possibility is IMHO the best because of code reuse practice
and to not to keep *the same* code in more than one places.

That was just an idea, and I'd not want to start long discussion about
such a trivial thing :-)
So, I'll just keep my own copy of Geometry.h and Geometry.c files

Best regards
-- 
Mateusz Loskot
http://mateusz.loskot.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at fdo.osgeo.org
For additional commands, e-mail: dev-help at fdo.osgeo.org






More information about the Fdo-internals mailing list