[R-sig-Geo] Raster Package Aggregate new coordinates?

Robert J. Hijmans r.hijmans at gmail.com
Fri Oct 15 06:48:02 CEST 2010


On Thu, Oct 14, 2010 at 8:11 PM, Elizabeth Crisfield <eac16 at psu.edu> wrote:
> I'm using aggregate in the raster package.
>
> It looks like it uses the coordinate pair of the northwest corner of the
> original high res dataset as the new northwest corner of the aggregated
> dataset.

Correct, and the SE corner is adjusted, if necessary.

> This would be right if the coordinates were taken to be grid
> centered. But when I browse the data in arc, it *looks* like the Raster
> package is using cell center coordinates.
> (But it could be arc that is confusing grid and cell-centered.)

The Raster* objects do not use cell-center coordinates, but in arc you
are looking at a file, and what you are seeing could be a
file-format-specific matter. What format did you write to? This issue
does cause a lot of confusion, and it certainly possible that
something goes wrong in writing that file in raster (perhaps via
rgdal), or in Arc. Can you produce a reproducible example, perhaps
starting from the example in the aggregate help file?

> In case it matters, these files were netcdfs, with bands converted to
> rasters, and then stacked to prep for the aggregate.
> I still haven't gotten
> crop to work on them, erroring with "Error in intersectExtent(x,y):Invalid
> extent" so maybe I have deeper coordinate system read-in problems...

Sounds like an invalid extent argument to crop. Likely the extend that
you want to use to crop does not at all overlap with the raster. If
they do you should be able to see that when doing plot(raster);
plot(extent, add=TRUE)

Cheers, Robert
>
>
> Elizabeth
> ____________________
> Elizabeth Crisfield
> Research Assistant
> Geography Department
> Penn State University
> phone 814-777-3395
> eac16 at psu.edu
> www.elizabethcrisfield.com
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list