Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia/Omniscape not recognizing files [Solved: ini file mistake - no source specified] #147

Closed
beardant opened this issue Jan 6, 2024 · 2 comments

Comments

@beardant
Copy link

beardant commented Jan 6, 2024

I have tried with various computers, and in various folders, to run Omniscape but I keep getting the same error:
I'm using Julia 1.8.4.

Please find here the necessary files;

omni_ex.zip

julia> using Omniscape
julia> run_omniscape("C:\\omni\\settingss.ini")

ERROR: the file "" does not exist
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] read_raster
   @ C:\Users\merijnb\.julia\packages\Omniscape\9gHf2\src\io.jl:14 [inlined]
 [3] run_omniscape(path::String)
   @ Omniscape C:\Users\merijnb\.julia\packages\Omniscape\9gHf2\src\main.jl:448
 [4] top-level scope
   @ REPL[6]:1

The 'settingss.ini' file has the following:

[Required]
resistance_file = C:/omni/resras.tif
radius = 30
block_size = 3
project_name = C:/omni/omnibear

[General options]
source_from_resistance = false
r_cutoff = Inf
calc_normalized_current = true

parallelize = true
parallel_batch_size = 10

[Output options]
write_raw_currmap = true
write_as_tif = true

C:/omni/resras.tif is an existing file, while C:/omni/omnibear should be created automatically if I'm not mistaken.
I've also tried writing them with backslash () instead of slash (/) but that didn't make a difference.

Note that when I intentionally misspell the raster file in the settingss.ini, I get a different error:
ERROR: the file "C:\Bears3\omni\resrasssss.tif" does not exist"

@beardant
Copy link
Author

beardant commented Jan 8, 2024

With help of Vincent, the solution has been found.
My settings file did not specify a source file, but also did not specify
source_from_resistance = true

Therefore Julia did in fact find my resistance raster, but it kept looking for a source filet that was not there.

@beardant beardant changed the title Julia/Omniscape not recognizing files Julia/Omniscape not recognizing files [Solved: ini file mistake - no source specified] Jan 8, 2024
@vlandau
Copy link
Member

vlandau commented Jan 8, 2024

Let's leave this open for now, as a reminder for me to get around to better warning/error throws. I'll do this at the same time that I handle #145, and alternatively add some things to handle #146.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants