[Gdal-dev] Error Message with gdalwarp

Manuel Massing m.massing at warped-space.de
Tue Oct 12 10:32:07 EDT 2004


Hello Todd,

> W to 60 W and from 30 N to 45 N. I converted these to pixels like you
> said and came out to my x_pixel being 37,800, my y_pixel to be 14,400,
> my x_size to 9000, and my y_size to be 1800. When I type in my command,
> I get this following error.

use negative longitude for western hemisphere in the formulas
(note that they only pertrain to the specific dataset you mentioned!)...  
I also made a small mistake, y_pixel should be (90 - latitude)*120.

I.e.  x_pixel = (-135+180)*120 = 5400 
and  y_pixel = (90-45)*120 = 5400.

This gives you the offset in pixels, so you have to use the -srcwin option.

Use -projwin for projected coordinates only (i.e., in your case
longitude+latitude). This will only work if the input file is
georeferenced, however.

Manuel



More information about the Gdal-dev mailing list