Closed mingatgithub closed 4 months ago
and I'm using R 4.3.1, for your information
Hi, thank you for highlighting this bug ! It has been fixed in the new master version, I just uploaded the patch (version 1.2.2) to CRAN. I'll let you know when it is online.
Hi, thank you for highlighting this bug ! It has been fixed in the new master version, I just uploaded the patch (version 1.2.2) to CRAN. I'll let you know when it is online.
Thank you so much for your prompt responses!
I am sorry for bothering you again. The debugged version worked fine with Use Case 3, however, it stopped running when I substituted it with my own tif. It threw:
struct <- flsgen_extract_structure_from_raster(raster_file=path,
focal_classes=c(1),
connectivity = 8)
dem_path <- "./00_rawdata/dem_20m.tif"
terrain_dem <- terra::rast(dem_path)
r <- flsgen_generate(struct, terrain_file = terrain_dem,
epsg = "EPSG:32611", connectivity=8,
resolution_x = 20,
resolution_y = 20,
x = 344207.2, y = 5565088,
verbose=FALSE)
# Error in .jcall(generator, "Z", "generate", terrain_dependency, as.integer(max_try), :
# java.lang.NullPointerException
I have checked the input rasters have identical projection (EPSG:32611) and resolution. Still can't figure out the reseason. For your information, I attached the two input rasters in the following. Archive.zip
Best regards, Ming
I'm following up with my solution: the extent of terrain raster should be 100% identical with the corresponding landscape raster.
Thank you all the same! Ming
Hi, so it was a raster dimension problem ? Thank you again for pointing this out, I will add a input check to ensure that other users get a more informative error message !
Hi, so it was a raster dimension problem ? Thank you again for pointing this out, I will add a input check to ensure that other users get a more informative error message !
Yes, I bet that the xmin, xmax, ymax, and ymin of terrain rasters should be totally same as the landscape raster's. I re-clipped the terrain raster and it worked. Hope it helps!
Thank you, Ming
Dear Dr. Dimitri,
Thank you for your excellent work on this super helpful R package. I am new to rflsgen and learnt to use it by following your use cases. In Use Case 3, I was not able to recreate a neutral landscape based on the terrain.
I got
I've tried the script on both Mac M3 and Windows 11 but got the same outcome. my environment: rflsgen 1.2.1 rJava 1.0-11 jdk-16.0.2.jdk (Mac)
Thank you so much in advance, Ming