Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GeometryOps"
uuid = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab"
authors = ["Anshul Singhvi <[email protected]>", "Rafael Schouten <[email protected]>", "Skylar Gering <[email protected]>", "and contributors"]
version = "0.1.29"
authors = ["Anshul Singhvi <[email protected]>", "Rafael Schouten <[email protected]>", "Skylar Gering <[email protected]>", "and contributors"]

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down Expand Up @@ -74,6 +74,7 @@ JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LibGEOS = "a90b1aa1-3769-5649-ba7e-abc5a9d163eb"
NaturalEarth = "436b0209-26ab-4e65-94a9-6526d86fea76"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Polylabel = "49a44318-e865-4b63-9842-695152d634c1"
Proj = "c94c279d-25a6-4763-9509-64d165bea63e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -84,4 +85,4 @@ TGGeometry = "d7e755d2-3c95-4bcf-9b3c-79ab1a78647b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["ArchGDAL", "CoordinateTransformations", "DataFrames", "Distributions", "DimensionalData", "Downloads", "FlexiJoins", "GeoJSON", "GeometryBasics", "Proj", "JLD2", "LibGEOS", "Random", "Rasters", "NaturalEarth", "OffsetArrays", "Polylabel", "SafeTestsets", "Shapefile", "TGGeometry", "Test"]
test = ["ArchGDAL", "CoordinateTransformations", "DataFrames", "Distributions", "DimensionalData", "Downloads", "FlexiJoins", "GeoJSON", "GeometryBasics", "Proj", "JLD2", "LibGEOS", "Random", "Rasters", "NaturalEarth", "OffsetArrays", "Polylabel", "SafeTestsets", "Shapefile", "TGGeometry", "Test", "ParallelTestRunner"]
2 changes: 1 addition & 1 deletion test/extensions/flexijoins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using FlexiJoins
using DataFrames
import GeometryOps as GO
import GeoInterface as GI
using ..TestHelpers
using .TestHelpers

points = GI.MultiPoint(tuple.(rand(100), rand(100)))

Expand Down
2 changes: 1 addition & 1 deletion test/methods/angles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import GeoInterface as GI
import GeometryOps as GO
import GeometryBasics as GB
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

pt1 = GI.Point((0.0, 0.0))
mpt1 = GI.MultiPoint([pt1, pt1])
Expand Down
2 changes: 1 addition & 1 deletion test/methods/area.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
import GeoInterface as GI
import GeometryOps as GO
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

pt = LG.Point([0.0, 0.0])
empty_pt = LG.readgeom("POINT EMPTY")
Expand Down
2 changes: 1 addition & 1 deletion test/methods/centroid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import GeoInterface as GI
import GeometryOps as GO
import LibGEOS as LG
import ArchGDAL as AG
using ..TestHelpers
using .TestHelpers

@testset "Lines/Rings" begin

Expand Down
2 changes: 1 addition & 1 deletion test/methods/clipping/coverage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import GeoInterface as GI
import GeometryBasics as GB
import GeometryOps as GO
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

cell_extremes = (0.0, 20.0, 0.0, 20.0)
cell_extent = GI.Extents.Extent(X = (0.0, 20.0), Y = (0.0, 20.0))
Expand Down
2 changes: 1 addition & 1 deletion test/methods/clipping/cut.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Test
import GeoInterface as GI
import GeometryOps as GO
using ..TestHelpers
using .TestHelpers

# TODO this should also work with a LineString
# Some geom packages don't have `Line`
Expand Down
2 changes: 1 addition & 1 deletion test/methods/clipping/intersection_points.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
import GeoInterface as GI
import GeometryOps as GO
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

l1 = GI.LineString([(90000.0, 1000.0), (90000.0, 22500.0), (95000.0, 22500.0), (95000.0, 1000.0), (90000.0, 1000.0)])
l2 = GI.LineString([(90000.0, 7500.0), (107500.0, 27500.0), (112500.0, 27500.0), (95000.0, 7500.0), (90000.0, 7500.0)])
Expand Down
2 changes: 1 addition & 1 deletion test/methods/clipping/polygon_clipping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
import GeometryOps as GO
import GeoInterface as GI
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

