Model-R / modleR_shiny_app

The shiny application for modleR, an ecological niche model workflow based on dismo()
10 stars 6 forks source link

Error:extents do not overlap #14

Open dpoursanidis opened 6 years ago

dpoursanidis commented 6 years ago

Dear developers

First of all, congrats for this work. Is what i was looking for use as it give me easy to use tools. I have data that i use in maxent modelling with no issue. Using your package and loading my enviro data (tiff format), i receive this error.

What is possible to cause it in the app ?

FelipeSBarros commented 6 years ago

Dear @dpoursanidis, thanks for four contact! Could you provide the layers you are trying to use? Or perhaps, certify if all environmental layers have the same pixel size, are aligned and are in the same coordinate reference system? I`ll be looking for possible causes, and to check the package as soon as possible.

dpoursanidis commented 6 years ago

Hi Felipe

Here are the data > https://www.dropbox.com/sh/rzvigrp5ir7am8f/AACW7luidL1XJH9qZT0arCmwa?dl=0 At an other computer (windows 10 all tested) the data (same) in the folder "outros" were not recognized. The same data are used in MaxEnt GUI with no prob at all (good test to check the enviro data).

Looking forward

Dimitris

FelipeSBarros commented 6 years ago

@dpoursanidis, I hadn't time enough to look all your environmental data, but the two I could check (bathy y uno de los biogeo*) seems OK. So, until we could check everything, would be important to have more information of the parameters used. Feel free to paste is in this issue so we can reproduce de error. Best regards

dpoursanidis commented 6 years ago

image

That is the status now and these are the data @ the folder

image and this is at the rstudio console

Checando...
presente: C:/Users/dpour/Documents/GitHub/Model-R/Model-R/ex/outros/ Checando...

FelipeSBarros commented 6 years ago

Dear @dpoursanidis . I will be working on this issue in the next days. As soon as I understand what is going on, or fix it, I share here. Best regards

Felipe

FelipeSBarros commented 6 years ago

@dpoursanidis , About using your own environmental raster data: You must put all raster data in the folder Model-R/Model-R/ex/outros (image 1); For now, don't use any subfolder on 'outros'. otherwise you will get an error; We will work on that as we find a pertinent time.

image1

About the error mentioned on issue name: As far as I could see the error "extents do not overlap" occurs when you set an extent that is not compatible with the extent of the environmental raster data. Analyzing one of the environmental raster data you shared, I found that its extent is (so, I suppose that all other environmental raster data have the same pixel size, origin and are aligned.: will have the same information as shown):

Driver: GTiff/GeoTIFF
Files: Model-R/ex/outros/bathy_30s.tif
Size is 13970, 10041
Coordinate System is `'
Origin = (-5.783333333333400,45.791666666665670)
Pixel Size = (0.008333333333333,-0.008333333333333)
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  -5.7833333,  45.7916667) 
Lower Left  (  -5.7833333, -37.8833333) 
Upper Right ( 110.6333333,  45.7916667) 
Lower Right ( 110.6333333, -37.8833333) 
Center      (  52.4250000,   3.9541667) 
Band 1 Block=128x128 Type=Int32, ColorInterp=Gray
  NoData Value=-2147483647

According to the information above, your raster data (more specifically, "bathy" raster data) has as longitude left: -5; longitude right: 110; latitude higher: 45 and latitude lower: -37;

So, I've tested here, and when I leave the default extent (longitude left: -90; longitude right: -32; latitude higher: 23 and latitude lower: -33) the error occurs; But when I set the extent to the extent of the bathy data (gain: longitude left: -5; longitude right: 110; latitude higher: 45 and latitude lower: -37) this specific error doesn't appears.

In this analysis I had to use a virtual machine, so I couldn't finish the process because I couldn't allocate the amount of memory necessary; Please, let us know if you find any other error or problem. We will work on documentation to make everything clear. Best regards

Felipe

dpoursanidis commented 6 years ago

Hi Felipe Thanks for the solutions but ... i have correct all you mention, i have in "outros" folder the data and now (almost 4 hours) i have this status >

image

Any clue ? RAM issues (but no message yet - i have 8G and the data are 137 mb ) ?

