taking a small piece of large tiff

taking a small piece of large tiff

Dear Forum
I am trying to cut out a small section of a very large 2-dimensional grayscale image as a tiff in R, but it is having difficulty handling such large files. I have looked at bigmemory and ff packages but it is unclear how I can use these packages with tiffs. Can anyone please suggest something? I have tried tiff and rtiff libraries.
Thanks in advance.
[[alternative HTML version deleted]]

> Dear Forum
> I am trying to cut out a small section of a very large 2-dimensional grayscale image as a tiff in R, but it is having difficulty handling such large files. I have looked at bigmemory and ff packages but it is unclear how I can use these packages with tiffs. Can anyone please suggest something? I have tried tiff and rtiff libraries.
> Thanks in advance.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.

Re: taking a small piece of large tiff

Ok. I have a tiff of size over 2GB. It covers a sixth of the Earth's surface and I'm trying to cut a UK piece out of it. The tiff I start with seems to be too large for R to handle.

Sent from my iPhone

> On 4 Apr 2017, at 18:37, jim holtman <[hidden email]> wrote:
>
> How big is 'large'?
>
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
>
> On Tue, Apr 4, 2017 at 7:47 AM, Louisa Reynolds via R-help
> <[hidden email]> wrote:
>> Dear Forum
>> I am trying to cut out a small section of a very large 2-dimensional grayscale image as a tiff in R, but it is having difficulty handling such large files. I have looked at bigmemory and ff packages but it is unclear how I can use these packages with tiffs. Can anyone please suggest something? I have tried tiff and rtiff libraries.
>> Thanks in advance.
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html>> and provide commented, minimal, self-contained, reproducible code.

> Ok. I have a tiff of size over 2GB. It covers a sixth of the Earth's surface and I'm trying to cut a UK piece out of it. The tiff I start with seems to be too large for R to handle.
>
>
> Sent from my iPhone
>
>> On 4 Apr 2017, at 18:37, jim holtman <[hidden email]> wrote:
>>
>> How big is 'large'?
>>
>> Jim Holtman
>> Data Munger Guru
>>
>> What is the problem that you are trying to solve?
>> Tell me what you want to do, not how you want to do it.
>>
>>
>> On Tue, Apr 4, 2017 at 7:47 AM, Louisa Reynolds via R-help
>> <[hidden email]> wrote:
>>> Dear Forum
>>> I am trying to cut out a small section of a very large 2-dimensional grayscale image as a tiff in R, but it is having difficulty handling such large files. I have looked at bigmemory and ff packages but it is unclear how I can use these packages with tiffs. Can anyone please suggest something? I have tried tiff and rtiff libraries.
>>> Thanks in advance.
>>> [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html>>> and provide commented, minimal, self-contained, reproducible code.
>

> On Apr 5, 2017, at 3:23 AM, Louisa Reynolds via R-help <[hidden email]> wrote:
>
> Ok. I have a tiff of size over 2GB. It covers a sixth of the Earth's surface and I'm trying to cut a UK piece out of it. The tiff I start with seems to be too large for R to handle.
>
>
> Sent from my iPhone
>
>> On 4 Apr 2017, at 18:37, jim holtman <[hidden email]> wrote:
>>
>> How big is 'large'?
>>
>> Jim Holtman
>> Data Munger Guru
>>
>> What is the problem that you are trying to solve?
>> Tell me what you want to do, not how you want to do it.
>>
>>
>> On Tue, Apr 4, 2017 at 7:47 AM, Louisa Reynolds via R-help
>> <[hidden email]> wrote:
>>> Dear Forum
>>> I am trying to cut out a small section of a very large 2-dimensional grayscale image as a tiff in R, but it is having difficulty handling such large files. I have looked at bigmemory and ff packages but it is unclear how I can use these packages with tiffs. Can anyone please suggest something? I have tried tiff and rtiff libraries.
>>> Thanks in advance.
>>> [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html>>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.

Re: taking a small piece of large tiff

> if you have 8GB of memory it should be easy to handle.
>
>
>
TIFF is a container format and may be compressed internally, and so could
expand out as a matrix it might be very many times larger than the file
size implies.

Note that the extent values must be in the coordinate system used by the
raster itself, it might be in longitude-latitude or in some
"eastings-northings" map projection (CRS, or coordinate reference system).
The print out of print(r) will tell you, and projection(r) if you need to
use it directly.

There's no need to do your own transformations from world-space to pixel
index space. but the price of that convenience is you have to interact with
the data via the raster package's design and interfaces. You can get a
matrix out but it's well worth learning the higher level abstractions
available as well.

Cheers, Mike.

> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
>
> On Wed, Apr 5, 2017 at 3:23 AM, Louisa Reynolds
> <[hidden email]> wrote:
> > Ok. I have a tiff of size over 2GB. It covers a sixth of the Earth's
> surface and I'm trying to cut a UK piece out of it. The tiff I start with
> seems to be too large for R to handle.
> >
> >
> > Sent from my iPhone
> >
> >> On 4 Apr 2017, at 18:37, jim holtman <[hidden email]> wrote:
> >>
> >> How big is 'large'?
> >>
> >> Jim Holtman
> >> Data Munger Guru
> >>
> >> What is the problem that you are trying to solve?
> >> Tell me what you want to do, not how you want to do it.
> >>
> >>
> >> On Tue, Apr 4, 2017 at 7:47 AM, Louisa Reynolds via R-help
> >> <[hidden email]> wrote:
> >>> Dear Forum
> >>> I am trying to cut out a small section of a very large 2-dimensional
> grayscale image as a tiff in R, but it is having difficulty handling such
> large files. I have looked at bigmemory and ff packages but it is unclear
> how I can use these packages with tiffs. Can anyone please suggest
> something? I have tried tiff and rtiff libraries.
> >>> Thanks in advance.
> >>> [[alternative HTML version deleted]]
> >>>
> >>> ______________________________________________
> >>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >>> https://stat.ethz.ch/mailman/listinfo/r-help> >>> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html> >>> and provide commented, minimal, self-contained, reproducible code.
> >
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
>

> Ok. I have a tiff of size over 2GB. It covers a sixth of the Earth's surface and I'm trying to cut a UK piece out of it. The tiff I start with seems to be too large for R to handle.
>
>
> Sent from my iPhone
>
> > On 4 Apr 2017, at 18:37, jim holtman <[hidden email]> wrote:
> >
> > How big is 'large'?
> >
> > Jim Holtman
> > Data Munger Guru
> >
> > What is the problem that you are trying to solve?
> > Tell me what you want to do, not how you want to do it.
> >
> >
> > On Tue, Apr 4, 2017 at 7:47 AM, Louisa Reynolds via R-help
> > <[hidden email]> wrote:
> >> Dear Forum
> >> I am trying to cut out a small section of a very large 2-dimensional grayscale image as a tiff in R, but it is having difficulty handling such large files. I have looked at bigmemory and ff packages but it is unclear how I can use these packages with tiffs. Can anyone please suggest something? I have tried tiff and rtiff libraries.
> >> Thanks in advance.
> >> [[alternative HTML version deleted]]
> >>
> >> ______________________________________________
> >> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help> >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html> >> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
>

--
Important Notice: This mailbox is ignored: e-mails are set to be deleted on receipt. Please respond to the mailing list if appropriate. For those needing to send personal or professional e-mail, please use appropriate addresses.