Comments (4)
Happy Newyear! ;)
You have a huge grid that's mostly empty (~25M cells of which ~500k have data, so only 2%) and default Kriging probably won't handle the 500k datapoints.
I'd try at least using another cellsize (this is not necessarily in meters) to get a smaller, filled raster.
Furthermore you could tune the Kriging solver (with something like distance/max neighbors). You could also look at https://github.com/juliohm/GeoStats.jl#estimation-problems to find a less demanding solver (such as InvDistWeight).
from geoarrays.jl.
I have a different grid I am actually interested in working with, but that layer showed the same behaviour.
Here is a summary of the grid, it has some holes but not as bad as the file above.
#num missing cells
julia> count(ismissing,canopy)
14571
#num filled cells
julia> count(!ismissing,canopy)
1118743
#total grid size
julia> size(canopy)[1] * size(canopy)[2]
1133314
#% empty cells
julia> 14571/1133314*100
1.2856984030904057
I tried a couple different solvers as you suggested, they don't error but take very long. I interrupted all of these after they did not complete after 10 mins.
GeoArrays.interpolate!(canopy,InvDistWeight())
GeoArrays.interpolate!(canopy,InvDistWeight(:variable => (neighbors=3,)))#parms from tests
GeoArrays.interpolate!(canopy,LocalWeightRegress())
I am trying to replicate some default behavior from a different software that interpolates automatically.I don't know what kind of interpolation is being used. That software works on the 1m cell size, so I would prefer to keep that the same size.
I'll try to look at some parameters and/or get some @btime
info.
The layer is not that big so I am confused at the performance.
from geoarrays.jl.
By default InvDistWeight
uses all neighbors for lookup, so the complete domain, which will grow explosively (power of 4) if you go from a 100 by 100 to a 1000 by 1000 raster. You need to specify neighbors and the correct variable. Last thing could be documented better, see the source @ https://github.com/evetion/GeoArrays.jl/blob/master/src/interpolate.jl#L4
GeoArrays.interpolate!(canopy,InvDistWeight(:z => (neighbors=3,)))
GeoArrays.interpolate!(canopy, InvDistWeight(:variable => (neighbors=3,)), 1, :variable)
from geoarrays.jl.
OK, that worked.
I also needed to add a using StaticArrays
Here is a fully reproducible example that works in case someone finds it useful later:
using GeoArrays
using Random
rng = MersenneTwister(1234);
example = GeoArray(Array{Union{Missing, Float64}}(rand(rng, 500, 500)))
#~2% missing rate
for i in 1:5000
example.A[rand(rng,1:500),rand(rng,1:500)] = missing
end
count(ismissing,example)
count(!ismissing,example)
using GeoStats
using StaticArrays
using InverseDistanceWeighting
GeoArrays.interpolate!(example,InvDistWeight(:z => (neighbors=3,)))
from geoarrays.jl.
Related Issues (20)
- Accept prefixes and postfixes in the filename
- Coalesce complete GeoArray HOT 1
- Support metadata HOT 1
- Document nodata values on non-masked (lazy) bands
- Suggest renaming`interpolate!` to `fill!` HOT 2
- return indices as CartesianIndex HOT 3
- Add guidence in ReadMe as differneces (strengths/weaknesses) between GeoArrays.jl and Raster.jl HOT 3
- Type conversion HOT 1
- `affine!` or `f!` funciton HOT 2
- Should bbox return an Extent? HOT 3
- Support for warp? HOT 4
- GeoArrays.read(ga, masked=false) should probably be default HOT 4
- add support of `coords` to return a `StepRangeLen` HOT 4
- ranges produces wrong length of vector HOT 2
- Crop returns incorrect result HOT 1
- Plot example doesn't work in Julia 1.6.4 HOT 3
- Plots example from README is broken. coords method conflict HOT 1
- compat for ArchGDAL to 0.8 HOT 4
- Support rotations in plots
- Support `stepsize` in `getindex`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geoarrays.jl.