Different Geographic Dimensions Error

589 views
Skip to first unread message

Simon Research

unread,
Feb 16, 2016, 8:10:43 AM2/16/16
to Maxent
Hi there,

I have some environmental layers and a distance surface layer that I created in the R package 'Raster' (using the 'distance' function). With some processing, I created my distance layer using one of my MaxEnt environmental layers as a template. I have not changed the projection, extent or resolution of the raster during processing. Once I have saved my new distance layer, however, MaxEnt says that my environmental and distance layer has two different geographic dimensions. I don't understand how this can be the case.

Using R I have checked and double checked the dimensions, resolution, extent and coordinate refernce- both are exactly the same. I used the 'stack' function with Raster to test as this will throw an error if the rasters don't match. They stacked with no issues.

Here is the details of the rasters. The raster called 'raster' refers to my new distance surface, created from the raster below (jamaica.raster):

> raster
class       : RasterLayer 
dimensions  : 135, 306, 41310  (nrow, ncol, ncell)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : -78.49359, -75.94359, 17.59729, 18.72229  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +no_defs 
data source : C:\Users\Simon\Desktop\jamaicadistance 
names       : jamaicadistance 
values      : 0, 12933.97  (min, max)

> jamaica.raster
class       : RasterLayer 
dimensions  : 135, 306, 41310  (nrow, ncol, ncell)
resolution  : 0.008333333, 0.008333333  (x, y)
extent      : -78.49359, -75.94359, 17.59729, 18.72229  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +no_defs 
data source : D:\Dropbox\Uni Work\PhD\WorldClim 0.5 ArcSec Caribbean\Greater Antilles (All)\MaxEnt Layers\Jamaica\jamaicapc1.bil 
names       : jamaicapc1 
values      : -3.419589, 14.17305  (min, max)


Does anyone know what may be causing this? I understand that it may be an issue with R Raster but then again, it could be something to do with MaxEnt, so I thought I would post here.

Many thanks in advance.

Michael Treglia

unread,
Feb 16, 2016, 10:06:19 AM2/16/16
to max...@googlegroups.com
Simon,

Was recently dealing with something very similar - I wasn't running MaxEnt through dismo (in R), but rather from the GUI interface, using ASCII rasters. Though the R raster package said the layers had the same dimensions and resolution, the ASCII header was slightly different.  The difference was minuscule, so I just copied that specific header information from one file to the other. 

Let me know if this is the same issue on your end. I was just trying to get something running fairly quickly and thus didn't look into the root of the problem, but would like to see what's going on (and it be worth an e-mail to the r-sig-geo list if we have a good reproducible example).

Cheers,
mike

--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxent+un...@googlegroups.com.
To post to this group, send email to max...@googlegroups.com.
Visit this group at https://groups.google.com/group/maxent.
For more options, visit https://groups.google.com/d/optout.

Simon Research

unread,
Feb 16, 2016, 10:21:20 AM2/16/16
to Maxent
Hi Mike,

Thanks for the reply. I'm going to give your suggestion a try this afternoon. I have read that there can sometimes be tiny differences in the headers but haven't tried this yet. My environmental layers are saved as .bil (and come from ArcGIS) whereas my distance surface is .asc and comes from R Raster. I wonder if the two programs round off numbers in the header differently?

I'm going to try again with your suggestion + create new .asc environmental layers to see if this solves the issue.

Simon

Simon Research

unread,
Feb 16, 2016, 10:29:22 AM2/16/16
to Maxent
Okay so I took my environmental layers which I had originally created in ArcGIS and, without changing the extent/resolution/dimensions/coordinates, I saved a new .asc rasters of each layer.

I then used the distance surface I had created and...success!

I have no idea what happened but it can only be something to do with Arc and Raster changing the headers, as Mike suggested. I would be interested in knowing how many other people experience this, along with any possible reasons why this might be the case. It's an infuriating error- I've lost a good 4-5 hours today trying to troubleshoot this.

Alex Rebelo

unread,
Jul 10, 2016, 8:35:25 PM7/10/16
to Maxent
Just had this problem for my .BIL, after resampling in R. The header file was a bit messed up, so I replaced it and it worked.

Thanks for the suggestion Mike 
Reply all
Reply to author
Forward
0 new messages