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

Mateusz Loskot mateusz at loskot.net
Tue Aug 8 18:04:02 EDT 2006


Gavin Cramer wrote:
> 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.

Gavin,

No problem.

> If it were just that, fdocore/trunk/Utilities/Common would indeed be 
> a good place for providers to use.

Yes, I think so.
So, if anyone from FDO maintainers has similar opinion, then could you
try to move it there :-)

> 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++;

Yes, I've noticed that Rdbi are .c files but the code is a mixture
of C and C++.
At the moment, I'm fighting with Rdbi driver for PostGIS and I'm trying
to follow Rdbi conventions.

>    If there were no other factors, one could probably
>    just call FdoGeometry directly

Hmm, I'm not sure I understand.
What do you mean as "no other factors"?
Are you trying to say Rdbi layer is/should not be a mandatory
layer for RDBMS FDO providers to implement or what?

>  - 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.

Obviously, I've forgot about this SRID stuff in MySQL.
So, you're definitely right about copying Geometry.* files.

> 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?

Currently, PostGIS supports two variations of WKB or better,
standard OGC WKB (http://postgis.refractions.net/docs/ch04.html#id2522740)
and its variation EWKB
(http://postgis.refractions.net/docs/ch04.html#id2522847).
So, every WKB stream is a valid EWKB stream, but not (always) the other
way, just like every ISO C program is a valid ISO C++, but also
not the other way :-)
I don't know about existence of tiny pitfalls between those formats.

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




More information about the Fdo-internals mailing list