GAP Land cover and Maxent issue - outside the bounding box of environmental data

463 views
Skip to first unread message

Alexander McKelvy

unread,
Apr 23, 2016, 9:47:44 AM4/23/16
to Maxent
Hi all,

I am trying to use maxent with localities and GAP landcover data (categorical). When I use bioclim data (continuous), I have no issues and can run everything I need. When I use the gap land cover data, which I have converted to ascii on both the macro and subclass levels using ESRI arcgis, I can't get it to line up with my locality points and get the error "Warning: Sample at Lon, Lat in myfile.csv is outside the bounding box of environmental data, skipping". I tried a few different things, including ensuring that my data are exported under the same projection. Is anyone else having this problem or can offer suggestions to help? I'm mostly interested in measuring variable importance at different levels among species.

Thanks
Alex

Alexander McKelvy

unread,
Apr 24, 2016, 5:15:31 PM4/24/16
to Maxent
So, switching the order of lat/lon (irregular since it works with the bioclim data the other way around) makes the bounding box error disappear and now I get  "Warning: Sample at X, Y in myfile.csv is missing some environmental data (e.g. mydatafile) for each presence point".

Alexander McKelvy

unread,
Apr 27, 2016, 5:01:26 PM4/27/16
to Maxent
Well, using QGis instead of arc fixed some of this, I'm now down to the "java.lang.ArrayIndexOutOfBoundsException" error which has been posted here 5 or 6 times without a solution that I can find. Any help on that error would be appreciated!

Alexander McKelvy

unread,
Apr 27, 2016, 5:31:37 PM4/27/16
to Maxent
Wed Apr 27 17:27:00 EDT 2016
MaxEnt version 3.3.3k
Checking header of F:\path\macrowgs.asc
Reading samples from myfile.csv
Read samples: max memory 3810525184, total allocated 348127232, free 241005440, used 107121792, increment 41283424
Extractor: max memory 3810525184, total allocated 348127232, free 240997096, used 107130136, increment 8344
Extracting random background and sample data
Time since start: 65.111
Error reading file F:\path\myfile.csv: java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
Time since start: 142.828
Ending

Alexander McKelvy

unread,
Apr 27, 2016, 5:57:38 PM4/27/16
to Maxent
With a different set of occurances

java.lang.ArrayIndexOutOfBoundsException: -1758671516
java.lang.ArrayIndexOutOfBoundsException: -1758671516
at density.Extractor.readSamples(Extractor.java:257)
at density.Extractor.extractSamples(Extractor.java:155)
at density.Runner.initializeGrids(Runner.java:193)
at density.Runner.start(Runner.java:281)
at density.GUI$7.construct(GUI.java:319)
at density.SwingWorker$2.run(SwingWorker.java:108)
at java.lang.Thread.run(Unknown Source)

Samuel Veloz

unread,
Apr 27, 2016, 8:06:37 PM4/27/16
to max...@googlegroups.com
Alex,

Without seeing your data it is hard to know for sure. But the requirements are that your environmental rasters all have to have the same extent and resolution. If I had to guess, I would say your GAP landcover layer has a different extent. The header for the ASCIII file should be exactly the same as the bioclim layers. It sounds like you checked the projection but make sure the projection of all environmental layers and occurrence points is the same. The order of the occurrence points should be x,y (long, lat). If you used lat, long then it is no surprise you are having problems.

Sam


Well, using QGis instead of arc fixed some of this, I'm now down to the "java.lang. ArrayIndexOutOfBoundsException " error which has been posted here 5 or 6 times without a solution that I can find. Any help on that error would be appreciated!


On Sunday, April 24, 2016 at 5:15:31 PM UTC-4, Alexander McKelvy wrote:
So, switching the order of lat/lon (irregular since it works with the bioclim data the other way around) makes the bounding box error disappear and now I get  "Warning: Sample at X, Y in myfile.csv is missing some environmental data (e.g. mydatafile) for each presence point".

 

On Saturday, April 23, 2016 at 9:47:44 AM UTC-4, Alexander McKelvy wrote:
Hi all,

