From ef26d32a5b723e473698ba3ffa0ecbec0c6f77cd Mon Sep 17 00:00:00 2001 From: spaette Date: Fri, 19 Jul 2024 15:18:29 -0500 Subject: [PATCH] typos --- docs/src/tutorials/creating_geometry.md | 4 ++-- ext/GeometryOpsProjExt/reproject.jl | 2 +- src/methods/angles.jl | 4 ++-- src/methods/area.jl | 4 ++-- src/methods/centroid.jl | 2 +- src/methods/clipping/clipping_processor.jl | 18 ++++++++--------- src/methods/clipping/coverage.jl | 2 +- src/methods/clipping/cut.jl | 2 +- src/methods/clipping/difference.jl | 6 +++--- src/methods/clipping/intersection.jl | 14 ++++++------- src/methods/clipping/union.jl | 6 +++--- src/methods/distance.jl | 2 +- src/methods/equals.jl | 10 +++++----- src/methods/geom_relations/contains.jl | 4 ++-- src/methods/geom_relations/coveredby.jl | 4 ++-- src/methods/geom_relations/covers.jl | 2 +- src/methods/geom_relations/disjoint.jl | 2 +- .../geom_relations/geom_geom_processors.jl | 20 +++++++++---------- src/methods/geom_relations/overlaps.jl | 10 +++++----- src/methods/geom_relations/touches.jl | 16 +++++++-------- src/methods/polygonize.jl | 4 ++-- src/primitives.jl | 18 ++++++++--------- .../correction/intersecting_polygons.jl | 2 +- src/transformations/reproject.jl | 6 +++--- src/transformations/simplify.jl | 14 ++++++------- src/transformations/transform.jl | 2 +- test/data/polygon_generation.jl | 2 +- test/methods/centroid.jl | 2 +- test/methods/clipping/coverage.jl | 4 ++-- test/methods/clipping/polygon_clipping.jl | 16 +++++++-------- test/methods/distance.jl | 2 +- test/methods/geom_relations.jl | 4 ++-- .../correction/intersecting_polygons.jl | 2 +- 33 files changed, 106 insertions(+), 106 deletions(-) diff --git a/docs/src/tutorials/creating_geometry.md b/docs/src/tutorials/creating_geometry.md index a7838b8d9..dfcd2abf6 100644 --- a/docs/src/tutorials/creating_geometry.md +++ b/docs/src/tutorials/creating_geometry.md @@ -186,7 +186,7 @@ Read the land `MultiPolygon`s as a `GeoJSON.FeatureCollection`. land_geo = GeoJSON.read(land_path) ```` -We then need to create a figure with a `GeoAxis` that can handle the projection between `source` and `destinaton` CRS. For GeoMakie, `source` is the CRS of the input and `dest` is the CRS you want to visualize in. +We then need to create a figure with a `GeoAxis` that can handle the projection between `source` and `destination` CRS. For GeoMakie, `source` is the CRS of the input and `dest` is the CRS you want to visualize in. ````@example creating_geometry fig = Figure(size=(1000, 500)); @@ -267,7 +267,7 @@ y = r .* (k + 1) .* sin.(ϴ) .- r .* sin.((k + 1) .* ϴ); ring4 = GI.LinearRing(Point.(zip(x, y))) ```` -But this time when we create the `Polygon` we beed to specify the `CRS` at the time of creation, making it a geospatial polygon +But this time when we create the `Polygon` we need to specify the `CRS` at the time of creation, making it a geospatial polygon ````@example creating_geometry geopoly1 = GI.Polygon([ring4], crs = source_crs1) diff --git a/ext/GeometryOpsProjExt/reproject.jl b/ext/GeometryOpsProjExt/reproject.jl index aecd0646b..616e13fd0 100644 --- a/ext/GeometryOpsProjExt/reproject.jl +++ b/ext/GeometryOpsProjExt/reproject.jl @@ -14,7 +14,7 @@ function reproject(geom; end # If its still nothing, error - isnothing(source_crs) && throw(ArgumentError("geom has no crs attatched. Pass a `source_crs` keyword")) + isnothing(source_crs) && throw(ArgumentError("geom has no crs attached. Pass a `source_crs` keyword")) # Otherwise reproject reproject(geom, source_crs, target_crs; kw...) diff --git a/src/methods/angles.jl b/src/methods/angles.jl index c7af8732b..ca130c895 100644 --- a/src/methods/angles.jl +++ b/src/methods/angles.jl @@ -39,7 +39,7 @@ This is computed differently for different geometries: - The angles of a point is an empty vector. - The angles of a single line segment is an empty vector. - The angles of a linestring or linearring is a vector of angles formed by the curve. - - The angles of a polygin is a vector of vectors of angles formed by each ring. + - The angles of a polygon is a vector of vectors of angles formed by each ring. - The angles of a multi-geometry collection is a vector of the angles of each of the sub-geometries as defined above. @@ -83,7 +83,7 @@ function _angles(::Type{T}, ::GI.LinearRingTrait, geom; interior = true) where T end #= The angles of a polygon is a vector of polygon angles. Note that if there are holes -within the polyogn, the angles will be listed after the exterior ring angles in order of the +within the polygon, the angles will be listed after the exterior ring angles in order of the holes. All angles, including the hole angles, are interior angles of the polygon.=# function _angles(::Type{T}, ::GI.PolygonTrait, geom) where T angles = _angles(T, GI.LinearRingTrait(), GI.getexterior(geom); interior = true) diff --git a/src/methods/area.jl b/src/methods/area.jl index ae4b00c5f..b98024bb8 100644 --- a/src/methods/area.jl +++ b/src/methods/area.jl @@ -29,7 +29,7 @@ lines!( f ``` The points are ordered in a counterclockwise fashion, which means that the signed area -is negative. If we reverse the order of the points, we get a postive area. +is negative. If we reverse the order of the points, we get a positive area. ```@example rect GO.signed_area(rect) # -1.0 ``` @@ -76,7 +76,7 @@ end signed_area(geom, [T = Float64])::T Returns the signed area of a single geometry, based on winding order. -This is computed slighly differently for different geometries: +This is computed slightly differently for different geometries: - The signed area of a point is always zero. - The signed area of a curve is always zero. diff --git a/src/methods/centroid.jl b/src/methods/centroid.jl index 9dd0e4167..207203f47 100644 --- a/src/methods/centroid.jl +++ b/src/methods/centroid.jl @@ -45,7 +45,7 @@ LineString or LinearRing when they are closed, for example as the interior hole of a polygon. The helper functions centroid_and_length and centroid_and_area are made -availible just in case the user also needs the area or length to decrease +available just in case the user also needs the area or length to decrease repeat computation. =# """ diff --git a/src/methods/clipping/clipping_processor.jl b/src/methods/clipping/clipping_processor.jl index aaf938d95..e0ea5b7c2 100644 --- a/src/methods/clipping/clipping_processor.jl +++ b/src/methods/clipping/clipping_processor.jl @@ -74,10 +74,10 @@ poly_a, including its intersection points with poly_b. The information stored in PolyNode is needed for clipping using the Greiner-Hormann clipping algorithm. Note: After calling this function, a_list is not fully formed because the neighboring -indicies of the intersection points in b_list still need to be updated. Also we still have +indices of the intersection points in b_list still need to be updated. Also we still have not update the entry and exit flags for a_list. -The a_idx_list is a list of the indicies of intersection points in a_list. The value at +The a_idx_list is a list of the indices of intersection points in a_list. The value at index i of a_idx_list is the location in a_list where the ith intersection point lies. =# function _build_a_list(::Type{T}, poly_a, poly_b; exact) where T @@ -179,7 +179,7 @@ creates a vector of PolyNodes to represent poly_b. The information stored in eac is needed for clipping using the Greiner-Hormann clipping algorithm. Note: after calling this function, b_list is not fully updated. The entry/exit flags still -need to be updated. However, the neightbor value in a_list is now updated. +need to be updated. However, the neighbor value in a_list is now updated. =# function _build_b_list(::Type{T}, a_idx_list, a_list, n_b_intrs, poly_b) where T # Sort intersection points by insertion order in b_list @@ -609,8 +609,8 @@ _get_poly_type(::Type{T}) where T = #= _find_non_cross_orientation(a_list, b_list, a_poly, b_poly; exact) -For polygns with no crossing intersection points, either one polygon is inside of another, -or they are seperate polygons with no intersection (other than an edge or point). +For polygons with no crossing intersection points, either one polygon is inside of another, +or they are separate polygons with no intersection (other than an edge or point). Return two booleans that represent if a is inside b (potentially with shared edges / points) and visa versa if b is inside of a. @@ -655,7 +655,7 @@ function _add_holes_to_polys!(::Type{T}, return_polys, hole_iterator, remove_pol append!(remove_poly_idx, falses(n_new_pieces)) n_new_per_poly += n_new_pieces end - if !on_ext && !out_ext # hole is completly within exterior + if !on_ext && !out_ext # hole is completely within exterior push!(curr_poly.geom, new_hole) else # hole is partially within and outside of polygon's exterior new_polys = difference(curr_poly_ext, new_hole_poly, T; target=GI.PolygonTrait()) @@ -669,7 +669,7 @@ function _add_holes_to_polys!(::Type{T}, return_polys, hole_iterator, remove_pol n_new_per_poly += n_new_polys end end - # polygon is completly within hole + # polygon is completely within hole elseif coveredby(curr_poly_ext, GI.Polygon(StaticArrays.SVector(curr_hole))) remove_poly_idx[j] = true end @@ -687,7 +687,7 @@ end The new hole is combined with any existing holes in curr_poly. The holes can be combined into a larger hole if they are intersecting. If this happens, then the new, combined hole is -returned with the orignal holes making up the new hole removed from curr_poly. Additionally, +returned with the original holes making up the new hole removed from curr_poly. Additionally, if the combined holes form a ring, the interior is added to the return_polys as a new polygon piece. Additionally, holes leftover after combination will be checked for it they are in the "main" polygon or in one of these new pieces and moved accordingly. @@ -750,7 +750,7 @@ function _remove_collinear_points!(polys, remove_idx, poly_a, poly_b) continue else p3 = p - # check if p2 is approximatly on the edge formed by p1 and p3 - remove if so + # check if p2 is approximately on the edge formed by p1 and p3 - remove if so if Predicates.orient(p1, p2, p3; exact = _False()) == 0 remove_idx[i - 1] = true end diff --git a/src/methods/clipping/coverage.jl b/src/methods/clipping/coverage.jl index 597fb470f..cf8762274 100644 --- a/src/methods/clipping/coverage.jl +++ b/src/methods/clipping/coverage.jl @@ -4,7 +4,7 @@ export coverage ## What is coverage? Coverage is the amount of geometry area within a bounding box defined by the minimum and -maximum x and y-coordiantes of that bounding box, or an Extent containing that information. +maximum x and y-coordinates of that bounding box, or an Extent containing that information. To provide an example, consider this rectangle: ```@example rect diff --git a/src/methods/clipping/cut.jl b/src/methods/clipping/cut.jl index 1303ceb7e..be3f0a855 100644 --- a/src/methods/clipping/cut.jl +++ b/src/methods/clipping/cut.jl @@ -98,7 +98,7 @@ of cut geometry in Vector{Vector{Tuple}} format. Note: degenerate cases where intersection points are vertices do not work right now. =# function _cut(::Type{T}, geom, line, geom_list, intr_list, n_intr_pts; exact) where T - # Sort and catagorize the intersection points + # Sort and categorize the intersection points sort!(intr_list, by = x -> geom_list[x].fracs[2]) _flag_ent_exit!(GI.LineTrait(), line, geom_list; exact) # Add first point to output list diff --git a/src/methods/clipping/difference.jl b/src/methods/clipping/difference.jl index 604e4606b..d121e56c5 100644 --- a/src/methods/clipping/difference.jl +++ b/src/methods/clipping/difference.jl @@ -83,7 +83,7 @@ function _difference( end end end - # Remove uneeded collinear points on same edge + # Remove unneeded collinear points on same edge _remove_collinear_points!(polys, remove_idx, poly_a, poly_b) return polys end @@ -147,7 +147,7 @@ end #= Multipolygon with multipolygon difference - note that all intersection regions between sub-polygons of `multipoly_a` and sub-polygons of `multipoly_b` will be removed from the corresponding sub-polygon of `multipoly_a`. Unless specified with `fix_multipoly = nothing`, -`multipolygon_a` will be validated using the given (defauly is `UnionIntersectingPolygons()`) +`multipolygon_a` will be validated using the given (default is `UnionIntersectingPolygons()`) correction. =# function _difference( target::TraitTarget{GI.PolygonTrait}, ::Type{T}, @@ -169,7 +169,7 @@ function _difference( else difference(GI.MultiPolygon(polys), poly_b; target, fix_multipoly) end - #= One multipoly_a has been completly covered (and thus removed) there is no need to + #= One multipoly_a has been completely covered (and thus removed) there is no need to continue taking the difference =# isempty(polys) && break end diff --git a/src/methods/clipping/intersection.jl b/src/methods/clipping/intersection.jl index 405be4428..5892bd968 100644 --- a/src/methods/clipping/intersection.jl +++ b/src/methods/clipping/intersection.jl @@ -5,7 +5,7 @@ export intersection, intersection_points Enum LineOrientation Enum for the orientation of a line with respect to a curve. A line can be `line_cross` (crossing over the curve), `line_hinge` (crossing the endpoint of the curve), -`line_over` (colinear with the curve), or `line_out` (not interacting with the curve). +`line_over` (collinear with the curve), or `line_out` (not interacting with the curve). """ @enum LineOrientation line_cross=1 line_hinge=2 line_over=3 line_out=4 @@ -86,7 +86,7 @@ function _intersection( hole_iterator = Iterators.flatten((GI.gethole(poly_a), GI.gethole(poly_b))) _add_holes_to_polys!(T, polys, hole_iterator, remove_idx; exact) end - # Remove uneeded collinear points on same edge + # Remove unneeded collinear points on same edge _remove_collinear_points!(polys, remove_idx, poly_a, poly_b) return polys end @@ -128,7 +128,7 @@ function _intersection( end #= Multipolygon with polygon intersection is equivalent to taking the intersection of the -poylgon with the multipolygon and thus simply switches the order of operations and calls the +polygon with the multipolygon and thus simply switches the order of operations and calls the above method. =# _intersection( target::TraitTarget{GI.PolygonTrait}, ::Type{T}, @@ -197,7 +197,7 @@ intersection_points(geom_a, geom_b, ::Type{T} = Float64) where T <: AbstractFloa _intersection_points(T, GI.trait(geom_a), geom_a, GI.trait(geom_b), geom_b) -#= Calculates the list of intersection points between two geometries, inlcuding line +#= Calculates the list of intersection points between two geometries, including line segments, line strings, linear rings, polygons, and multipolygons. =# function _intersection_points(::Type{T}, ::GI.AbstractTrait, a, ::GI.AbstractTrait, b; exact = _True()) where T # Initialize an empty list of points @@ -384,7 +384,7 @@ end #= If lines defined by (a1, a2) and (b1, b2) meet at one point that is not an endpoint of either segment, they form a crossing intersection with a singular intersection point. That -point is caculated by finding the fractional distance along each segment the point occurs +point is calculated by finding the fractional distance along each segment the point occurs at (α, β). If the point is too close to an endpoint to be distinct, the point shares a value with the endpoint, but with a non-zero and non-one fractional value. If the intersection point calculated is outside of the envelope of the two segments due to floating point error, @@ -407,9 +407,9 @@ function _find_cross_intersection(::Type{T}, a1, a2, b1, b2, a_ext, b_ext) where β = _clamped_frac(Δbax * Δay - Δbay * Δax, a_cross_b, eps(T)) #= Intersection will be where a1 + α * Δa = b1 + β * Δb. However, due to floating point - innacurracies, α and β calculations may yeild different intersection points. Average + inaccuracies, α and β calculations may yield different intersection points. Average both points together to minimize difference from real value, as long as segment isn't - vertical or horizontal as this will almost certianly lead to the point being outside the + vertical or horizontal as this will almost certainly lead to the point being outside the envelope due to floating point error. Also note that floating point limitations could make intersection be endpoint if α≈0 or α≈1.=# x = if Δax == 0 diff --git a/src/methods/clipping/union.jl b/src/methods/clipping/union.jl index 8e1d785e4..cdde8c286 100644 --- a/src/methods/clipping/union.jl +++ b/src/methods/clipping/union.jl @@ -83,7 +83,7 @@ function _union( if GI.nhole(poly_a) != 0 || GI.nhole(poly_b) != 0 _add_union_holes!(polys, a_in_b, b_in_a, poly_a, poly_b; exact) end - # Remove uneeded collinear points on same edge + # Remove unneeded collinear points on same edge _remove_collinear_points!(polys, [false], poly_a, poly_b) return polys end @@ -160,7 +160,7 @@ function _add_union_holes_contained_polys!(polys, interior_poly, exterior_poly; in_ih, on_ih, out_ih = _line_polygon_interactions(ext_int_ring, poly_ih; exact, closed_line = true) if in_ih # at least part of interior polygon exterior is within the ith hole if !on_ih && !out_ih - #= interior polygon is completly within the ith hole - polygons aren't + #= interior polygon is completely within the ith hole - polygons aren't touching and do not actually form a union =# polys[1] = tuples(interior_poly) push!(polys, tuples(exterior_poly)) @@ -235,7 +235,7 @@ function _union( return polys end -#= Multipolygon with polygon union is equivalent to taking the union of the poylgon with the +#= Multipolygon with polygon union is equivalent to taking the union of the polygon with the multipolygon and thus simply switches the order of operations and calls the above method. =# _union( target::TraitTarget{GI.PolygonTrait}, ::Type{T}, diff --git a/src/methods/distance.jl b/src/methods/distance.jl index ef470330f..0333f2916 100644 --- a/src/methods/distance.jl +++ b/src/methods/distance.jl @@ -12,7 +12,7 @@ and multipolygons. If a point is outside of a geometry, signed distance has the same value as distance. However, points within the geometry have a negative distance representing the distance of a point to the closest boundary. Therefore, for all "non-filled" geometries, like curves, the distance will -either be postitive or 0. +either be positive or 0. To provide an example, consider this rectangle: ```@example rect diff --git a/src/methods/equals.jl b/src/methods/equals.jl index 15761d63e..cf0efe11d 100644 --- a/src/methods/equals.jl +++ b/src/methods/equals.jl @@ -23,7 +23,7 @@ lines!(GI.getpoint(l2), color = :orange) scatter!(GI.getpoint(l2), color = :orange) f ``` -We can see that the two lines do not share a commen set of points and edges in +We can see that the two lines do not share a common set of points and edges in the plot, so they are not equal: ```@example equals GO.equals(l1, l2) # returns false @@ -44,7 +44,7 @@ same order. The winding order also doesn't have to be the same to represent the same geometry. This requires checking every point against every other point in the two geometries we are comparing. Also, some geometries must be "closed" like polygons and linear rings. These will be assumed to be closed, even if they -don't have a repeated last point explicity written in the coordinates. +don't have a repeated last point explicitly written in the coordinates. Additionally, geometries and multi-geometries can be equal if the multi-geometry only includes that single geometry. =# @@ -210,7 +210,7 @@ end )::Bool Two lines/linestrings are equal if they share the same set of points going -along the curve. Note that lines/linestrings aren't closed by defintion. +along the curve. Note that lines/linestrings aren't closed by definition. """ equals( ::Union{GI.LineTrait, GI.LineStringTrait}, l1, @@ -224,7 +224,7 @@ equals( )::Bool A line/linestring and a linear ring are equal if they share the same set of -points going along the curve. Note that lines aren't closed by defintion, but +points going along the curve. Note that lines aren't closed by definition, but rings are, so the line must have a repeated last point to be equal """ equals( @@ -239,7 +239,7 @@ equals( )::Bool A linear ring and a line/linestring are equal if they share the same set of -points going along the curve. Note that lines aren't closed by defintion, but +points going along the curve. Note that lines aren't closed by definition, but rings are, so the line must have a repeated last point to be equal """ equals( diff --git a/src/methods/geom_relations/contains.jl b/src/methods/geom_relations/contains.jl index 79ec841e1..35d0c6e60 100644 --- a/src/methods/geom_relations/contains.jl +++ b/src/methods/geom_relations/contains.jl @@ -5,8 +5,8 @@ export contains #= ## What is contains? -The contains function checks if a given geometry completly contains another -geometry, or in other words, that the second geometry is completly within the +The contains function checks if a given geometry completely contains another +geometry, or in other words, that the second geometry is completely within the first. This requires that the two interiors intersect and that the interior and boundary of the second geometry is not in the exterior of the first geometry. diff --git a/src/methods/geom_relations/coveredby.jl b/src/methods/geom_relations/coveredby.jl index a74cd6568..ff5ed7f06 100644 --- a/src/methods/geom_relations/coveredby.jl +++ b/src/methods/geom_relations/coveredby.jl @@ -160,7 +160,7 @@ _coveredby( ) #= Linestring is coveredby a polygon if all interior and boundary points of the -line are in the polygon interior or on its edges, inlcuding hole edges. =# +line are in the polygon interior or on its edges, including hole edges. =# _coveredby( ::Union{GI.LineTrait, GI.LineStringTrait}, g1, ::GI.PolygonTrait, g2, @@ -203,7 +203,7 @@ _coveredby( ) #= Linearring is coveredby a polygon if all vertices and edges of the ring are -in the polygon interior or on the polygon edges, inlcuding hole edges. =# +in the polygon interior or on the polygon edges, including hole edges. =# _coveredby( ::GI.LinearRingTrait, g1, ::GI.PolygonTrait, g2, diff --git a/src/methods/geom_relations/covers.jl b/src/methods/geom_relations/covers.jl index a8e067a10..47e99dead 100644 --- a/src/methods/geom_relations/covers.jl +++ b/src/methods/geom_relations/covers.jl @@ -5,7 +5,7 @@ export covers #= ## What is covers? -The covers function checks if a given geometry completly covers another +The covers function checks if a given geometry completely covers another geometry. For this to be true, the "contained" geometry's interior and boundaries must be covered by the "covering" geometry's interior and boundaries. The interiors do not need to overlap. diff --git a/src/methods/geom_relations/disjoint.jl b/src/methods/geom_relations/disjoint.jl index 58774d03d..dfb06a838 100644 --- a/src/methods/geom_relations/disjoint.jl +++ b/src/methods/geom_relations/disjoint.jl @@ -171,7 +171,7 @@ _disjoint( ) #= Geometry is disjoint from a linestring if the line's interior and boundary -points don't intersect with the geometrie's interior and boundary points. =# +points don't intersect with the geometry's interior and boundary points. =# _disjoint( trait1::Union{GI.LinearRingTrait, GI.PolygonTrait}, g1, trait2::Union{GI.LineTrait, GI.LineStringTrait}, g2, diff --git a/src/methods/geom_relations/geom_geom_processors.jl b/src/methods/geom_relations/geom_geom_processors.jl index 9df829974..a0b9d7e99 100644 --- a/src/methods/geom_relations/geom_geom_processors.jl +++ b/src/methods/geom_relations/geom_geom_processors.jl @@ -96,12 +96,12 @@ If cross_allow is true, segments of the line and curve can be disjoint. If in_require is true, the interiors of the line and curve must meet in at least one point. -If on_require is true, the bounday of one of the two geometries can meet the +If on_require is true, the boundary of one of the two geometries can meet the interior or boundary of the other geometry in at least one point. If out_require is true, there must be at least one point of the given line that is exterior of the curve. -If the point is in an "allowed" location and meets all requirments, return true. +If the point is in an "allowed" location and meets all requirements, return true. Else, return false. If closed_line is true, line is treated as a closed line where the first and @@ -125,7 +125,7 @@ function _inner_line_curve_process( closed_line = false, closed_curve = false, exact, ) - # Set up requirments + # Set up requirements in_req_met = !in_require on_req_met = !on_require out_req_met = !out_require @@ -152,7 +152,7 @@ function _inner_line_curve_process( # If segments are co-linear if seg_val == line_over !over_allow && return false - # at least one point in, meets requirments + # at least one point in, meets requirements in_req_met = true point_val = _point_segment_orientation(l_start, c_start, c_end) # If entire segment isn't covered, consider remaining section @@ -208,7 +208,7 @@ function _inner_line_curve_process( end #= If entire segment (le to ls) isn't covered by segment (cs to ce), find remaining section -part of section outside of cs to ce. If completly covered, increase segment index i. =# +part of section outside of cs to ce. If completely covered, increase segment index i. =# function _find_new_seg(i, ls, le, cs, ce) break_off = true if _point_segment_orientation(le, cs, ce) != point_out @@ -251,7 +251,7 @@ If on_require is true, the line must have at least one point on the polygon'same If out_require is true, the line must have at least one point outside of the polygon. -If the point is in an "allowed" location and meets all requirments, return true. +If the point is in an "allowed" location and meets all requirements, return true. Else, return false. If closed_line is true, line is treated as a closed line where the first and @@ -298,7 +298,7 @@ function _inner_line_polygon_process( !out_allow && return false out_req_met = true end - if on_hole # hole bounday is polygon boundary + if on_hole # hole boundary is polygon boundary !on_allow && return false on_req_met = true end @@ -329,7 +329,7 @@ If on_require is true, one of the polygon's must have at least one boundary If out_require is true, the first polygon must have at least one interior point outside of the second polygon. -If the point is in an "allowed" location and meets all requirments, return true. +If the point is in an "allowed" location and meets all requirements, return true. Else, return false. =# @inline function _polygon_polygon_process(poly1, poly2; kw...) @@ -482,7 +482,7 @@ for each scenario. Note that this uses the Algorithm by Hao and Sun (2018): https://doi.org/10.3390/sym10100477 -Paper seperates orientation of point and edge into 26 cases. For each case, it +Paper separates orientation of point and edge into 26 cases. For each case, it is either a case where the point is on the edge (returns on), where a ray from the point (x, y) to infinity along the line y = y cut through the edge (k += 1), or the ray does not pass through the edge (do nothing and continue). If the ray @@ -643,7 +643,7 @@ Returns a tuple of booleans: (in_poly, on_poly, out_poly). If in_poly is true, some of the lines interior points interact with the polygon interior points. If in_poly is true, endpoints of either the line intersect with the polygon or - the line interacts with the polygon boundary, including hole bounaries. + the line interacts with the polygon boundary, including hole boundaries. If out_curve is true, at least one segments of the line is outside the polygon, including inside of holes. diff --git a/src/methods/geom_relations/overlaps.jl b/src/methods/geom_relations/overlaps.jl index 4bbdbeb21..8cb966a0b 100644 --- a/src/methods/geom_relations/overlaps.jl +++ b/src/methods/geom_relations/overlaps.jl @@ -11,7 +11,7 @@ contained, within, or equal to the other. Note that this means it is impossible for a single point to overlap with a single point and a line only overlaps with another line if only a section of -each line is colinear. +each line is collinear. To provide an example, consider these two lines: ```@example overlaps @@ -42,12 +42,12 @@ implementation based on the geometry trait. This is also used in the implementation, since it's a lot less work! Note that that since only elements of the same dimension can overlap, any two -geometries with traits that are of different dimensions autmoatically can +geometries with traits that are of different dimensions automatically can return false. For geometries with the same trait dimension, we must make sure that they share a point, an edge, or area for points, lines, and polygons/multipolygons -respectivly, without being contained. +respectively, without being contained. =# """ @@ -116,7 +116,7 @@ end """ overlaps(::GI.LineTrait, line1, ::GI.LineTrait, line)::Bool -If the lines overlap, meaning that they are colinear but each have one endpoint +If the lines overlap, meaning that they are collinear but each have one endpoint outside of the other line, return true. Else false. """ overlaps(::GI.LineTrait, line1, ::GI.LineTrait, line) = @@ -212,7 +212,7 @@ function overlaps( return false end -#= If the edges overlap, meaning that they are colinear but each have one endpoint +#= If the edges overlap, meaning that they are collinear but each have one endpoint outside of the other edge, return true. Else false. =# function _overlaps( (a1, a2)::Edge, diff --git a/src/methods/geom_relations/touches.jl b/src/methods/geom_relations/touches.jl index 1d9018bc4..43a08e7a1 100644 --- a/src/methods/geom_relations/touches.jl +++ b/src/methods/geom_relations/touches.jl @@ -8,7 +8,7 @@ export touches The touches function checks if one geometry touches another geometry. In other words, the interiors of the two geometries don't interact, but one of the geometries must have a boundary point that interacts with either the other -geometies interior or boundary. +geometry's interior or boundary. To provide an example, consider these two lines: @@ -61,7 +61,7 @@ const TOUCHES_EXACT = (exact = _False(),) Return `true` if the first geometry touches the second geometry. In other words, the two interiors cannot interact, but one of the geometries must have a -boundary point that interacts with either the other geometies interior or +boundary point that interacts with either the other geometry's interior or boundary. ## Examples @@ -128,8 +128,8 @@ _touches( # # Lines touching geometries -#= Linestring touches another line if at least one bounday point interacts with -the bounday of interior of the other line, but the interiors don't interact. =# +#= Linestring touches another line if at least one boundary point interacts with +the boundary of interior of the other line, but the interiors don't interact. =# _touches( ::Union{GI.LineTrait, GI.LineStringTrait}, g1, ::Union{GI.LineTrait, GI.LineStringTrait}, g2, @@ -181,14 +181,14 @@ _touches( ) = _touches(trait2, g2, trait1, g1) #= Linearring cannot touch another linear ring since they are both exclusively -made up of interior points and no bounday points =# +made up of interior points and no boundary points =# _touches( ::GI.LinearRingTrait, g1, ::GI.LinearRingTrait, g2, ) = false #= Linearring touches a polygon if at least one of the points of the ring -interact with the polygon bounday and non are in the polygon interior. =# +interact with the polygon boundary and non are in the polygon interior. =# _touches( ::GI.LinearRingTrait, g1, ::GI.PolygonTrait, g2, @@ -203,8 +203,8 @@ _touches( # # Polygons touch geometries -#= Polygon touches a curve if at least one of the curve bounday points interacts -with the polygon's bounday and no curve points interact with the interior.=# +#= Polygon touches a curve if at least one of the curve boundary points interacts +with the polygon's boundary and no curve points interact with the interior.=# _touches( trait1::GI.PolygonTrait, g1, trait2::GI.AbstractCurveTrait, g2 diff --git a/src/methods/polygonize.jl b/src/methods/polygonize.jl index b238f4c63..da29b1230 100644 --- a/src/methods/polygonize.jl +++ b/src/methods/polygonize.jl @@ -35,7 +35,7 @@ f Now, we can use the `polygonize` function to convert the raster data into polygons. For this particular example, we chose a range of z-values between 0.8 and 3.2, -which would provide two distinct polyogns with holes. +which would provide two distinct polygons with holes. ```@example polygonize polygons = polygonize(xs, ys, 0.8 .< zs .< 3.2) @@ -334,7 +334,7 @@ function _polygonize(f, xs::AbstractVector{T}, ys::AbstractVector{T}, A::Abstrac assigned_holes == length(holes) || @warn "Not all holes were assigned to polygons, $(length(holes) - assigned_holes) where missed from $(length(holes)) holes and $(length(polygons)) polygons" if isempty(polygons) - # TODO: this really should return an emtpty MultiPolygon but + # TODO: this really should return an empty MultiPolygon but # GeoInterface wrappers cant do that yet, which is not ideal... @warn "No polgons found, check your data or try another function for `f`" return nothing diff --git a/src/primitives.jl b/src/primitives.jl index 01014c1cf..aa3cfdfea 100644 --- a/src/primitives.jl +++ b/src/primitives.jl @@ -223,7 +223,7 @@ end if calc_extent isa _True # Calculate the extent of the features extent = mapreduce(GI.extent, Extents.union, features) - # Return a FeatureCollection with features, crs and caculated extent + # Return a FeatureCollection with features, crs and calculated extent return GI.FeatureCollection(features; crs, extent) else # Return a FeatureCollection with features and crs @@ -241,10 +241,10 @@ end if calc_extent isa _True # Calculate the extent of the geometry extent = GI.extent(geometry) - # Return a new Feature with the new geometry and calculated extent, but the oroginal properties and crs + # Return a new Feature with the new geometry and calculated extent, but the original properties and crs return GI.Feature(geometry; properties, crs, extent) else - # Return a new Feature with the new geometry, but the oroginal properties and crs + # Return a new Feature with the new geometry, but the original properties and crs return GI.Feature(geometry; properties, crs) end end @@ -264,11 +264,11 @@ function _apply_inner(geom, geoms, crs, calc_extent::_True) # Calculate the extent of the sub geometries extent = mapreduce(GI.extent, Extents.union, geoms) # Return a new geometry of the same trait as `geom`, - # holding tnew `geoms` with `crs` and calcualted extent + # holding the new `geoms` with `crs` and calculated extent return rebuild(geom, geoms; crs, extent) end function _apply_inner(geom, geoms, crs, calc_extent::_False) - # Return a new geometryof the same trait as `geom`, holding the new `geoms` with `crs` + # Return a new geometry of the same trait as `geom`, holding the new `geoms` with `crs` return rebuild(geom, geoms; crs) end # Fail loudly if we hit PointTrait without running `f` @@ -308,7 +308,7 @@ end @inline _applyreduce(f::F, op::O, target, geom; threaded, init) where {F, O} = _applyreduce(f, op, target, GI.trait(geom), geom; threaded, init) -# Maybe use threads recucing over arrays +# Maybe use threads reducing over arrays @inline function _applyreduce(f::F, op::O, target, ::Nothing, A::AbstractArray; threaded, init) where {F, O} applyreduce_array(i) = _applyreduce(f, op, target, A[i]; threaded=_False(), init) _mapreducetasks(applyreduce_array, op, eachindex(A), threaded; init) @@ -455,7 +455,7 @@ Reconstruct `geom` from an iterable of component objects that match its structur All objects in `components` must have the same `GeoInterface.trait`. -Ususally used in combination with `flatten`. +Usually used in combination with `flatten`. """ function reconstruct(geom, components) obj, iter = _reconstruct(geom, components) @@ -537,7 +537,7 @@ using Base.Threads: nthreads, @threads, @spawn # Threading utility, modified Mason Protters threading PSA -# run `f` over ntasks, where f recieves an AbstractArray/range +# run `f` over ntasks, where f receives an AbstractArray/range # of linear indices @inline function _maptasks(f::F, taskrange, threaded::_True)::Vector where F ntasks = length(taskrange) @@ -568,7 +568,7 @@ Base.@assume_effects :foldable @inline function _maptasks(f::F, taskrange, threa end # Threading utility, modified Mason Protters threading PSA -# run `f` over ntasks, where f recieves an AbstractArray/range +# run `f` over ntasks, where f receives an AbstractArray/range # of linear indices # # WARNING: this will not work for mean/median - only ops diff --git a/src/transformations/correction/intersecting_polygons.jl b/src/transformations/correction/intersecting_polygons.jl index e8858d45f..e326b6a16 100644 --- a/src/transformations/correction/intersecting_polygons.jl +++ b/src/transformations/correction/intersecting_polygons.jl @@ -5,7 +5,7 @@ export UnionIntersectingPolygons #= If the sub-polygons of a multipolygon are intersecting, this makes them invalid according to specification. Each sub-polygon of a multipolygon being disjoint (other than by a single -point) is a requirment for a valid multipolygon. However, different libraries may achieve +point) is a requirement for a valid multipolygon. However, different libraries may achieve this in different ways. For example, taking the union of all sub-polygons of a multipolygon will create a new diff --git a/src/transformations/reproject.jl b/src/transformations/reproject.jl index 1b9dd6855..ab3707374 100644 --- a/src/transformations/reproject.jl +++ b/src/transformations/reproject.jl @@ -27,12 +27,12 @@ geometries, wrapping views of a `Vector{Proj.Point{D}}`, where `D` is the dimens ## Arguments - `geometry`: Any GeoInterface.jl compatible geometries. -- `source_crs`: the source coordinate referece system, as a GeoFormatTypes.jl object or a string. -- `target_crs`: the target coordinate referece system, as a GeoFormatTypes.jl object or a string. +- `source_crs`: the source coordinate reference system, as a GeoFormatTypes.jl object or a string. +- `target_crs`: the target coordinate reference system, as a GeoFormatTypes.jl object or a string. If these a passed as keywords, `transform` will take priority. Without it `target_crs` is always needed, and `source_crs` is -needed if it is not retreivable from the geometry with `GeoInterface.crs(geometry)`. +needed if it is not retrievable from the geometry with `GeoInterface.crs(geometry)`. ## Keywords diff --git a/src/transformations/simplify.jl b/src/transformations/simplify.jl index 35ccabdb1..d9d0e89de 100644 --- a/src/transformations/simplify.jl +++ b/src/transformations/simplify.jl @@ -134,7 +134,7 @@ or nested vectors or a table of these. [`RadialDistance`](@ref), [`DouglasPeucker`](@ref), or [`VisvalingamWhyatt`](@ref) algorithms are available, -listed in order of increasing quality but decreaseing performance. +listed in order of increasing quality but decreasing performance. `PoinTrait` and `MultiPointTrait` are returned unchanged. @@ -199,7 +199,7 @@ simplify( ) = _simplify(DouglasPeucker(; kw...), data; prefilter_alg, calc_extent, threaded, crs) -#= For each algorithm, apply simplication to all curves, multipoints, and +#= For each algorithm, apply simplification to all curves, multipoints, and points, reconstructing everything else around them. =# function _simplify(alg::Union{SimplifyAlg, GEOS}, data; prefilter_alg=nothing, kw...) simplifier(geom) = _simplify(GI.trait(geom), alg, geom; prefilter_alg) @@ -245,7 +245,7 @@ Simplifies geometries by removing points less than $SIMPLIFY_ALG_KEYWORDS - `tol`: the minimum distance between points. -Note: user input `tol` is squared to avoid uneccesary computation in algorithm. +Note: user input `tol` is squared to avoid unnecessary computation in algorithm. """ @kwdef struct RadialDistance <: SimplifyAlg number::Union{Int64,Nothing} = nothing @@ -284,7 +284,7 @@ Simplifies geometries by removing points below `tol` distance from the line between its neighboring points. $DOUGLAS_PEUCKER_KEYWORDS -Note: user input `tol` is squared to avoid uneccesary computation in algorithm. +Note: user input `tol` is squared to avoid unnecessary computation in algorithm. """ @kwdef struct DouglasPeucker <: SimplifyAlg number::Union{Int64,Nothing} = nothing @@ -304,7 +304,7 @@ end function _simplify(alg::DouglasPeucker, points::Vector, preserve_endpoint) npoints = length(points) npoints <= MIN_POINTS && return points - # Determine stopping critetia + # Determine stopping criteria max_points = if !isnothing(alg.tol) npoints else @@ -395,7 +395,7 @@ function _simplify(alg::DouglasPeucker, points::Vector, preserve_endpoint) end #= find maximum distance of any point between the start_idx and end_idx to the line formed -by conencting the points at start_idx and end_idx. Note that the first index of maximum +by connecting the points at start_idx and end_idx. Note that the first index of maximum value will be used, which might cause differences in results from other algorithms.=# function _find_max_squared_dist(points, start_idx, end_idx) max_idx = start_idx @@ -422,7 +422,7 @@ distance from the line between its neighboring points. $SIMPLIFY_ALG_KEYWORDS - `tol`: the minimum area of a triangle made with a point and its neighboring points. -Note: user input `tol` is doubled to avoid uneccesary computation in algorithm. +Note: user input `tol` is doubled to avoid unnecessary computation in algorithm. """ @kwdef struct VisvalingamWhyatt <: SimplifyAlg number::Union{Int,Nothing} = nothing diff --git a/src/transformations/transform.jl b/src/transformations/transform.jl index b09e85482..ed06b44fa 100644 --- a/src/transformations/transform.jl +++ b/src/transformations/transform.jl @@ -31,7 +31,7 @@ re.SVector{2, Float64}[[4.5, 3.5], [6.5, 5.5], [8.5, 7.5], [4.5, 3.5]], nothing, rraysCore.SVector{2, Float64}[[6.5, 5.5], [8.5, 7.5], [9.5, 8.5], [6.5, 5.5]], nothing, nothing)], nothing, nothing) ``` -With Rotations.jl you need to actuall multiply the Rotation +With Rotations.jl you need to actually multiply the Rotation by the `SVector` point, which is easy using an anonymous function. ```julia diff --git a/test/data/polygon_generation.jl b/test/data/polygon_generation.jl index 6fdf3bc74..1242f9bea 100644 --- a/test/data/polygon_generation.jl +++ b/test/data/polygon_generation.jl @@ -24,7 +24,7 @@ Inputs: Output: Vector{Vector{Vector{T}}} representing polygon coordinates Note: - Check your outputs! No guarentee that the polygon's aren't self-intersecting + Check your outputs! No guarantee that the polygon's aren't self-intersecting """ function generate_random_poly( x, diff --git a/test/methods/centroid.jl b/test/methods/centroid.jl index 431f4732b..1a7b81a8c 100644 --- a/test/methods/centroid.jl +++ b/test/methods/centroid.jl @@ -97,7 +97,7 @@ end @test all(c5 .≈ c6) end @testset "MultiPolygons" begin - # Combine poylgons made above + # Combine polygons made above m1 = LG.MultiPolygon([ [ [[11.0, 0.0], [11.0, 3.0], [14.0, 3.0], [14.0, 2.0], [12.0, 2.0], diff --git a/test/methods/clipping/coverage.jl b/test/methods/clipping/coverage.jl index 01189687a..aa4b388df 100644 --- a/test/methods/clipping/coverage.jl +++ b/test/methods/clipping/coverage.jl @@ -26,7 +26,7 @@ p1 = GI.Polygon([[(0.0, 0.0), (0.0, 20.0), (20.0, 20.0), (20.0, 0.0), (0.0, 0.0) # polygon is bigger than the cell p2 = GI.Polygon([[(-10, -10.0), (-10.0, 30.0), (30.0, 30.0), (300.0, -10.0), (-10.0, -10.0)]]) @test GO.coverage(p2, cell_extremes...) == cell_area -# polygon is completly inside of cell +# polygon is completely inside of cell p3 = GI.Polygon([[(5.0, 5.0), (5.0, 15.0), (15.0, 15.0), (15.0, 5.0), (5.0, 5.0)]]) @test GO.coverage(p3, cell_extremes...) ≈ LG.area(LG.intersection(cell_poly, p3)) # polygon exits cell through one edge @@ -54,7 +54,7 @@ p10 = GI.Polygon([[(0.0, 0.0), (0.0, 20.0), (20.0, 20.0), (20.0, 0.0), (0.0, 0.0 [(7.0, 7.0), (5.0, 7.0), (5.0, 5.0), (7.0, 7.0)], ]) @test GO.coverage(p10, cell_extremes...) ≈ LG.area(LG.intersection(p10, cell_poly)) -# non-convex polygon split into two pieces (differnet walls) +# non-convex polygon split into two pieces (different walls) p11 = GI.Polygon([[(-10.0, 15.0), (-10.0, -10.0), (15.0, -10.0), (15.0, 5.0), (10.0, 5.0), (10.0, -5.0), (-5.0, -5.0), (-5.0, 10.0), (5.0, 10.0), (5.0, 15.0), (-10.0, 15.0)]]) @test GO.coverage(p11, cell_extremes...) ≈ LG.area(LG.intersection(p11, cell_poly)) diff --git a/test/methods/clipping/polygon_clipping.jl b/test/methods/clipping/polygon_clipping.jl index 17a441deb..ccb538218 100644 --- a/test/methods/clipping/polygon_clipping.jl +++ b/test/methods/clipping/polygon_clipping.jl @@ -121,12 +121,12 @@ test_pairs = [ (p13, p14, "p13", "p14", "Polygons whose intersection is two distinct regions"), (p15, p16, "p15", "p16", "First polygon in second polygon"), (p16, p15, "p16", "p15", "Second polygon in first polygon"), - (p17, p18, "p17", "p18", "First polygon with a hole (hole completly in second polygon), second without a hole"), - (p18, p17, "p18", "p17", "First polygon with no hole, second with a hole (hole completly in first polygon)"), - (p19, p20, "p19", "p20", "First polygon with a hole (hole not completly in second polygon), second without a hole"), - (p42, p20, "p42", "p20", "First polygon with two holes (holes not completly in second polygon), second without a hole"), - (p20, p19, "p20", "p19", "First polygon with no hole, second with a hole (hole not completly in first polygon)"), - (p20, p42, "p20", "p42", "First polygon with no holes, second with two holes (holes not completly in second polygon)"), + (p17, p18, "p17", "p18", "First polygon with a hole (hole completely in second polygon), second without a hole"), + (p18, p17, "p18", "p17", "First polygon with no hole, second with a hole (hole completely in first polygon)"), + (p19, p20, "p19", "p20", "First polygon with a hole (hole not completely in second polygon), second without a hole"), + (p42, p20, "p42", "p20", "First polygon with two holes (holes not completely in second polygon), second without a hole"), + (p20, p19, "p20", "p19", "First polygon with no hole, second with a hole (hole not completely in first polygon)"), + (p20, p42, "p20", "p42", "First polygon with no holes, second with two holes (holes not completely in second polygon)"), (p21, p22, "p21", "p22", "Polygons form cross, splitting each other"), (p23, p24, "p23", "p24", "Polygons are both donuts with intersecting holes"), (p25, p26, "p25", "p26", "Polygons both have two holes that intersect in various ways"), @@ -136,8 +136,8 @@ test_pairs = [ (p33, p34, "p33", "p34", "One polygon inside of the other, sharing an edge"), (p33, p35, "p33", "p35", "Polygons outside of one another, sharing an edge"), (p33, p36, "p33", "p36", "All intersection points are V-intersections as defined by Foster"), - (p33, p37, "p33", "p37", "Polygons are completly disjoint (no holes)"), - (p38, p39, "p38", "p39", "Polygons are completly disjoint (both have one hole)"), + (p33, p37, "p33", "p37", "Polygons are completely disjoint (no holes)"), + (p38, p39, "p38", "p39", "Polygons are completely disjoint (both have one hole)"), (p40, p41, "p40", "p41", "Two overlapping polygons with three total holes in overlap region"), (p42, p43, "p42", "p43", "First polygon 2 holes, second polygon 3 holes. Holes do not overlap"), (p43, p42, "p43", "p42", "First polygon 3 holes, second polygon 2 holes. Holes do not overlap"), diff --git a/test/methods/distance.jl b/test/methods/distance.jl index fee0fba9a..207feeb4c 100644 --- a/test/methods/distance.jl +++ b/test/methods/distance.jl @@ -81,7 +81,7 @@ c1 = LG.GeometryCollection([pt1, r1, p1]) @test GO.distance(pt7, p1) == LG.distance(pt7, p1) @test GO.signed_distance(pt7, p1) ≈ -(min(LG.distance(pt7, r2), LG.distance(pt7, r3), LG.distance(pt7, r4))) -# Point outside of polyon exterior +# Point outside of polygon exterior @test GO.distance(pt5, p1) ≈ LG.distance(pt5, p1) @test GO.signed_distance(pt5, p1) ≈ LG.distance(pt5, p1) # Point inside of polygon hole diff --git a/test/methods/geom_relations.jl b/test/methods/geom_relations.jl index ca0568551..b2f3f05df 100644 --- a/test/methods/geom_relations.jl +++ b/test/methods/geom_relations.jl @@ -125,13 +125,13 @@ test_pairs = [ (r1, r1, "r1", "r1", "Same rings"), (r2, r1, "r2", "r1", "Disjoint ring with one 'inside' of hole created"), (r3, r1, "r3", "r1", "Disjoint ring with one 'outside' of hole created"), - (r4, r1, "r4", "r1", "Rings share two sides and rest of sides dont touch"), + (r4, r1, "r4", "r1", "Rings share two sides and rest of sides don't touch"), (r1, r5, "r1", "r5", "Ring shares all edges with other ring, plus an extra loop"), (r1, r6, "r1", "r6", "Rings share just one vertex"), (r1, r7, "r1", "r7", "Rings cross one another"), (r4, p1, "r4", "p1", "Ring on boundary of polygon"), (r1, p1, "r1", "p1", "Ring on boundary and cutting through polygon"), - (r2, p1, "r2", "p1", "Ring on hole bounday"), + (r2, p1, "r2", "p1", "Ring on hole boundary"), (r6, p1, "r6", "p1", "Ring touches polygon at one vertex"), (r7, p1, "r7", "p1", "Ring crosses through polygon"), (r8, p1, "r8", "p1", "Ring inside of polygon"), diff --git a/test/transformations/correction/intersecting_polygons.jl b/test/transformations/correction/intersecting_polygons.jl index c55618b72..94cb31261 100644 --- a/test/transformations/correction/intersecting_polygons.jl +++ b/test/transformations/correction/intersecting_polygons.jl @@ -8,7 +8,7 @@ p1 = GI.Polygon([[(0.0, 0.0), (3.0, 0.0), (3.0, 3.0), (0.0, 3.0), (0.0, 0.0)]]) p2 = GI.Polygon([[(1.0, 0.0), (2.0, 0.0), (2.0, 1.0), (1.0, 1.0), (1.0, 0.0)]]) # (p1, p3) -> polygons outside of one another, sharing an edge p3 = GI.Polygon([[(1.0, 0.0), (2.0, 0.0), (2.0, -1.0), (1.0, -1.0), (1.0, 0.0)]]) -# (p1, p4) -> polygons are completly disjoint (no holes) +# (p1, p4) -> polygons are completely disjoint (no holes) p4 = GI.Polygon([[(1.0, -1.0), (2.0, -1.0), (2.0, -2.0), (1.0, -2.0), (1.0, -1.0)]]) # (p1, p5) -> polygons cut through one another p5 = GI.Polygon([[(1.0, -1.0), (2.0, -1.0), (2.0, 4.0), (1.0, 4.0), (1.0, -1.0)]])