[gdal-dev] I have a problem getting higher resolution in a VRT file

Even Rouault even.rouault at spatialys.com
Thu Aug 20 03:16:23 PDT 2020


On mercredi 19 août 2020 18:41:51 CEST Stephen Woodbridge wrote:
> Hi all,
> 
> I've been puzzling over a problem with trying to get a higher resolution
> images using a VRT file so low res data looks smoother in mapserver.
> 
> This is my source tif image:
> 
> gdalinfo  /maps/wms/data/HYCOM/HYCOM_today_mlt.tif
> Driver: GTiff/GeoTIFF
> Files: /maps/wms/data/HYCOM/HYCOM_today_mlt.tif
> Size is 4500, 4251
> Coordinate System is:
> GEOGCS["WGS 84",
>      DATUM["WGS_1984",
>          SPHEROID["WGS 84",6378137,298.257223563,
>              AUTHORITY["EPSG","7030"]],
>          AUTHORITY["EPSG","6326"]],
>      PRIMEM["Greenwich",0],
>      UNIT["degree",0.0174532925199433],
>      AUTHORITY["EPSG","4326"]]
> Origin = (-180.000000000000000,90.000000000000000)
> Pixel Size = (0.080000000000000,-0.040000000000000)
> Metadata:
>    AREA_OR_POINT=Area
>    [snip more metadata]
> Image Structure Metadata:
>    INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  (-180.0000000,  90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
> Lower Left  (-180.0000000, -80.0400000) (180d 0' 0.00"W, 80d 2'24.00"S)
> Upper Right ( 180.0000000,  90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
> Lower Right ( 180.0000000, -80.0400000) (180d 0' 0.00"E, 80d 2'24.00"S)
> Center      (   0.0000000,   4.9800000) (  0d 0' 0.01"E, 4d58'48.00"N)
> Band 1 Block=4500x1 Type=Float32, ColorInterp=Gray
>    NoData Value=1.2676506002282294e+30
>    Overviews: 2250x2126, 1125x1063, 563x532, 282x266, 141x133, 71x67
> 
> 
> I generate a VRT file as part of my processing and add a color table and
> increase the resolution. It looks like this:
> 
> gdalinfo  /maps/wms/data/HYCOM/HYCOM_today_mlt.vrt
> Driver: VRT/Virtual Raster
> Files: /maps/wms/data/HYCOM/HYCOM_today_mlt.vrt
>         /maps/wms/data/HYCOM/HYCOM_today_mlt.tif
> Size is 72000, 68016
> Coordinate System is:
> GEOGCS["WGS 84",
>      DATUM["WGS_1984",
>          SPHEROID["WGS 84",6378137,298.257223563,
>              AUTHORITY["EPSG","7030"]],
>          AUTHORITY["EPSG","6326"]],
>      PRIMEM["Greenwich",0],
>      UNIT["degree",0.0174532925199433],
>      AUTHORITY["EPSG","4326"]]
> Origin = (-180.000000000000000,90.000000000000000)
> Pixel Size = (0.005000000000000,-0.002500000000000)
> Corner Coordinates:
> Upper Left  (-180.0000000,  90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"N)
> Lower Left  (-180.0000000, -80.0400000) (180d 0' 0.00"W, 80d 2'24.00"S)
> Upper Right ( 180.0000000,  90.0000000) (180d 0' 0.00"E, 90d 0' 0.00"N)
> Lower Right ( 180.0000000, -80.0400000) (180d 0' 0.00"E, 80d 2'24.00"S)
> Center      (   0.0000000,   4.9800000) (  0d 0' 0.01"E, 4d58'48.00"N)
> Band 1 Block=128x128 Type=Byte, ColorInterp=Palette
>    Overviews: 36000x34016, 18000x17008, 9008x8512, 4512x4256, 2256x2128,
> 1136x1072
>    Color Table (RGB with 256 entries)
> [snip color table]
> 
> 
> And in my mapfile I have a layer defined like:
> 
>      LAYER
>          NAME "mlt"
>          STATUS ON
>          TYPE RASTER
>          PROJECTION "init=epsg:4326" END
>          DATA "/maps/wms/data/HYCOM/HYCOM_today_mlt.vrt"
>          PROCESSING "NODATA=1.2676506002282294e+30"
>          PROCESSING "SCALE=0,250"
>      END
> 
> This all seems like it should be working correctly, but in my OL app,
> the resolution is not changing. I would expect the with the higher
> resolution I would see smoother color transitions as I zoom in on the
> image and that the pixel blocks would appear smaller. Unfortunately, I'm
> not seeing a difference.
> 
> So I assume I've done something wrong somewhere, but I'm not see what :(

By default, VRT uses nearest resampling. You must specify something else.
Look for "A resampling attribute can be specified" in
https://gdal.org/drivers/raster/vrt.html

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200820/26e7ea7d/attachment-0001.html>


More information about the gdal-dev mailing list