Australia Coordinates – What Are the Xmin, Xmax, Ymin, Ymax Values for Australia?

rraster

I am trying to crop the bioclimatic data from WorldClim.org to get environmental features only for the Australian habitat using the extent() method. Finally, I plan to combine the bioclimatic data with the occurrence data to perform species distribution modelling.

However, I cannot understand how the xmin, xmax, ymin and ymax spatial coordinate values are provided to the biocli<-stack(crop(bioclimatic,(extent(xmin, xmax, ymin, ymax)))) method.

Best Answer

The extent can be extracted from another object. So if you have, e.g. SpatialPolygons for Australia, aus you can do

librayr(raster)
aus <- raster::getData("GADM", country="Australia", level=1)
e <- extent(aus)
e
#class      : Extent 
#xmin       : 112.9211 
#xmax       : 159.1092 
#ymin       : -55.11694 
#ymax       : -9.142176 

You can also look at a map and do something like

 e <- extent(100, 160, -10, -50)

And you can refine that with trial and error.

Moreover, you can do

 plot(bioclimatic, 1)
 e <- drawExtent() # now click twice on the map, to create an extent

With "terra" (the replacement of "raster"), replace extent with ext and drawExtent with draw.

Related Question