juliageo / geodatasets.jl Goto Github PK
View Code? Open in Web Editor NEWCommon geographic data sets
License: MIT License
Common geographic data sets
License: MIT License
Thanks for making this excellent package!
I've been playing around with the land-sea mask data a bit and have found creating a small wrapper type around it to add convenience functionality like
is_land(mask::LandSeaMask, lat::Real, lon::Real)
to be quite helpful. Is there a natural existing home for this within the JuliaGeo
ecosystem, or should I create a new (very small) package? Would this package be an appropriate home for such a type, or is that kind of thing out of scope for this package?
Hi,
I'd love to use the land mask to identify if various points are over water or over land. But I ran into an issue. I'm a terrible coder, so I may just be doing something wrong or I'm just not fully understanding what is happening. But here's a MWE of the issue I ran into.
using GeoDatasets
mask = GeoDatasets.LandSeaMask(; resolution='f')
GeoDatasets.is_land(mask, 0.0, 180.0) # This would give me an answer
GeoDatasets.is_land(mask, 0.0, -179.87) # This would also give me an answer
GeoDatasets.is_land(mask, 0.0, -179.88) # This would give me the error below
ERROR: BoundsError: attempt to access 4320×2160 Matrix{UInt8} at index [0, 1080]
Stacktrace:
[1] getindex
@ ./array.jl:862 [inlined]
[2] nearest_point
@ ~/.julia/packages/GeoDatasets/8HX2S/src/land_sea_mask.jl:74 [inlined]
[3] is_land(mask::GeoDatasets.LandSeaMask{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, Matrix{UInt8}}, lat::Int64, lon::Float64)
@ GeoDatasets ~/.julia/packages/GeoDatasets/8HX2S/src/land_sea_mask.jl:70
[4] top-level scope
@ REPL[25]:1
It seems like any value below -179.87501
(i.e., -179.87502
; pardon the excessive decimals, I was experimenting) would produce the error above. And for the line in the error message: ERROR: BoundsError: attempt to access 4320×2160 Matrix{UInt8} at index [0, 1080]
, the first index can be 0
or -1
depending on how close the longitude is to -180
.
Is this expected behavior? Am I doing anything wrong? Or is this a bug?
I'm using Julia 1.7.1 and GeoDataset 0.1.8
Thanks!
they are crashed by the same error:
1.
julia> pcolormesh(lon,lat,data')
libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
.....
julia> contour(lon,lat,data',[0.5],colors=[[0.2,0.2,0.2]],linewidths=0.5)
libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
signal (11): 段错误
in expression starting at REPL[10]:1
unknown function (ip: 0x7f9b3142f563)
unknown function (ip: 0x7f9b314372db)
_dl_catch_exception at /build/glibc-4WA41p/glibc-2.30/elf/dl-error-skeleton.c:196
unknown function (ip: 0x7f9b314369b9)
do_dlopen at /build/glibc-4WA41p/glibc-2.30/elf/dl-libc.c:96
_dl_catch_exception at /build/glibc-4WA41p/glibc-2.30/elf/dl-error-skeleton.c:196
_dl_catch_error at /build/glibc-4WA41p/glibc-2.30/elf/dl-error-skeleton.c:215
dlerror_run at /build/glibc-4WA41p/glibc-2.30/elf/dl-libc.c:46 [inlined]
__libc_dlopen_mode at /build/glibc-4WA41p/glibc-2.30/elf/dl-libc.c:195
init at /build/glibc-4WA41p/glibc-2.30/debug/backtrace.c:53
__pthread_once_slow at /lib/x86_64-linux-gnu/libpthread.so.0 (unknown line)
__backtrace at /build/glibc-4WA41p/glibc-2.30/debug/backtrace.c:106
check_callers.part.0 at /home/lxc/anaconda3/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-x86_64-linux-gnu.so (unknown line)
can_elide_temp_unary at /home/lxc/anaconda3/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-x86_64-linux-gnu.so (unknown line)
array_invert at /home/lxc/anaconda3/lib/python3.7/site-packages/numpy/core/_multiarray_umath.cpython-37m-x86_64-linux-gnu.so (unknown line)
_PyEval_EvalFrameDefault at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalCodeWithName at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyFunction_FastCallKeywords at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
call_function.lto_priv.1537 at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalFrameDefault at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
function_code_fastcall at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
call_function.lto_priv.1537 at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalFrameDefault at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalCodeWithName at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyFunction_FastCallDict at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyObject_Call_Prepend at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyObject_Call at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalFrameDefault at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalCodeWithName at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyFunction_FastCallDict at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyObject_Call_Prepend at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
slot_tp_init at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
type_call.lto_priv.152 at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyObject_Call at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalFrameDefault at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalCodeWithName at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyFunction_FastCallDict at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalFrameDefault at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalCodeWithName at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyFunction_FastCallDict at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyObject_Call_Prepend at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
PyObject_Call at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalFrameDefault at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyEval_EvalCodeWithName at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
_PyFunction_FastCallDict at /home/lxc/anaconda3/lib/libpython3.7m.so.1.0 (unknown line)
macro expansion at /home/lxc/.julia/packages/PyCall/ttONZ/src/exception.jl:81 [inlined]
__pycall! at /home/lxc/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:44
_pycall! at /home/lxc/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:29
_pycall! at /home/lxc/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:11
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2141 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
#pycall#110 at /home/lxc/.julia/packages/PyCall/ttONZ/src/pyfncall.jl:86
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2141 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
jl_f__apply at /buildworker/worker/package_linux64/build/src/builtins.c:627
#pycall at ./none:0
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2141 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
jl_f__apply at /buildworker/worker/package_linux64/build/src/builtins.c:627
#contour#33 at /home/lxc/.julia/packages/PyPlot/4wzW1/src/PyPlot.jl:177
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2141 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
jl_f__apply at /buildworker/worker/package_linux64/build/src/builtins.c:627
#contour at ./none:0
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2141 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:328
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:417
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:368 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:778
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:888
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f9af4670b0f)
unknown function (ip: 0x8)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:897
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:814
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:764
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:843
eval at ./boot.jl:330
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2135 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86
run_backend at /home/lxc/.julia/packages/Revise/S7mrl/src/Revise.jl:1057
#85 at ./task.jl:333
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2141 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:659
unknown function (ip: 0xffffffffffffffff)
Allocations: 50524503 (Pool: 50511514; Big: 12989); GC: 53
julia> versioninfo()
Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Environment:
JULIA_NUM_THREADS = 4
JULIA_REVISE = manual
My system version is Ubuntu 19.10
shell> uname -a
Linux lxc-PC 5.3.0-24-generic #26-Ubuntu SMP Thu Nov 14 01:33:18 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
I've been having some issues getting RemoteFiles
' curl backend to work to download the gshhg
shape file (it hangs, no idea why), but HTTP
seems to be working fine. To figure this out, I had to ]dev --local
RemoteFiles
and change some things.
It looks like RemoteFile
s exposes a download
function that accepts a backend as an argument. I wonder therefore whether it would be a good idea to let users interact with that function when asking for the data in GeoDatasets
? Perhaps a keyword argument whose default sticks with the current behaviour or something?
I also wonder whether DataDeps.jl
wouldn't make more sense for this project than RemoteFiles.jl
because the data you're working with is largely static. Is this something that has been considered already?
Would the maintainers be interested in a PR adding this ocean basin mask data set?
https://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NODC/.WOA09/.Masks/.basin/index.html?Set-Language=en
Alternatively, if there's a better mask data source (this is my first time doing this particular bit of work, so I could well have missed whatever it is that is usually used) also happy to work with that!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.