# Test of polygon clipping
p1 = GI.Polygon([[(0.0, 0.0), (5.0, 5.0), (10.0, 0.0), (5.0, -5.0), (0.0, 0.0)]])
Expand Down
2 changes: 1 addition & 1 deletion test/methods/convex_hull.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
import GeoInterface as GI
import GeometryOps as GO
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

@testset "Basic example" begin
points = tuple.(rand(100), rand(100))
Expand Down
2 changes: 1 addition & 1 deletion test/methods/distance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ArchGDAL as AG
import GeoInterface as GI
import GeometryOps as GO
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

pt1 = LG.Point([0.0, 0.0])
pt2 = LG.Point([0.0, 1.0])
Expand Down
2 changes: 1 addition & 1 deletion test/methods/equals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import GeoInterface as GI
import GeometryBasics as GB
import GeometryOps as GO
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

p1 = LG.Point([0.0, 0.0])
p2 = LG.Point([0.0, 1.0])
Expand Down
2 changes: 1 addition & 1 deletion test/methods/geom_relations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import GeometryOps as GO
import GeoInterface as GI
import LibGEOS as LG
using Extents
using ..TestHelpers
using .TestHelpers

# Tests of DE-9IM Methods
pt1 = LG.Point([0.0, 0.0])
Expand Down
2 changes: 1 addition & 1 deletion test/methods/orientation.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Test, GeometryOps
import GeoInterface as GI
import GeometryOps as GO
using ..TestHelpers
using .TestHelpers

line1 = GI.LineString([[9.170356, 45.477985], [9.164434, 45.482551], [9.166644, 45.484003]])
line2 = GI.LineString([[9.169356, 45.477985], [9.163434, 45.482551], [9.165644, 45.484003]])
Expand Down
1 change: 1 addition & 0 deletions test/methods/perimeter.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Test
import GeometryOps as GO
import LibGEOS as LG
import Proj

# Basic geometries for testing
point = LG.Point([0.0, 0.0])
Expand Down
2 changes: 1 addition & 1 deletion test/methods/polygonize.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GeometryOps, GeoInterface, Test
using ..TestHelpers
using .TestHelpers

import GeometryOps as GO
import GeoInterface as GI
Expand Down
2 changes: 1 addition & 1 deletion test/primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Proj
import Shapefile
import DataFrames, Tables, DataAPI
using Downloads: download
using ..TestHelpers
using .TestHelpers

pv1 = [(1, 2), (3, 4), (5, 6), (1, 2)]
pv2 = [(3, 4), (5, 6), (6, 7), (3, 4)]
Expand Down
99 changes: 52 additions & 47 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
using GeometryOps
using Test
using SafeTestsets
using ParallelTestRunner: runtests

include("helpers.jl")

@testset "Core" begin
@safetestset "Algorithm" begin include("core/algorithm.jl") end
@safetestset "Manifold" begin include("core/manifold.jl") end
@safetestset "Applicators" begin include("core/applicators.jl") end
const init_code = quote
include(joinpath($(dirname(@__DIR__)), "test", "helpers.jl"))
Copy link

@giordano giordano Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using .TestHelpers
end

@safetestset "Types" begin include("types.jl") end
@safetestset "Primitives" begin include("primitives.jl") end
runtests(GeometryOps, ARGS; init_code)

# @testset "Core" begin
# @safetestset "Algorithm" begin include("core/algorithm.jl") end
# @safetestset "Manifold" begin include("core/manifold.jl") end
# @safetestset "Applicators" begin include("core/applicators.jl") end
# end

# @safetestset "Types" begin include("types.jl") end
# @safetestset "Primitives" begin include("primitives.jl") end

