Select to view content in your preferred language

Best way to import 11 million points from XYZ file into SDE

10-02-2015 04:36 AM
New Contributor

Hi Everyone,

I'm currently writing a tool that imports data directly into an SDE database. It can manage to import a number of different datasets from shape files to DGN CAD Drawings but I also have to manage large (11 million points in one XYZ file) XYZ files and that's the problem. I can create a table and featureclass from the data using IXYEventSource etc and it is pretty quick, even with 11 million points, memory doesn't appear too bad either.

The problem now is I need to push this data into a versioned SDE table, ideally as a point collection.

So I use the IXYEventSource interface to open and create a featureClass and after a bit it's fine and I pass it onto another class that pushes data to SDE.

I thought of using EnumFeatureGeometry to bind to the geometry of the FeatureClass and IGeometryFactory.CreateGeometryFromEnumerator to create the geometry that I can then geotransform and push into the SDE table but, since it's so large, I get a out of memery exception when I try and create the geometry from the enumerator.

Here's the code -

EnumFeatureGeometry enumFeature = new EnumFeatureGeometryClass();
IEnumGeometryBind enumGeomBind = (IEnumGeometryBind)enumFeature;
enumGeomBind.BindGeometrySource(qFilter, pointCollection);
IGeometryFactory geomFactory = new GeometryEnvironmentClass();
IGeometry geom = geomFactory.CreateGeometryFromEnumerator(enumFeature);

With smaller datasets it works as I would hope. I suppose I could break down the XYZ file into smaller sizes but I'm lazy and I'd rather do it all in one go if it's possible. I think it should be but I'm missing something.

Can anyone please help?



0 Kudos
0 Replies