Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4137 closed defect (fixed)

VRT dataset not being populated by gdalwarp

Reported by: Kyle Shannon Owned by: warmerdam
Priority: normal Milestone: 1.8.1
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: VRT
Cc:

Description

When creating a warped vrt file, the dataset is never populated:

kyle@Lucky13:~/gdal-tickets$ gdalwarp -s_srs in.prj -t_srs out.prj -of VRT NETCDF:gfs.nc:U-component_of_wind_height_above_ground test.vrt

kyle@Lucky13:~/gdal-tickets$ gdalinfo -stats test.vrt 
Driver: VRT/Virtual Raster
Files: test.vrt
Size is 6, 8
Coordinate System is:
PROJCS["GDA_1994_MGA_Zone_55",
    GEOGCS["GCS_GDA_1994",
        DATUM["D_GDA_1994",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000],
    PARAMETER["False_Northing",10000000],
    PARAMETER["Central_Meridian",147],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0],
    UNIT["Meter",1]]
Origin = (522170.998323354928289,6265534.898450300097466)
Pixel Size = (50668.017687183979433,-50668.017687183979433)
Corner Coordinates:
Upper Left  (  522170.998, 6265534.898) (147d14'21.78"E, 33d45' 0.08"S)
Lower Left  (  522170.998, 5860190.757) (147d15' 1.85"E, 37d24'17.28"S)
Upper Right (  826179.104, 6265534.898) (150d31' 8.01"E, 33d42' 0.32"S)
Lower Right (  826179.104, 5860190.757) (150d40'55.50"E, 37d20'51.75"S)
Center      (  674175.051, 6062862.828) (148d55'18.71"E, 35d33'45.42"S)
Band 1 Block=512x128 Type=Float32, ColorInterp=Undefined
  Min=0.000 Max=0.000 
  Minimum=0.000, Maximum=0.000, Mean=0.000, StdDev=0.000
  Metadata:
    STATISTICS_MINIMUM=0
    STATISTICS_MAXIMUM=0
    STATISTICS_MEAN=0
    STATISTICS_STDDEV=0
Band 2 Block=512x128 Type=Float32, ColorInterp=Undefined
  Min=0.000 Max=0.000 
  Minimum=0.000, Maximum=0.000, Mean=0.000, StdDev=0.000
  Metadata:
    STATISTICS_MINIMUM=0
    STATISTICS_MAXIMUM=0
    STATISTICS_MEAN=0
    STATISTICS_STDDEV=0
...

But if I use the tiff driver it works fine:

kyle@Lucky13:~/gdal-tickets$ gdalwarp -s_srs in.prj -t_srs out.prj NETCDF:gfs.nc:U-component_of_wind_height_above_ground test.tif

kyle@Lucky13:~/gdal-tickets$ gdalinfo -stats test.tif
Driver: GTiff/GeoTIFF
Files: test.tif
Size is 6, 8
Coordinate System is:
PROJCS["GDA_1994_MGA_Zone_55",
    GEOGCS["GCS_GDA_1994",
        DATUM["D_GDA_1994",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",147],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]]]
Origin = (522170.998323354928289,6265534.898450300097466)
Pixel Size = (50668.017687183979433,-50668.017687183979433)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  522170.998, 6265534.898) (147d14'21.78"E, 33d45' 0.08"S)
Lower Left  (  522170.998, 5860190.757) (147d15' 1.85"E, 37d24'17.28"S)
Upper Right (  826179.104, 6265534.898) (150d31' 8.01"E, 33d42' 0.32"S)
Lower Right (  826179.104, 5860190.757) (150d40'55.50"E, 37d20'51.75"S)
Center      (  674175.051, 6062862.828) (148d55'18.71"E, 35d33'45.42"S)
Band 1 Block=6x8 Type=Float32, ColorInterp=Gray
  Minimum=-5.010, Maximum=1.980, Mean=-1.402, StdDev=1.774
  Metadata:
    STATISTICS_MINIMUM=-5.0100002288818
    STATISTICS_MAXIMUM=1.9800000190735
    STATISTICS_MEAN=-1.4016666666915
    STATISTICS_STDDEV=1.7743876127523
Band 2 Block=6x8 Type=Float32, ColorInterp=Undefined
  Minimum=-4.940, Maximum=1.870, Mean=-1.328, StdDev=1.687
  Metadata:
    STATISTICS_MINIMUM=-4.9400000572205
    STATISTICS_MAXIMUM=1.8700000047684
    STATISTICS_MEAN=-1.3277083244951
    STATISTICS_STDDEV=1.6869674968609

I also tried this with a similar dataset in the northern hemisphere and the vrt was written correctly.

Files attached.

Attachments (3)

gfs.nc (10.5 KB) - added by Kyle Shannon 6 years ago.
input dataset
in.prj (135 bytes) - added by Kyle Shannon 6 years ago.
input srs
out.prj (396 bytes) - added by Kyle Shannon 6 years ago.
target srs

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by Kyle Shannon

Attachment: gfs.nc added

input dataset

Changed 6 years ago by Kyle Shannon

Attachment: in.prj added

input srs

Changed 6 years ago by Kyle Shannon

Attachment: out.prj added

target srs

comment:1 Changed 6 years ago by Even Rouault

Resolution: fixed
Status: newclosed

r22641 /trunk/gdal/frmts/vrt/vrtwarped.cpp: VRT warped dataset: limit block size to dataset dimensions (#4137)

(you should regenerate the VRT after updating so that the block dimensions are updated in it)

comment:2 Changed 6 years ago by Kyle Shannon

any way to have this pushed into 1.8 before the maintenance release?

comment:3 Changed 6 years ago by Even Rouault

Milestone: 1.9.01.8.1

r22647 /branches/1.8/gdal/frmts/vrt/vrtwarped.cpp: VRT warped dataset: limit block size to dataset dimensions (#4137)

Note: See TracTickets for help on using tickets.