[GRASS-user] Re: Import question

Adam Dershowitz, Ph.D., P.E. adershowitz at exponent.com
Mon Sep 20 13:50:37 EDT 2010



On Sep 20, 2010, at 10:42 AM, Micha Silver wrote:

> On 09/20/2010 06:35 PM, Hermann Peifer wrote:
>> On 20/09/2010 18:09, Adam Dershowitz, Ph.D., P.E. wrote:
>>> I have a large ortho image, that is in MrSID format  (A full county at high res).  The file is ~3.5 gig.  It covers a much larger area then I need.  So I set my region to the size that I do need, and then imported.  The import took something like 10 hrs.  And, I now see that in my PERMANENT folder I have 3 files that are each 15 gig (one red, one blue, one green),
>>> The map was imported, but if I zoom to the size of the current map, it seems that the whole map was imported, not just the area inside the current region.
>>> 
>>> I thought that imports are cropped to the current region?  Am I mistaken about this?  Is there some setting to cause this to happen?
>>> 
>>> I did the import with r.in.gdal.  I am using the binary release of 6.4 on a Mac.
>>> The reasons that I care are 1)  This map, for a small area of interest, it taking up 45 gig on my hard drive.  2)  Because the map is so large, it takes a while for the display to update when I make any changes.
>>> 
>>> Any guidance?
> If you used r.in.gdal, then I guess your gdal has MrSID support. So you should be able to use the gdal_translate utility with the -projwin flag to clip out the area you need, and create a new tif. Something like:
> gdal_translate -projwin ulX ulY lrX lrY original.sid clipped.tif
>> 
>> 
>> > Raster import and export
>> >
>> > The module r.in.gdal offers a common interface for...
>> > The full map is always imported.
>> 
>> see http://grass.osgeo.org/grass64/manuals/html64_user/rasterintro.html


Thanks.

I ended up just using r.composite on the maps that I had imported.  That did the crop to the current region that I had expected.  Then I deleted the 45 gig of maps that I didn't need, but already had.  
The gdal_translate looks like a great solution for next time, before I do the huge import.

Again, thanks to all.

--Adam


More information about the grass-user mailing list