[postgis-users] Fast access to PostGIS from c/c++

Boehm, Andreas boehm at rif.fuedo.de
Tue Dec 5 03:25:36 PST 2006


Hi!

Evaluating the possibilities of using PostGIS instead of ArcSDE, I'm
looking for a fast solution to insert and read points and polygons to
PostGIS from my c++ code.

I have tried several approaches with libpqxx. The only way to insert
points is executing a statement with WNT like "INSERT INTO points VALUES
(1, GeometryFromText('POINT (10 20)', -1) )". Either the tabelwriter
functionality (internally using COPY) nor predefined statements ("INSERT
INTO points VALUES ($1, GeometryFromText('POINT ($2 $3)', -1)" do work.

I assume the only possibility to communicate with PostgreSQL / PostGIS
is using SQL and strings. Every number is converted into a string and
later - on the other side - back into a number. You have to convert
geometries via GeometryFromText() or AsText() or X().

There seems to be a binary interface for ArcSDE. So I wonder if PostGIS
would be fast enough. Could it make sense to convert geometries into WKB
by myself on client side?

Regards,
Andi




More information about the postgis-users mailing list