[Gdal-dev] Error Message with gdalwarp

Dobmeyer, Todd tdobmeye at ball.com
Tue Oct 12 09:55:33 EDT 2004


My files are geo-referenced so I assume I do not need to use that
utility you sent me. My .tif file is 21600x21600. I want to go from 135
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.

Input file size is 21600, 21600
Computed -srcwin 37800 14400 -28799 -12599 from projected window.
0.ERROR 2: CPLMalloc(): Out of memory allocating -28799 bytes.


This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

What does this mean? Am I finding something incorrectly? Thanks for your
help again!

Todd

-----Original Message-----
From: Manuel Massing [mailto:m.massing at warped-space.de] 
Sent: Tuesday, October 12, 2004 9:30 AM
To: Dobmeyer, Todd
Cc: gdal-dev at xserve.flids.com
Subject: Re: [Gdal-dev] Error Message with gdalwarp

Hi Todd,

> Sorry but I am new to this stuff. Why do I want to use gdal_translate
> instead of gdal_warp? I want to be able to input a min and max of
> latitude and longitude, and I do not see where gdal_translate will
allow
> this. Also, where do I put that file you sent me? Does it go in the
> gcore folder? Thanks.

No, this is a standalone utility, you just need to have gdal in the 
include/link path of your C++ compiler. Assuming you do not have a C++
compiler set up, you can find the appropriate pixel coordinates by hand
(one pixel covers 1/120 deg in the mentioned dataset):

 x_pixel = (desired_longitude+180)*120
 y_pixel = (desired_lattitude+90)*120

 x_size = long_extent*120
 y_size = lat_extent*120

Then: gdal_translate -srcwin <x_pixel> <y_pixel> <x_size> <y_size>
western.tif 
output.tif

For georeferenced files, you can use -projwin instead of -srcwin.

hth,

 Manuel



More information about the Gdal-dev mailing list