# Utils
@safetestset "Utils" begin include("utils/utils.jl") end
@safetestset "LoopStateMachine" begin include("utils/LoopStateMachine.jl") end
@safetestset "SpatialTreeInterface" begin include("utils/SpatialTreeInterface.jl") end
@safetestset "UnitSpherical" begin include("utils/unitspherical.jl") end
@safetestset "RobustCrossProduct" begin include("utils/robustcrossproduct.jl") end
# Methods
@safetestset "Angles" begin include("methods/angles.jl") end
@safetestset "Area" begin include("methods/area.jl") end
@safetestset "Perimeter" begin include("methods/perimeter.jl") end
@safetestset "Barycentric coordinate operations" begin include("methods/barycentric.jl") end
@safetestset "Orientation" begin include("methods/orientation.jl") end
@safetestset "Centroid" begin include("methods/centroid.jl") end
@safetestset "Convex Hull" begin include("methods/convex_hull.jl") end
@safetestset "DE-9IM Geom Relations" begin include("methods/geom_relations.jl") end
@safetestset "Distance" begin include("methods/distance.jl") end
@safetestset "Equals" begin include("methods/equals.jl") end
# Clipping
@safetestset "Coverage" begin include("methods/clipping/coverage.jl") end
@safetestset "Cut" begin include("methods/clipping/cut.jl") end
@safetestset "Intersection Point" begin include("methods/clipping/intersection_points.jl") end
@safetestset "Polygon Clipping" begin include("methods/clipping/polygon_clipping.jl") end
# Transformations
@safetestset "Embed Extent" begin include("transformations/extent.jl") end
@safetestset "Reproject" begin include("transformations/reproject.jl") end
@safetestset "Flip" begin include("transformations/flip.jl") end
@safetestset "Simplify" begin include("transformations/simplify.jl") end
@safetestset "Segmentize" begin include("transformations/segmentize.jl") end
@safetestset "Transform" begin include("transformations/transform.jl") end
@safetestset "Force Dimensions" begin include("transformations/forcedims.jl") end
@safetestset "Geometry Correction" begin include("transformations/correction/geometry_correction.jl") end
@safetestset "Closed Rings" begin include("transformations/correction/closed_ring.jl") end
@safetestset "Intersecting Polygons" begin include("transformations/correction/intersecting_polygons.jl") end
# Extensions
@safetestset "FlexiJoins" begin include("extensions/flexijoins.jl") end
@safetestset "LibGEOS" begin include("extensions/libgeos.jl") end
@safetestset "TGGeometry" begin include("extensions/tggeometry.jl") end
@safetestset "DataFrames" begin include("extensions/dataframes.jl") end
# # Utils
# @safetestset "Utils" begin include("utils/utils.jl") end
# @safetestset "LoopStateMachine" begin include("utils/LoopStateMachine.jl") end
# @safetestset "SpatialTreeInterface" begin include("utils/SpatialTreeInterface.jl") end
# @safetestset "UnitSpherical" begin include("utils/unitspherical.jl") end
# @safetestset "RobustCrossProduct" begin include("utils/robustcrossproduct.jl") end
# # Methods
# @safetestset "Angles" begin include("methods/angles.jl") end
# @safetestset "Area" begin include("methods/area.jl") end
# @safetestset "Perimeter" begin include("methods/perimeter.jl") end
# @safetestset "Barycentric coordinate operations" begin include("methods/barycentric.jl") end
# @safetestset "Orientation" begin include("methods/orientation.jl") end
# @safetestset "Centroid" begin include("methods/centroid.jl") end
# @safetestset "Convex Hull" begin include("methods/convex_hull.jl") end
# @safetestset "DE-9IM Geom Relations" begin include("methods/geom_relations.jl") end
# @safetestset "Distance" begin include("methods/distance.jl") end
# @safetestset "Equals" begin include("methods/equals.jl") end
# # Clipping
# @safetestset "Coverage" begin include("methods/clipping/coverage.jl") end
# @safetestset "Cut" begin include("methods/clipping/cut.jl") end
# @safetestset "Intersection Point" begin include("methods/clipping/intersection_points.jl") end
# @safetestset "Polygon Clipping" begin include("methods/clipping/polygon_clipping.jl") end
# # Transformations
# @safetestset "Embed Extent" begin include("transformations/extent.jl") end
# @safetestset "Reproject" begin include("transformations/reproject.jl") end
# @safetestset "Flip" begin include("transformations/flip.jl") end
# @safetestset "Simplify" begin include("transformations/simplify.jl") end
# @safetestset "Segmentize" begin include("transformations/segmentize.jl") end
# @safetestset "Transform" begin include("transformations/transform.jl") end
# @safetestset "Force Dimensions" begin include("transformations/forcedims.jl") end
# @safetestset "Geometry Correction" begin include("transformations/correction/geometry_correction.jl") end
# @safetestset "Closed Rings" begin include("transformations/correction/closed_ring.jl") end
# @safetestset "Intersecting Polygons" begin include("transformations/correction/intersecting_polygons.jl") end
# # Extensions
# @safetestset "FlexiJoins" begin include("extensions/flexijoins.jl") end
# @safetestset "LibGEOS" begin include("extensions/libgeos.jl") end
# @safetestset "TGGeometry" begin include("extensions/tggeometry.jl") end
# @safetestset "DataFrames" begin include("extensions/dataframes.jl") end
2 changes: 1 addition & 1 deletion test/transformations/correction/closed_ring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ArchGDAL as AG
import GeoInterface as GI
import GeometryBasics as GB
import GeometryOps as GO
using ..TestHelpers
using .TestHelpers

