GeoMOER / geoAI

Module on geospatial data prediction and remote sensing of the Honour Degree Programm „AI und Entrepreneurship"
MIT License
0 stars 0 forks source link

GeoAI_2021_unit_01_EX_Warm_up_R-spatial #1

Open Baldl opened 2 years ago

Baldl commented 2 years ago

2 - check CRS and other info

-----------------------

raster::crs(rasterStack) raster::crs(buildings)

->I think here we need to put "orchards" instead of "buildings", right?

crs(rasterStack) == crs(buildings)

->here as well

Baldl commented 2 years ago

raster::crs(orchards)

-> also, here I get "NA" as result.. so this "crs(rasterStack) == crs(orchards)" also doesn't work

Baldl commented 2 years ago

Unit 01 - EX | Warm Up R-spatial Step 5 - Save the results for later usage 5 - stack and save as RDS

-----------------------

marburg_stack <- stack(rasterStack, rgbI)

saveRDS(marburg_stack, (file.path(envrmt$data_processed, "dop_indices.rds"))

The closing bracket is missing. And there is the following error: Error in if (file == "") stop("'file' must be non-empty string") : argument is of length zero

katharinakiem commented 2 years ago

Should we include the exercises from the chapters from Lovelace to our PDF file?

gisma commented 2 years ago

If you like you can do so. I think it is a good training for producing Rmarkdown based documentation, even if it is not urgently necessary.

Muenchj4 commented 2 years ago

I tried to get the tif File, but I got following message: Response [http://85.214.102.111/geo_data/data/01_raw_data/aerial/marburg_dop.tif] Date: 2021-11-25 20:27 Status: 401 Content-Type: text/html; charset=iso-8859-1 Size: 461 B <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

401 Unauthorized

Unauthorized

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply How can I fix this problem?

gisma commented 2 years ago

@Muenchj4 like always I need the commands u have used... most obously you did not provide the correct credentials. Try to download the data manually and it is a good idea to use an incognito window for haveing a wiped cache.

Muenchj4 commented 2 years ago

@gisma I now have used the correct credentials and I got a response, but obviously it did not write into the folder. So I got the message: "Error in h(simpleError(msg, call)) : Fehler bei der Auswertung des Argumentes 'x' bei der Methodenauswahl für Funktion 'stack': object 'marburg_dop.tif' not found"

Muenchj4 commented 2 years ago

@gisma I have used these commands:

require(envimaR)

# MANDANTORY: defining the root folder DO NOT change this line
rootDIR = "C:/Users/jomue/edu/geoAI"

#-- Further customization of the setup by the user this section 
#-- can be freely customized only the definition of additional packages 
#-- and directory paths MUST be done using the two variables 
#-- appendpackagesToLoad and appendProjectDirList
#-- feel free to remove this lines if you do not need them
# define  additional packages uncomment if necessary
appendpackagesToLoad = c("httr")
# define additional subfolders uncomment if necessary
# appendProjectDirList =  c("data/dymmy-folder/")

# MANDANTORY: calling the setup script also DO NOT change this line
source(file.path(envimaR::alternativeEnvi(root_folder = rootDIR),"src/geoAI_setup.R"),echo = TRUE)

# 1 - start script
#-----------------------------
geoai_user= "geoai"
pw="ck@jx|xc?m2w"
httr::GET("http://85.214.102.111/geo_data/data/01_raw_data/aerial/marburg_dop.tif", 
          authenticate(geoai_user,pw),
          write_disk = (destfile=file.path(envrmt$path_data_data,"marburg_dop.tif", sep="/")))
Then I tryed to get a rater stack with rasterStack = raster::stack(file.path(envrmt$data/marburg_dop.tif)),

but he could not find the object. It is not in the folder, obviously. Can you imagine, why?

Muenchj4 commented 2 years ago

@gisma this problem is solved now. But there is a new problem: Trying to save a marburg_stack failed, since the rasterStack and the RGBI have got different extent.

gisma commented 2 years ago

You have to crop or resample it. Good night

Muenchj4 commented 2 years ago

I´l try it. Good night. Zitat von Chris Reudenbach @.***>:

You have to crop or resample it. Good night

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/GeoMOER/geoAI/issues/1#issuecomment-979591629

Muenchj4 commented 2 years ago

@gisma @Baldl @dirkzeuss I tried to login at copernicus. But it failed. I tried to reset my password, but it failed again. Does anybody know what the problem could be? I am really sure to have written the password correct.

Muenchj4 commented 2 years ago

@gisma Besides I tryed to a sentinel retrieval object and got following Error: [2021-11-27 21:12:35] #### Starting sen2r execution. #### Error in all(is.na(pm$extent)) || length(nn(pm$extent)) == 0 : invalid 'x' type in 'x || y'

gisma commented 2 years ago

@Muenchj4
regarding Copernicus - no idea maybe check here regarding sentinel retrieval I think the error indicates a wron or missing extent probably due to referenced file you use.