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

add reduce method to rasterize #336

Merged
merged 50 commits into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6933b9b
add reduce method to rasterize
rafaqz Nov 16, 2022
b63e3fc
polygons
rafaqz Nov 21, 2022
e4a774a
reducefunc
rafaqz Nov 21, 2022
cf47fc6
more tests
rafaqz Nov 30, 2022
9220f0e
working on iterables
rafaqz Dec 5, 2022
e9519cd
better checks in iterator rasterize
rafaqz Dec 5, 2022
bbf52de
invert :inside properly
rafaqz Dec 7, 2022
f0c3bc9
update
rafaqz Dec 7, 2022
33ec492
reorg
rafaqz Dec 18, 2022
9e850a0
update
rafaqz Dec 20, 2022
f1d2a55
f
rafaqz Dec 26, 2022
c1372f0
fix line drawing with exact integer steps
rafaqz Jan 18, 2023
94a8db3
inpoly temp fixes
rafaqz Jan 24, 2023
76e6463
performance
rafaqz Jan 31, 2023
3e2570d
performance optimisations for rasterize
rafaqz Feb 5, 2023
fb13bc9
remove show
rafaqz Feb 5, 2023
3916d85
bugfixes
rafaqz Feb 6, 2023
64d2b7a
tweak rasterize
rafaqz Feb 8, 2023
fb49ef2
no =
rafaqz Feb 9, 2023
0a46ee4
play with edges
rafaqz Feb 8, 2023
a6bcd89
coverage
rafaqz Feb 16, 2023
601e007
messages and progress bars
rafaqz Feb 20, 2023
55ea8e3
update rasterization
rafaqz Feb 28, 2023
1131d43
clean up test
rafaqz Mar 12, 2023
322f085
fix aqua
rafaqz Mar 12, 2023
3843d26
fix aggregate elsewhere
rafaqz Mar 12, 2023
1eece54
add GeometryBasics for tests
rafaqz Mar 12, 2023
3cb4dec
bugfix methods
rafaqz Mar 12, 2023
fffd062
fix nthreads and move sector locks
rafaqz Mar 12, 2023
472f736
no scratch in old julia sort
rafaqz Mar 12, 2023
3762652
add missing lock assignment
rafaqz Mar 12, 2023
94d08a4
make locks optional
rafaqz Mar 12, 2023
6df7127
fix sector locks for Raster
rafaqz Mar 12, 2023
d92481b
bugfixes
rafaqz Mar 12, 2023
da36292
fix unlock
rafaqz Mar 12, 2023
57eea16
update zonal
rafaqz Mar 26, 2023
86e0677
use touches keyword in crop extend
rafaqz Mar 26, 2023
54ff437
use dynamic threads
rafaqz Mar 26, 2023
74f5c65
bugfix
rafaqz Mar 26, 2023
c4d961e
dont test piracy
rafaqz Mar 26, 2023
22bade7
cleanup show
rafaqz Mar 27, 2023
7a9ed5b
fix replace_missing and grd tests
rafaqz Mar 27, 2023
78bedc4
more bugfix for replace_missing
rafaqz Mar 27, 2023
25c4bc5
fix
rafaqz Mar 27, 2023
c080632
bugfix rasterize
rafaqz Apr 1, 2023
ac311f5
fix coverage!
rafaqz Apr 1, 2023
3e0e82d
fix type_missingval
rafaqz Apr 1, 2023
a6a1c71
bufgix rasterize docs
rafaqz Apr 1, 2023
81b28e6
doctest fixes
rafaqz Apr 1, 2023
af33672
update docs
rafaqz Apr 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove show
  • Loading branch information
rafaqz committed Mar 26, 2023
commit fb13bc9a0ab4e52f733e396687976a8d7a4650de
1 change: 0 additions & 1 deletion src/methods/rasterize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ function _rasterize!(x, trait::Nothing, geoms::AbstractVector;
Threads.@threads for i in eachindex(geoms)
geom = geoms[i]
fill = _getfill(fill_itr, i)
@show fill
_rasterize!(x, GI.trait(geom), geom; kw..., fill, op, init)
end
end
Expand Down
22 changes: 16 additions & 6 deletions test/methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,22 @@ end
end

# Rasters vs GDAL performance
# using Rasters
# using BenchmarkTools
# using ProfileView
# using Shapefile
# using Plots
using Rasters
using BenchmarkTools
using ProfileView
using Shapefile
using Plots
shppath = "/home/raf/PhD/Mascarenes/Data/Distributions/MAMMALS_TERRESTRIAL_ONLY/MAMMALS_TERRESTRIAL_ONLY.shp"
shptable = Shapefile.Table(shppath)
@time mammal_count = rasterize(count, shptable; res=1/6, boundary=:center);
plot(mammal_count)
savefig("mammal_count.png")

@time mammal_count_touches = rasterize(count, shptable; res=1/6, boundary=:touches);
plot(mammal_count_touches)

@time mammal_count = rasterize(miminum, shptable; fill=:SHAPE_Area, res=1/6, boundary=:center);

# function rasters_read_rasterize(shp; boundary=:touches)
# shx = splitext(shp)[1] * ".shx"
# shphandle = Shapefile.Handle(shp, shx)
Expand All @@ -614,7 +625,6 @@ end
# size=(250, 250), fill, missingval=0, boundary
# )
# end
# shp = "/home/raf/PhD/Mascarenes/Data/Distributions/MAMMALS_TERRESTRIAL_ONLY/MAMMALS_TERRESTRIAL_ONLY.shp"
# shp = "/home/raf/PhD/Mascarenes/Data/Distributions/REPTILES/REPTILES.shp"
# shp = "/home/raf/PhD/Mascarenes/Data/Distributions/AMPHIBIANS/AMPHIBIANS.shp"
# @profview
Expand Down