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

Stephen Woodbridge stephenwoodbridge37 at gmail.com
Wed Aug 19 15:41:51 PDT 2020


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 :(

Any Ideas?

Thanks,
   -Steve

Oh and the VRT file looks like this:

<VRTDataset rasterXSize="72000" rasterYSize="68016">
   <SRS>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"]]</SRS>
   <GeoTransform> -180.0 ,0.005 , 0 , 90.0 , 0 , -0.0025 </GeoTransform>
   <Metadata>
   </Metadata>
   <VRTRasterBand dataType="Byte" band="1">
     <ColorInterp>Palette</ColorInterp>
     <ColorTable>
       <Entry c1="0" c2="0" c3="0" c4="255"/>
       [snip color table entries]
       <Entry c1="255" c2="255" c3="255" c4="255"/>
     </ColorTable>
     <SimpleSource resample="bilinear">
       <SourceFilename 
relativeToVRT="1">HYCOM_today_mlt.tif</SourceFilename>
       <SourceBand>1</SourceBand>
       <SourceProperties RasterXSize="4500" RasterYSize="4251" 
DataType="Float32" BlockXSize="4500" BlockYSize="1" />
       <SrcRect xOff="0" yOff="0" xSize="4500" ySize="4251"/>
       <DstRect xOff="0" yOff="0" xSize="72000" ySize="68016"/>
     </SimpleSource>
   </VRTRasterBand>
</VRTDataset>



More information about the gdal-dev mailing list