Skip to content

Commit 96b6a2c

Browse files
authored
Fix errors when building docs (#322)
1 parent b055689 commit 96b6a2c

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

src/methods/barycentric.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export MeanValue
2626
# This example was taken from [this page of CGAL's documentation](https://doc.cgal.org/latest/Barycentric_coordinates_2/index.html).
2727
#=
2828
```@example barycentric
29-
import GeometryOps as GO
30-
using Makie, CairoMakie, GeoInterfaceMakie
29+
import GeometryOps as GO, GeoInterface as GI
30+
using CairoMakie, GeoInterfaceMakie # plotting
3131
# Define a polygon
3232
polygon_points = Point3f[
3333
(0.03, 0.05, 0.00), (0.07, 0.04, 0.02), (0.10, 0.04, 0.04),
@@ -84,10 +84,10 @@ cb = Colorbar(f[2, :], p1.plots[1]; vertical = false, flipaxis = true)
8484
xrange = LinRange(ext.X..., 400)
8585
yrange = LinRange(ext.Y..., 400)
8686
@time mean_values = GO.barycentric_interpolate.(
87-
(MeanValue(),), # The barycentric coordinate algorithm (MeanValue is the only one for now)
88-
(Point2f.(polygon_points),), # The polygon points as `Point2f`
87+
(GO.MeanValue(),), # The barycentric coordinate algorithm (MeanValue is the only one for now)
88+
((polygon_points),), # The polygon points as `Point2f`
8989
(last.(polygon_points,),), # The values per polygon point - can be anything which supports addition and division
90-
Point2f.(xrange, yrange') # The points at which to interpolate
90+
tuple.(xrange, yrange') # The points at which to interpolate
9191
)
9292
# and render!
9393
hm = heatmap!(a2, xrange, yrange, mean_values; colormap = p1.colormap, colorrange = p1.plots[1].colorrange[], xautolimits = false, yautolimits = false)

src/methods/convex_hull.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Future work could include other algorithms, such as [Quickhull.jl](https://githu
1919
import GeometryOps as GO, GeoInterface as GI
2020
using CairoMakie # to plot
2121
22-
points = randn(GO.Point2f, 100)
22+
points = tuple.(randn(100), randn(100))
2323
f, a, p = plot(points; label = "Points")
2424
hull_poly = GO.convex_hull(points)
2525
lines!(a, hull_poly; label = "Convex hull", color = Makie.wong_colors()[2])
@@ -59,7 +59,7 @@ most algorithms are robust to that, and you can always [`fix`](@ref) it...
5959
import GeoInterface as GI, GeometryOps as GO, LibGEOS as LG
6060
using CairoMakie # to plot
6161
62-
points = rand(Point2{Float64}, 100)
62+
points = tuple.(rand(100), rand(100))
6363
go_hull = GO.convex_hull(GO.MonotoneChainMethod(), points)
6464
lg_hull = GO.convex_hull(GO.GEOS(), points)
6565

src/methods/distance.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ To provide an example, consider this rectangle:
1818
```@example rect
1919
import GeometryOps as GO
2020
import GeoInterface as GI
21-
using Makie
22-
using CairoMakie
21+
using CairoMakie, GeoInterfaceMakie
2322
2423
rect = GI.Polygon([[(0,0), (0,1), (1,1), (1,0), (0, 0)]])
2524
point_in = (0.5, 0.5)
@@ -43,8 +42,8 @@ GO.signed_distance(point_out, rect) # > 0
4342
Consider also a heatmap of signed distances around this object:
4443
```@example rect
4544
xrange = yrange = LinRange(-0.5, 1.5, 300)
46-
f, a, p = heatmap(xrange, yrange, GO.signed_distance.(Point2f.(xrange, yrange'), Ref(rect)); colormap = :RdBu, colorrange = (-0.75, 0.75))
47-
a.aspect = DataAspect(); Colorbar(f[1, 2], p, label = "Signed distance"); lines!(a, GI.convert(GO.GeometryBasics, rect)); f
45+
f, a, p = heatmap(xrange, yrange, GO.signed_distance.(tuple.(xrange, yrange'), (rect,)); colormap = :RdBu, colorrange = (-0.75, 0.75))
46+
a.aspect = DataAspect(); Colorbar(f[1, 2], p, label = "Signed distance"); lines!(a, rect); f
4847
```
4948
5049
## Implementation

0 commit comments

Comments
 (0)