[pdal] Simple filter aborts.

Peder Axensten Peder.Axensten at slu.se
Wed Dec 2 04:51:39 PST 2020


I’m trying to implement a filter. The principle is fairly simple (see below). First I access all points in “view_" to set up local variables and then I copy points that fulfil certain criteria to “points". Could it be easier? 😀

Both variants runs well on OS X, but not in Ubuntu 20.10 under Docker.
I use pdal 2.1.0 on both platforms.

Both variant aborts with:
malloc(): mismatching next->prev_size (unsorted)
But at different places.


Is there a better (correct) principle of doing this?
Am I constructing “points” in the correct way?
What pdal filter do you recommend I take a good look at to better understand the principles?
Why do the variants abort at different locations?

Any hints are welcome!


=========

// Variant 1.
PointViewPtr Remove_overlap::run( PointViewPtr view_ ) {

for( PointId idx = 0; idx < view_->size(); ++idx ) {
// Set up stuff, read-accessing all points in view_
}

PointViewPtr points{ view_->makeNew() }; // Aborts here.
for( PointId idx = 0; idx < view_->size(); ++idx ) {
if( is_ok( view_, idx ) )
points->appendPoint( *view_, idx );
}

return points;
}


// Variant 2.
PointViewPtr Remove_overlap::run( PointViewPtr view_ ) {
PointViewPtr points{ view_->makeNew() };

for( PointId idx = 0; idx < view_->size(); ++idx ) {
// Set up stuff, read-accessing all points in view_
}

for( PointId idx = 0; idx < view_->size(); ++idx ) {
if( is_ok( view_, idx ) )
points->appendPoint( *view_, idx ); // Aborts here after a few hundred iterations (out of a few millions)
}

return points;
}

Best regards,

Peder Axensten
Research engineer

Remote Sensing
Department of Forest Resource Management
Swedish University of Agricultural Sciences
SE-901 83 Umeå
Visiting address: Skogsmarksgränd
Phone: +46 90 786 85 00
peder.axensten at slu.se, www.slu.se/srh

The Department of Forest Resource Management is environmentally certified in accordance with ISO 14001.

---
När du skickar e-post till SLU så innebär detta att SLU behandlar dina personuppgifter. För att läsa mer om hur detta går till, klicka här <https://www.slu.se/om-slu/kontakta-slu/personuppgifter/>
E-mailing SLU will result in SLU processing your personal data. For more information on how this is done, click here <https://www.slu.se/en/about-slu/contact-slu/personal-data/>


More information about the pdal mailing list