FelipeSBarros commented 6 years ago

@dpoursanidis , osrry for the belated answer. I'm not used with Windows, but I did a test here and worked fine. Probably, the steps should be:

  1. Before starting the app, create and insert your climate variable in the folder "outros", following the path: Model-R/ex/outros
  2. Start the app, load occurrence points;
  3. Set the extent, as mentioned above; I just realized now that, you should set the extent to project extent too even if you won't work with projection; (we will work on that when possible)
  4. Then, in abiotic data you can choose 'outros'. As soon as you choose outros, you should see your layers there, as shown in the image:

image

  1. After clicking on Update Selected (it will take a wile, because of the correlation analysis) , you should see your environmental data:

image

Resoults of correlation analysis (between bathy and biogeo08):
image

All this with the "standart" species : Caesalpinia echinata;

Let me know if you could solve your problem. Cheers

Felipe

dpoursanidis commented 6 years ago

All steps followed - still at the same point

Rstudio has these >

Listening on http://127.0.0.1:6320 Warning: Error in if: argument is of length zero Stack trace (innermost first): 79: renderDataTable [C:\Users\dpour\Documents\GitHub\Model-R\Model-R/server.R#2460] 78: func 77: origRenderFunc 76: output$dgbriddadosdatacleaning 1: runApp Checando...
presente: C:/Users/dpour/Documents/GitHub/Model-R/Model-R/ex/outros/ Checando...

What the errors are about ? Do you have similar messages @ rstudio ?

FelipeSBarros commented 6 years ago

Hum... I have no idea what could be causing this error. To solve, we e I'll need to reproduce it. And as I showed before, there was no error on my tests. Could you provide more information? Like, occurrence dataset, and any other thing you thing can be related with this error? By the way, what is shown is a warning and not an error, right? What do you get on rstudio?

FelipeSBarros commented 6 years ago

Another's point that would be interesting to know, @dpoursanidis is of you could do all the modeling process with the standard dataset (worldclim and Caesalpinia echinata).

dpoursanidis commented 6 years ago

Using the standard dataset image error > cannot open the connection

FelipeSBarros commented 6 years ago

@dpoursanidis itss weird because I got a connection error, but I believe that the reason was a problem when connection to Rio de Janeiro Botanical Garden to retrieve occurrences. As I changed to GBIF, I could go thru the processes using Bioclim algorithm. A few errors apeared but I could finish the process.

I'm sorry, but I don't know how to help. Let see if @AndreaSanchezTapia @diogosbr can help some how. Best regards

Felipe

dpoursanidis commented 6 years ago

Dear Felipe I change data to other that i use. Again the same issue. What i check is if something is masked during the load of ui.R file See the attached file that contains what RStudio show when the ui.R or server.R files are loaded in. ModelR_loadinfo.txt

FelipeSBarros commented 6 years ago

@dpoursanidis , today I tried again to do de modeling process using all the default configurations. Which I think we shoukd focus to understando what error are you having and in which step of the process. By doing so, I could realize that trying to obtain Caesalpinia echinata occurences from "Jabot - Banco de dados do JBRJ" isn't working [for me]. This results in an error of connection, similar than one yout told us: cannot open the connection. I hadn't time to search for the source of this error. Changing the source of the data to GBIF, all went fine. So, I believe we are facing a connection problem with JBRJ (Rio de Janeir Botanical Garden). So, I went ahead with the data obtained from GBIF. After a small data cleanning and selecting a few environmental layers I could run all modeling algorithms but MaxEnt (due to a problem with rJava) and RandomForest (because I had occurences falling out from the environmental layers leading to NA values - which are not acepted by RandomForest); In this process I got an error which, I believe, is related to leaflet map addCircles requires numeric longitude/latitude values, because when changing to outputs tab, I got all modeling results.

As you can see, there are a few bug to be fixed to get all the process smooth. But the way it is still being functional.

Could you try modeling Caesalpinia echinata with worldclim data and summarize us where you got errors, just like I did? cheers Felipe

dpoursanidis commented 6 years ago

Hi Felipe I will test default data and will come back next week. D.