| Re: Memory Allocation Problem- IDL 8.2 [message #82009 is a reply to message #81925] |
Tue, 13 November 2012 06:34  |
titan
Messages: 59 Registered: March 2006
|
Member |
|
|
On Friday, November 9, 2012 3:09:20 PM UTC+1, David Fanning wrote:
> titan writes:
>
>
>
>
>
>> if I try to run the following code lines
>
>>
>
>> utm_fname=IMAGE(png_fname, GEOTIFF=geotag)
>
>> utm_fname.SAVE,png_fname+'.kmz'
>
>>
>
>>
>
>>
>
>> I get the following error:
>
>>
>
>> SAVE: Unable to allocate memory: to make array.
>
>>
>
>> and the dimensions of the image are:
>
>> PNG_IMAGE BYTE = Array[3783, 4318]
>
>>
>
>> I surfed the web and I find some interesting articles like the following one:
>
>> http://www.idlcoyote.com/misc_tips/idl8mem.html
>
>>
>
>> but it seems that the problems is still present even ii was supposed to be solved.
>
>>
>
>> I have 4 GB of RAM, a Quad core processor 2.40GHz mounted on a 32-bit windows 7 (unfortunately I can't work on Linux)
>
>>
>
>> Could someone tell me how to change it to avoid having (if possible) that error??
>
>
>
> Well, it is conceivable that at least 65 MBytes or so
>
> is needed to write that KMZ file, if IDL is going to write a
>
> color PNG file with an alpha channel (which is what I would
>
> do). So, 3783*4318*4=65.4 MByte.
>
>
>
> I think the problem is probably your 32-bit OS:
>
>
>
> http://www.idlcoyote.com/fileio_tips/lgfiles.html
>
>
>
> It is certainly *possible* that you don't need all those
>
> pixels over there on Google Earth to see what it is you
>
> hope to see. You might try running cgImage2KML and using
>
> the Resize_Factor keyword to reduce the size of your image
>
> before the alpha PNG file is created. It looks like your
>
> image is a GeoTiff file, so something like this will
>
> probably work:
>
>
>
> cgImage2KML, GeoTiff=geoFilename, Resize_Factor=0.25
>
>
>
> You can read more about it here:
>
>
>
> http://www.idlcoyote.com/cg_tips/image2kml.php
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
many Thanks David,
It works perfectly!!
regards
|
|
|
|