• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OSGeo / gdal / 12772620384

14 Jan 2025 05:00PM UTC coverage: 70.094%. Remained the same
12772620384

push

github

web-flow
VRT Pixel Functions: Add function to evaluate arbitrary expression (#11209)

Adds a C++ pixel function called "expression" that can evaluate an arbitrary expression (or indeed, a mini-program) using either:
- the [exprtk library](https://www.partow.net/programming/exprtk/index.html). This is a single MIT-licensed header, that appears to be quite widely used. But which causes a significant increase in size of libgdal (8 MB)
- or [muparser](https://github.com/beltoforion/muparser), that supports a reasonable variety of functions including a ternary conditional operator

muparser is the deault when the "dialect" is not specified.

An example VRT that is allowed is:

```
<VRTDataset rasterXSize="1" rasterYSize="1">
  <VRTRasterBand dataType="Float64" band="1" subClass="VRTDerivedRasterBand">
    <PixelFunctionType>expression</PixelFunctionType>
    <PixelFunctionArguments expression="(NIR-R)/(NIR+R)" />
    <SimpleSource name="NIR">
      <SourceFilename relativeToVRT="0">source_0.tif</SourceFilename>
      <SourceBand>1</SourceBand>
    </SimpleSource>
    <SimpleSource name="R">
      <SourceFilename relativeToVRT="0">source_1.tif</SourceFilename>
      <SourceBand>1</SourceBand>
    </SimpleSource>
  </VRTRasterBand>
</VRTDataset>
```

199 of 227 new or added lines in 8 files covered. (87.67%)

341 existing lines in 35 files now uncovered.

563705 of 804210 relevant lines covered (70.09%)

223160.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.49
/third_party/LercLib/Lerc_c_api_impl.cpp


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc