Adam,

library(raster)
# create RasterLayer with the same parameters as yours
r <- raster(nrow=50, ncol=50, xmn=-1888000, xmx=2122000, ymn=-4847000,
ymx=-1010000, crs="+proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=132
+x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")

# to figure out where this is:
x <- projectExtent(r, '+proj=lonlat +datum=WGS84')
library(maptools)
data(wrld_simpl)
plot(wrld_simpl)
plot(extent(x), add=TRUE, col='red', lwd=2)


# use some example values to project:
r[] <- 1:ncell(r)
z <- projectRaster(r, crs='+proj=lonlat +datum=WGS84')
plot(z)
plot(wrld_simpl, add=T)


#If you wanted to subset 'r' using lon/lat data you could create
#a Spatial* object and use spTransform to transform to the aea crs
#and use that to crop. E.g.

tasmania <- as(extent(142.35, 150.94, -45.57, -38.80),  'SpatialPolygons')
projection(tasmania) <- '+proj=lonlat +datum=WGS84'
ptas <- spTransform(tasmania, CRS("+proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0
+lon_0=132 +x_0=0 +y_0=0 +ellps=GRS80"))
rt <- crop(r, ptas)

Hope this helps, Robert

On Tue, Feb 26, 2013 at 10:07 PM, Adam <apcar@deakin.edu.au> wrote:

> G'day,
>
> I have a raster file ( Landuse for Australia
> <http://adl.brs.gov.au/anrdl/metadata_files/pa_luausr9abll07611a00.xml>  )
> with projection GDA94 Australian Albers (EPSG:3577).
>
> class       : RasterLayer
> dimensions  : 76740, 80200, 6154548000  (nrow, ncol, ncell)
> resolution  : 50, 50  (x, y)
> extent      : -1888000, 2122000, -4847000, -1010000  (xmin, xmax, ymin,
> ymax)
> coord. ref. : +proj=aea +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=132 +x_0=0
> +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
> data source : C:\Users\Adam\Documents\Spatial
>
> data\enviro_layers\Aus_data\Aus_Landuse\luausr9abll07612b00egialb132\clumfill_0310\dblbnd.adf
> names       : dblbnd
> values      : 100, 663  (min, max)
> attributes  : (there are a few, I have left them out)
>
>
> When I try to projectRaster() to a different projection (normal GDA94,
> EPSG:4283) it either takes a very long time or isn't working (I stopped it
> after an hour or so) because it is relatively big. So I tried to crop to a
> smaller extent, but I only know my extents in lat/lon values and it came up
> with the error : Objects do not overlap. Also, my spatial points dont
> overlap with it either, I'm just wondering where this raster is saying it
> is?
>
> I would like to know if anyone can help me to change this object to
> something in lat/lon (extent and resolution) so I am more familiar with it.
> Also, is this raster really over Australia, I am thrown off by the extent.
>
> Thanks in advance for your help, and sorry for what I believe is probably
> something very obvious that I am missing.
>
> Regards,
> Adam
>
>
>
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Confusing-raster-file-GDA94-aus-albers-tp7582828.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

