SDE Shape -> FGDB Shape using ByteArray

2967
2
07-18-2013 03:18 PM
CharlesTilly
New Contributor III
Is is possible to use the ByteArray class to populate a SHAPE column using a Byte[] obtained from an SDE SHAPE column using the st_asbinary function?

What I would like to do is fetch a feature from an SDE db (using SQL) and then write that feature into a FGDB, but I'd like to see if I can use the ByteArray class or something similar.

I can't find anything in the way of examples or even good documentation on use of the ByteArray so I'd be interested in hearing from peoples' different experiences with it.

Regards!
2 Replies
DavidSousa
New Contributor III
When you want to insert or update a shape column using the FileGDB API, you must use one of the ShapeBuffer helper classes when you call the Row::SetGeometry function.  You should not use the ByteArray class. 

We ship sample programs which illustrate the use of the several of the ShapeBuffer derived classes.  There is also extensive documentation of the shape buffer format included with the API.  It is critically important that you understand the shape buffer format.  This is essentially the same format as the shape buffers used in shape files, but with some Geodatabase extensions (e.g., curves, multipatches, etc.).

The API does not provide a way to directly use or convert other shape buffer formats to that which is required by the API.
0 Kudos
CharlesTilly
New Contributor III
Thanks David.  I'm using the ShapeBuffer classes already but the ByteArray just seems so appealing because it looks like it would be a nice way to quickly move data from SDE to FGDB without the overhead of deconstructing the geometry and then reconstructing it prior to inserting it.
0 Kudos