I am trying to use maxent with localities and GAP landcover data (categorical). When I use bioclim data (continuous), I have no issues and can run everything I need. When I use the gap land cover data, which I have converted to ascii on both the macro and subclass levels using ESRI arcgis, I can't get it to line up with my locality points and get the error "Warning: Sample at Lon, Lat in myfile.csv is outside the bounding box of environmental data, skipping". I tried a few different things, including ensuring that my data are exported under the same projection. Is anyone else having this problem or can offer suggestions to help? I'm mostly interested in measuring variable importance at different levels among species.

Thanks
Alex
--
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.


Alexander McKelvy

unread,
Apr 27, 2016, 8:19:55 PM4/27/16
to Maxent, swam...@sbcglobal.net
Hi Sam,
Thanks for your suggestions. I'm just trying to get this single categorical layer file to work. There's only the one so it can't be different than others. Lon, Lat is format I'm using, that's not an issue. I only included the information on that before to try to troubleshoot, it's not an issue anymore. I can check the header in R to make sure the header matches the actual number of file rows and columns but I get an allocation error in R because it can't load 15gb into a vector. I'm working on a better way to do this at the moment. 

I'm wondering if there's simply a way to do this in R without using Maxent proper. I think that if I use the biomod package I can measure variable importance without extra bells and whistles, and maybe run into a more informative error message there. I've just never done that before with categorical data. 

Alex

Samuel Veloz

unread,
Apr 27, 2016, 8:28:56 PM4/27/16
to Alexander McKelvy, Maxent
Hi Alex,

In R, load a bioclim raster call it r, and your gap raster, call it r2. Then use compareRaster(r,r2). compareRaster is from the raster package. If it you get false than either extent or resolution don't match. The "extent" function is also very useful. Also just typing r and r2 will give you the header information. projection(r2) will also show the projection of the layer.

Maxent doesn't care that the gap layer is categorical. The error indicates that your samples don't fall in the same point on the map as your environmental data. Given everything you have said I am guessing that your gap layers are in a different projection, extent and or resolution than your bioclim layers.

Sam


On Wednesday, April 27, 2016 5:19 PM, Alexander McKelvy <alexm...@gmail.com> wrote:


Hi Sam,
Thanks for your suggestions. I'm just trying to get this single categorical layer file to work. There's only the one so it can't be different than others. Lon, Lat is format I'm using, that's not an issue. I only included the information on that before to try to troubleshoot, it's not an issue anymore. I can check the header in R to make sure the header matches the actual number of file rows and columns but I get an allocation error in R because it can't load 15gb into a vector. I'm working on a better way to do this at the moment. 

I'm wondering if there's simply a way to do this in R without using Maxent proper. I think that if I use the biomod package I can measure variable importance without extra bells and whistles, and maybe run into a more informative error message there. I've just never done that before with categorical data. 

Alex

On Wednesday, April 27, 2016 at 8:06:37 PM UTC-4, sdveloz wrote:
Alex,

Without seeing your data it is hard to know for sure. But the requirements are that your environmental rasters all have to have the same extent and resolution. If I had to guess, I would say your GAP landcover layer has a different extent. The header for the ASCIII file should be exactly the same as the bioclim layers. It sounds like you checked the projection but make sure the projection of all environmental layers and occurrence points is the same. The order of the occurrence points should be x,y (long, lat). If you used lat, long then it is no surprise you are having problems.

Sam


On Wednesday, April 27, 2016 2:57 PM, Alexander McKelvy <alexm...@gmail.com> wrote:


With a different set of occurances

java.lang. ArrayIndexOutOfBoundsException : -1758671516
java.lang. ArrayIndexOutOfBoundsException : -1758671516
at density.Extractor.readSamples( Extractor.java:257)
at density.Extractor. extractSamples(Extractor.java: 155)
at density.Runner. initializeGrids(Runner.java: 193)
at density.Runner.start(Runner. java:281)
at density.GUI$7.construct(GUI. java:319)
at density.SwingWorker$2.run( SwingWorker.java:108)
Reply all
Reply to author
Forward
0 new messages