AnsweredAssumed Answered

IEnumLasPoint - Reading into array

Question asked by geonetadmin on Jun 5, 2013
Latest reply on Nov 26, 2013 by geonetadmin
Original User: gmcquat

I cannot retrieve more than a single point from a Las point enumerator. The Next() method definition says that the enumerator can retrieve several points into an array. However, the accepted parameter type is WKSPointZ, not an array.

IEnumLasPoint.Next() method "populates an array of WKSPointZs, optional arrays of 0-based file indices and 1-based point IDs."

[C#]public void Next (
    int arraySize,
    ref int pPointCount,
    ref WKSPointZ pPoints,
    ref ILongArray pIntensity,
    ref ILongArray pFileIndices,
    ref IDoubleArray pPointIDs);

Where "pPoints is an array of WKSPointZ. Points are retrieved into it. It must be pre-allocated. It's size must be at least as large as arraySize."

// Create and initialize an array of WKSPointZ:
WKSPointZ[] pPoints = new WKSPointZ[10]; // Passing this array of WKSPointZ gives an invalid type error.

WKSPointZ point = new WKSPointZ(); // BUT if I pass in this single WKSPointZ it works!

// The method call using the single point instead of the array.
lasenum.Next(1, out pPointCount, out point, null, null, null); // The first parameter (1) should be (10) if attempting to pass in the pre-allocated array.

Also notice that the Next() definition says ref whereas intellisense tells me that the method wants an out.

I would really like to be able to read in more than a point at a time. Any help appreciated.