[gdal-dev] Specifying NODATA values for the TMS (mini)driver

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Specifying NODATA values for the TMS (mini)driver

Homme Zwaagstra-2

Hello,


I'm currently running a TMS tile server generating geotiff tiles from DEM data which I'm consuming with the GDAL TMS driver using an XML file along the following lines:


<GDAL_WMS>
    <Service name="TMS">
        <ServerUrl>http://localhost:8080/terrain/${z}/${x}/${y}.tif</ServerUrl>
    </Service>
    <DataWindow>
        <UpperLeftX>-20037508.34</UpperLeftX>
        <UpperLeftY>20037508.34</UpperLeftY>
        <LowerRightX>20037508.34</LowerRightX>
        <LowerRightY>-20037508.34</LowerRightY>
        <TileLevel>20</TileLevel>
        <TileCountX>1</TileCountX>
        <TileCountY>1</TileCountY>
        <YOrigin>top</YOrigin>
    </DataWindow>
    <Projection>EPSG:3857</Projection>
    <BlockSizeX>256</BlockSizeX>
    <BlockSizeY>256</BlockSizeY>
    <DataType>Float32</DataType>
    <BandsCount>1</BandsCount>
    <MaxConnections>50</MaxConnections>
    <ZeroBlockHttpCodes>204,404,500</ZeroBlockHttpCodes>
</GDAL_WMS>

This all works perfectly except for the fact that the responses interpreted as <ZeroBlockHttpCodes> are filled with a default value of 0. This obviously isn't great for elevation data :) Ideally I'd like to be able to specify a fill or NODATA value somewhere in the XML, something like:


<GDAL_WMS>

...

    <NoData>-9999</NoData>

or

    <FillValues>-9999</FillValues>

...

</GDAL_WMS>


The contents of a <NoData> tag might be a comma separated list for multiband rasters.


Would an enhancement request to support this be acceptable? Otherwise can anyone suggest any workarounds for the issue? 


My current thoughts are that I could generate zero filled tiffs and return those instead of 404 responses, and wrap the TMS XML with a VRT that assigns an appropriate NODATA value. This is far from ideal however, as there are a lot of potential 404s and generating data for this is wasteful in terms of processing and bandwidth.


Best regards,


Homme



_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specifying NODATA values for the TMS (mini)driver

Even Rouault-2
Homme,

>
> The contents of a <NoData> tag might be a comma separated list for multiband
> rasters.
>
>
> Would an enhancement request to support this be acceptable?

Sounds reasonable to me. Do you intend to propose a PR for this ? Ideally you
would do the similar adaptation to the WMTS driver.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specifying NODATA values for the TMS (mini)driver

Lucian Plesea-2
>>
>> The contents of a <NoData> tag might be a comma separated list for multiband
>> rasters.
>>
>>
>> Would an enhancement request to support this be acceptable?
>
>Sounds reasonable to me. Do you intend to propose a PR for this ? Ideally you
>would do the similar adaptation to the WMTS driver.
>
>Even

It is supported, for all WMS driver flavors.  The syntax is:
<DataValue NoData="10"/>  or <DataValues NoData="10 20 30"/> for multiple band, with one value for each band.
In addition to the NoData attribute, "min" and "max" are also handled the same way.

Lucian

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specifying NODATA values for the TMS (mini)driver

Even Rouault-2
On jeudi 28 juin 2018 19:42:53 CEST Lucian Plesea wrote:

> >> The contents of a <NoData> tag might be a comma separated list for
> >> multiband rasters.
> >>
> >>
> >> Would an enhancement request to support this be acceptable?
> >
> >Sounds reasonable to me. Do you intend to propose a PR for this ? Ideally
> >you would do the similar adaptation to the WMTS driver.
> >
> >Even
>
> It is supported, for all WMS driver flavors.  The syntax is:<DataValue
> NoData="10"/>  or <DataValues NoData="10 20 30"/> for multiple band, with
> one value for each band.In addition to the NoData attribute, "min" and
> "max" are also handled the same way.

Ah, thanks. This wasn't documented. Just added it.

Except it seems that ZeroBlock() just zeroes blocks, and doesn't use the
nodata value.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Specifying NODATA values for the TMS (mini)driver

Lucian Plesea-2
Yeah, I had that on my list of things to do, I just bumped into it.
And before someone notices, the correct tag is "DataValues", never "DataValue".  I used both in the first message.

Lucian

On Thursday, June 28, 2018, 12:57:55 PM PDT, Even Rouault <[hidden email]> wrote:


On jeudi 28 juin 2018 19:42:53 CEST Lucian Plesea wrote:

> >> The contents of a <NoData> tag might be a comma separated list for
> >> multiband rasters.
> >>
> >>
> >> Would an enhancement request to support this be acceptable?
> >
> >Sounds reasonable to me. Do you intend to propose a PR for this ? Ideally
> >you would do the similar adaptation to the WMTS driver.
> >
> >Even
>
> It is supported, for all WMS driver flavors.  The syntax is:<DataValue
> NoData="10"/>  or <DataValues NoData="10 20 30"/> for multiple band, with
> one value for each band.In addition to the NoData attribute, "min" and
> "max" are also handled the same way.

Ah, thanks. This wasn't documented. Just added it.

Except it seems that ZeroBlock() just zeroes blocks, and doesn't use the
nodata value.


Even


--
Spatialys - Geospatial professional services
http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev