Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5804 closed defect (invalid)

output image size change

Reported by: rghosh0 Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords: image size
Cc:

Description

It seems to me that gdalwarp is taking a 24000x7998 image and producing a 23658x21360 image. No arguments are given other than srcfile and dstfile, so I would expect the size to be the same. Is this a bug or a misunderstanding on my part?

$ gdalinfo ENR_AKL01.tif | grep Size Size is 24000, 7998

$ gdalwarp ENR_AKL01.tif test.tif Creating output file that is 23658P x 21360L.

Source of image: http://aeronav.faa.gov/enroute/01-08-2015/enr_akl01.zip

Change History (3)

comment:1 by Jukka Rahkonen, 9 years ago

Resolution: invalid
Status: newclosed

Misunderstanding but you will understand it immediately if you open the target image and see how it looks. Gdalwarp is made for warping and in this case the source image needs to be rotated for making is north-up. The wide and narrow original scanned map needs a bigger canvas to fit in when it is rotated.

The gdal-dev mailing list is the place for asking questions about how to use gdal utitities. Tickets are for reporting identified bugs and for suggesting new improvements. Meet you there next time.

comment:2 by rghosh0, 9 years ago

I see what you mean. Is there a way to tell gdalwarp to not rotate the image?

My reason is I want to apply a polygon cutline before warping an image. I can't apply it after warping because the polygon is in the source srs. (In the transformed srs, the cutline would not be a polygon, it would be a sequence of curves.) But I don't want resampling to occur in the cutline operation.

comment:3 by Jukka Rahkonen, 9 years ago

With some workarounds I guess yes. I would make first a copy of the original with gdal_translate into baseline tiff file which removes all the geotiff tags. Then gdalwarp probably believes that the new image is north-up. Apply your cutline and finally transfer the geotiff tags from original into gdalwarped image with the GeoTIFF utility geotiffcp.

Note: See TracTickets for help on using tickets.