Skip to content

Instantly share code, notes, and snippets.

@h-a-graham
Last active December 3, 2025 19:42
Show Gist options
  • Select an option

  • Save h-a-graham/6db16e70e064ae8173f1052537c59761 to your computer and use it in GitHub Desktop.

Select an option

Save h-a-graham/6db16e70e064ae8173f1052537c59761 to your computer and use it in GitHub Desktop.
muparser vrt issue
<?xml version="1.0" encoding="UTF-8"?>
<VRTDataset rasterXSize="3660" rasterYSize="3660">
<SRS dataAxisToSRSAxisMapping="1,2">PROJCS["WGS 84 / UTM zone 30N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32630"]]</SRS>
<GeoTransform> 3.9996000000000000e+05, 3.0000000000000000e+01, 0.0000000000000000e+00, 5.7000000000000000e+06, 0.0000000000000000e+00, -3.0000000000000000e+01</GeoTransform>
<VRTRasterBand dataType="Byte" band="1" subClass="VRTDerivedRasterBand">
<NoDataValue>255</NoDataValue>
<ColorInterp>Gray</ColorInterp>
<ComplexSource name="Fmask">
<SourceFilename relativeToVRT="0">STACIT:"https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=hls2-s30&amp;bbox=-3.56,50.69,-3.46,50.75&amp;datetime=2022-01-01T00:00:00Z%2F2022-02-28T23:59:59Z":asset=Fmask</SourceFilename>
<SourceBand>1</SourceBand>
<SrcRect xOff="0" yOff="0" xSize="3660" ySize="3660"/>
<DstRect xOff="0" yOff="0" xSize="3660" ySize="3660"/>
<NODATA>255</NODATA>
</ComplexSource>
<Description>Fmask</Description>
<PixelFunctionType>expression</PixelFunctionType>
<PixelFunctionArguments expression="((Fmask &amp; 8) &gt; 0 || (Fmask &amp; 4) &gt; 0) ? 0 : 1"/>
</VRTRasterBand>
<Metadata>
<MDI key="datetime"/>
</Metadata>
</VRTDataset>
<?xml version="1.0" encoding="UTF-8"?>
<VRTDataset rasterXSize="3660" rasterYSize="3660">
<SRS dataAxisToSRSAxisMapping="1,2">PROJCS["WGS 84 / UTM zone 30N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-3],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32630"]]</SRS>
<GeoTransform> 3.9996000000000000e+05, 3.0000000000000000e+01, 0.0000000000000000e+00, 5.7000000000000000e+06, 0.0000000000000000e+00, -3.0000000000000000e+01</GeoTransform>
<VRTRasterBand dataType="Byte" band="1" subClass="VRTDerivedRasterBand">
<NoDataValue>255</NoDataValue>
<ColorInterp>Gray</ColorInterp>
<ComplexSource name="Fmask">
<SourceFilename relativeToVRT="0">STACIT:"https://planetarycomputer.microsoft.com/api/stac/v1/search?collections=hls2-s30&amp;bbox=-3.56,50.69,-3.46,50.75&amp;datetime=2022-01-01T00:00:00Z%2F2022-02-28T23:59:59Z":asset=Fmask</SourceFilename>
<SourceBand>1</SourceBand>
<SrcRect xOff="0" yOff="0" xSize="3660" ySize="3660"/>
<DstRect xOff="0" yOff="0" xSize="3660" ySize="3660"/>
<NODATA>255</NODATA>
</ComplexSource>
<Description>Fmask</Description>
<PixelFunctionType>expression</PixelFunctionType>
<PixelFunctionArguments expression="(fmod(Fmask, 16) &gt;= 8) || (fmod(Fmask, 8) &gt;= 4) ? 0 : 1"/>
</VRTRasterBand>
<Metadata>
<MDI key="datetime"/>
</Metadata>
</VRTDataset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment