MCPcopy Create free account
hub / github.com/LAStools/LAStools / filter

Method filter

LASlib/src/lasfilter.cpp:1053–1057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1051 inline I32 get_command(CHAR* string) const { return sprintf(string, "-%s%s %g %g ", name(), (NIR == 3 ? "" : (NIR == 1 ? "_green_is_NIR" : "_blue_is_NIR")), below_NDVI, above_NDVI); };
1052 inline U32 get_decompress_selective() const { if (NIR == 3) return LASZIP_DECOMPRESS_SELECTIVE_RGB | LASZIP_DECOMPRESS_SELECTIVE_NIR; else return LASZIP_DECOMPRESS_SELECTIVE_RGB; };
1053 inline BOOL filter(const LASpoint* point)
1054 {
1055 F32 NDVI = ((F32)(point->rgb[NIR] - point->get_R())) / ((F32)(point->rgb[NIR] + point->get_R()));
1056 return (NDVI < below_NDVI) || (above_NDVI < NDVI);
1057 };
1058 LAScriterionKeepNDVI(F32 below_NDVI, F32 above_NDVI, I32 NIR) { if (above_NDVI < below_NDVI) { this->below_NDVI = above_NDVI; this->above_NDVI = below_NDVI; } else { this->below_NDVI = below_NDVI; this->above_NDVI = above_NDVI; }; this->NIR = NIR; };
1059private:
1060 F32 below_NDVI, above_NDVI;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected