Opened 6 years ago

Closed 6 years ago

#3932 closed defect (fixed)

most of world mask fails with gdalwarp

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone:
Component: Utilities Version: unspecified
Severity: normal Keywords: warp cutline
Cc:

Description

Mask:

  POLYGON ((-164.26162019 81.45193268,165.687915010000012 81.45193268,165.687915010000012 -76.70254885,-164.26162019 -76.70254885,-164.26162019 81.45193268))

Raster file:

Size is 18829, 18794
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 = (-74.098964722222206,7.903421388888890)
Pixel Size = (0.000023055555556,-0.000023055555556)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
OGRCT: PROJ >= 4.8.0 features enabled
OGRCT: Source: +proj=longlat +datum=WGS84 +no_defs 
OGRCT: Target: +proj=longlat +datum=WGS84 +no_defs 
Corner Coordinates:
Upper Left  ( -74.0989647,   7.9034214) ( 74d 5'56.27"W,  7d54'12.32"N)
Lower Left  ( -74.0989647,   7.4701153) ( 74d 5'56.27"W,  7d28'12.41"N)
Upper Right ( -73.6648517,   7.9034214) ( 73d39'53.47"W,  7d54'12.32"N)
Lower Right ( -73.6648517,   7.4701153) ( 73d39'53.47"W,  7d28'12.41"N)
Center      ( -73.8819082,   7.6867683) ( 73d52'54.87"W,  7d41'12.37"N)

The input file and output file are essentially the same and the images are warped using gdalwarp with a cutline. Nothing is transferred to the output.

Change History (1)

comment:1 Changed 6 years ago by warmerdam

Resolution: fixed
Status: newclosed

The problem turned out to be the default behavior of gdalwarp to utilize the CENTER_LONG mechanism during geographic warps to rewrap things around the center of the image. This was also being applied to the mask so instead of it going from -165 to +165 it went from -195 to -165 after rewrapping around the center long of -74 or so.

I have modified things in trunk so the InsertCenterLong? mechanism is not invoked for the cutline in trunk (r21586) on the premise that rewrapping the cutline is more likely to cause problems then just rewrapping the image data as it is warped.

Note: See TracTickets for help on using tickets.