open_rectangle = GI.Polygon([collect.([(0, 0), (10, 0), (10, 10), (0, 10)])])

Expand Down
2 changes: 1 addition & 1 deletion test/transformations/correction/geometry_correction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ArchGDAL as AG
import GeoInterface as GI
import GeometryBasics as GB
import GeometryOps as GO
using ..TestHelpers
using .TestHelpers

open_rectangle = GI.Polygon([collect.([(0, 0), (10, 0), (10, 10), (0, 10)])])

Expand Down
2 changes: 1 addition & 1 deletion test/transformations/correction/intersecting_polygons.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Test
import GeoInterface as GI
import GeometryOps as GO
using ..TestHelpers
using .TestHelpers

p1 = GI.Polygon([[(0.0, 0.0), (3.0, 0.0), (3.0, 3.0), (0.0, 3.0), (0.0, 0.0)]])
# (p1, p2) -> one polygon inside of the other, sharing an edge
Expand Down
2 changes: 1 addition & 1 deletion test/transformations/extent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
import GeoInterface as GI
import GeometryOps as GO
using GeoInterface: Extents
using ..TestHelpers
using .TestHelpers

poly = GI.Polygon([GI.LinearRing([(1, 2), (3, 4), (5, 6), (1, 2)]),
GI.LinearRing([(3, 4), (5, 6), (6, 7), (3, 4)])])
Expand Down
2 changes: 1 addition & 1 deletion test/transformations/flip.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Test
import GeoInterface as GI
import GeometryOps as GO
using ..TestHelpers
using .TestHelpers

geom = GI.Polygon([GI.LinearRing([(1, 2), (3, 4), (5, 6), (1, 2)]),
GI.LinearRing([(3, 4), (5, 6), (6, 7), (3, 4)])])
Expand Down
2 changes: 1 addition & 1 deletion test/transformations/forcedims.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import GeometryOps as GO
import GeoInterface as GI
using ..TestHelpers
using .TestHelpers

using Test

Expand Down
2 changes: 1 addition & 1 deletion test/transformations/reproject.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using GeoFormatTypes
import GeoInterface as GI
import GeometryOps as GO
import Proj
using ..TestHelpers
using .TestHelpers

ring1 = GI.LinearRing([(1, 2), (7, 4), (5, 6), (1, 2)])
ring2 = GI.LinearRing([(11, 2), (20, 4), (15, 6), (11, 2)])
Expand Down
2 changes: 1 addition & 1 deletion test/transformations/segmentize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
using Proj
import GeometryOps as GO
import GeoInterface as GI
using ..TestHelpers
using .TestHelpers

@testset "Segmentation on multiple geometry levels" begin
ls = GI.LineString([(0, 0), (1, 1), (2, 2), (3, 3)])
Expand Down
2 changes: 1 addition & 1 deletion test/transformations/simplify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import GeoJSON, JLD2
import GeometryOps as GO
import GeoInterface as GI
import LibGEOS as LG
using ..TestHelpers
using .TestHelpers

datadir = realpath(joinpath(dirname(pathof(GO)), "../test/data"))
@testset "RadialDistance and VisvalingamWhyatt" begin
Expand Down
2 changes: 1 addition & 1 deletion test/transformations/transform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Test
using CoordinateTransformations
import GeoInterface as GI
import GeometryOps as GO
using ..TestHelpers
using .TestHelpers

geom = GI.Polygon([GI.LinearRing([(1, 2), (3, 4), (5, 6), (1, 2)]),
GI.LinearRing([(3, 4), (5, 6), (6, 7), (3, 4)])])
Expand Down
Loading