Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a GeoTiff that has been supplied to me with non square pixels (I suspect due to reprojection to lat lon at some point). However the next step in my processing chain requires a Arc ASCII grid as input and so I need square pixels.

To save me trying to guess the original projection can any one tell me how to use GDAL to resample my image so the pixels become square?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

It's not something I've tried, but I think you can do it with gdalwarp:

gdalwarp -tr 10.0 -10.0 -r bilinear src.tif dst.asc

You would choose a -tr value based on the smallest value of the source's resolution, remembering to negate the y scale if it's a top-down image. gdal_translate has an -outsize parameter that might do the job, but it may just truncate the image, or at best use nearest neighbour interpolation.

I'd be interested in what you find, because sooner or later it's going to happen to someone else!

share|improve this answer
    
This works nicely, only issue is that you can't translate to ascii grid with gdalwarp so you need an intermediate tif and then use gdal_translate. –  iant Jun 21 '12 at 13:41
    
I'm glad it works! Shame about the two-stage process, but that's the nature of text-based formats I guess. –  MerseyViking Jun 21 '12 at 13:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.