@@ -29,8 +29,8 @@ You can see that this geometry was segmentized correctly, and now has 8 vertices
29
29
Now, we'll also segmentize this using the geodesic method, which is more accurate for lat/lon coordinates.
30
30
31
31
```@example segmentize
32
- using Proj # required to activate the `GeodesicSegments ` method!
33
- geodesic = GO.segmentize(GO.GeodesicSegments(max_distance = 1000 ), rectangle)
32
+ using Proj # required to activate the `Geodesic ` method!
33
+ geodesic = GO.segmentize(GO.Geodesic( #= ellipsoid params here =# ), rectangle; max_distance = 1000 )
34
34
length(GI.getpoint(geodesic) |> collect)
35
35
```
36
36
This has a lot of points! It's important to keep in mind that the `max_distance` is in meters, so this is a very fine-grained segmentation.
@@ -40,18 +40,19 @@ Now, let's see what they look like! To make this fair, we'll use approximately
40
40
```@example segmentize
41
41
using CairoMakie
42
42
linear = GO.segmentize(rectangle; max_distance = 0.01)
43
- geodesic = GO.segmentize(GO.GeodesicSegments( ; max_distance = 1000), rectangle )
43
+ geodesic = GO.segmentize(GO.Geodesic(), rectangle ; max_distance = 1000)
44
44
f, a, p = poly(collect(GI.getpoint(linear)); label = "Linear", axis = (; aspect = DataAspect()))
45
45
p2 = poly!(collect(GI.getpoint(geodesic)); label = "Geodesic")
46
46
axislegend(a; position = :lt)
47
47
f
48
48
```
49
49
50
- There are two methods available for segmentizing geometries at the moment:
50
+ There are two methods available for segmentizing geometries at the moment,
51
+ and you can invoke them by passing the relevant [`Manifold`](@ref):
51
52
52
- ```@docs
53
- LinearSegments
54
- GeodesicSegments
53
+ ```@docs; canonical=false
54
+ Planar
55
+ Geodesic
55
56
```
56
57
57
58
## Benchmark
@@ -92,11 +93,11 @@ for scalefactor in exp10.(LinRange(log10(0.1), log10(10), 5))
92
93
geo_dist = init_geo * scalefactor
93
94
94
95
npoints_linear = GI.npoint(GO.segmentize(rectangle; max_distance = lin_dist))
95
- npoints_geodesic = GO.segmentize(GO.GeodesicSegments( ; max_distance = geo_dist), rectangle) |> GI.npoint
96
+ npoints_geodesic = GI.npoint( GO.segmentize(GO.Geodesic(), rectangle ; max_distance = geo_dist))
96
97
npoints_libgeos = GI.npoint(densify(lg_rectangle, lin_dist))
97
98
98
- segmentize_suite["Linear"][npoints_linear] = @be GO.segmentize(GO.LinearSegments( ; max_distance = $lin_dist), $rectangle ) seconds=1
99
- segmentize_suite["Geodesic"][npoints_geodesic] = @be GO.segmentize(GO.GeodesicSegments( ; max_distance = $geo_dist), $rectangle ) seconds=1
99
+ segmentize_suite["Linear"][npoints_linear] = @be GO.segmentize($( GO.Planar()), $rectangle ; max_distance = $lin_dist) seconds=1
100
+ segmentize_suite["Geodesic"][npoints_geodesic] = @be GO.segmentize($( GO.Geodesic()), $rectangle ; max_distance = $geo_dist) seconds=1
100
101
segmentize_suite["LibGEOS"][npoints_libgeos] = @be densify($lg_rectangle, $lin_dist) seconds=1
101
102
102
103
end
@@ -110,6 +111,9 @@ abstract type SegmentizeMethod end
110
111
"""
111
112
LinearSegments(; max_distance::Real)
112
113
114
+ !!! warning
115
+ This is deprecated - call `segmentize(Planar(), geom; max_distance)` instead.
116
+
113
117
A method for segmentizing geometries by adding extra vertices to the geometry so that no segment is longer than a given distance.
114
118
115
119
Here, `max_distance` is a purely nondimensional quantity and will apply in the input space. This is to say, that if the polygon is
123
127
"""
124
128
GeodesicSegments(; max_distance::Real, equatorial_radius::Real=6378137, flattening::Real=1/298.257223563)
125
129
130
+ !!! warning
131
+ This is deprecated - call `segmentize(Geodesic(; semimajor_axis, inv_flattening), geom; max_distance)` instead.
132
+
126
133
A method for segmentizing geometries by adding extra vertices to the geometry so that no segment is longer than a given distance.
127
134
This method calculates the distance between points on the geodesic, and assumes input in lat/long coordinates.
128
135
0 commit comments