[postgis-users] Inserting geometry using ADO...

Jason Sardano jsardano at northgeo.com
Tue Nov 9 09:43:27 PST 2004


I am writing an extension for ESRI's ArcCatalog that will allow a user to
export feature classes to PostGIS. The spatial data is exported as WKT to
PostGIS correctly if and only if the WKT length is less than or equal to the
max varchar size attribute of my connection and the geometry column's length
(the OLE DB driver from Postgresql sees the geometry as text). If I change
the max varchar size property on my connection string to a valid size for
the geometry (greater than 8190), I receive a message box stating "can't
alloc Desc Handle yet"; so simply changing the max varchar size is not a
solution. I also receive an error if I try a raw sql update of the geometry.
Is there a better way to insert spatial data into PostGIS from an OLEDB/ODBC
client?

 

Thank you,

Jason Sardano

 

//Sample ADO Code:

ipRecordset->AddNew();

//.

ipRecordset->put_Collect(CComVariant(shapeFieldName),
CComVariant(ShapeToWKT(ipGeometry, -1))); //ShapeToWKT returns a BSTR

//.

ipRecordset->Update(); //the geometry is saved if it is a valid length,
otherwise a NULL geometry is stored.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20041109/249803e8/attachment.html>


More information about the postgis-users mailing list