Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

IEnumLasPoint - Reading into array

$
0
0
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.
pPoints.Initialize();

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.

Viewing all articles
Browse latest Browse all 1374

Trending Articles