Skip to content

Commit 00ff75c

Browse files
committed
include in GeometryOps proper
1 parent fc1121c commit 00ff75c

File tree

8 files changed

+40
-97
lines changed

8 files changed

+40
-97
lines changed

Project.toml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
1515
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
1616
GeometryOpsCore = "05efe853-fabf-41c8-927e-7063c8b9f013"
1717
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
18+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1819
SortTileRecursiveTree = "746ee33f-1797-42c2-866d-db2fce69d14d"
1920
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2021
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
@@ -46,6 +47,7 @@ GeometryOpsCore = "=0.1.3"
4647
LibGEOS = "0.9.2"
4748
LinearAlgebra = "1"
4849
Proj = "1"
50+
Random = "1"
4951
SortTileRecursiveTree = "0.1.2"
5052
Statistics = "1"
5153
TGGeometry = "0.1"

docs/src/experiments/UnitSpherical.jl/UnitSpherical.jl

-79
This file was deleted.

src/GeometryOps.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ include("not_implemented_yet.jl") # functions that are not implemented yet, but
4242
include("utils/LoopStateMachine/LoopStateMachine.jl") # Utils for functions that can tell the loop they run in to do something via the return value
4343
include("utils/SpatialTreeInterface/SpatialTreeInterface.jl") # Utils for spatial trees
4444
include("utils/NaturalIndexing.jl") # Utils for natural indexing
45+
include("utils/UnitSpherical/UnitSpherical.jl") # Utils for unit spherical
4546
include("utils/utils.jl") # More general utility functions
4647

4748
# Load utility modules in
48-
using .NaturalIndexing, .SpatialTreeInterface, .LoopStateMachine
49+
using .NaturalIndexing, .SpatialTreeInterface, .LoopStateMachine, .UnitSpherical
4950

5051
include("methods/angles.jl")
5152
include("methods/area.jl")
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module UnitSpherical
2+
3+
using CoordinateTransformations
4+
using StaticArrays, LinearAlgebra
5+
import GeoInterface as GI, GeoFormatTypes as GFT
6+
7+
import Random
8+
9+
# using TestItems # this is a thin package that allows TestItems.@testitem to be parsed.
10+
11+
include("point.jl")
12+
include("coordinate_transforms.jl")
13+
include("slerp.jl")
14+
include("cap.jl")
15+
16+
export UnitSphericalPoint, UnitSphereFromGeographic, GeographicFromUnitSphere,
17+
slerp, SphericalCap
18+
19+
end

docs/src/experiments/UnitSpherical.jl/point.jl renamed to src/utils/UnitSpherical/point.jl

+17-17
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,23 @@ end
138138

139139
# ## Tests
140140

141-
@testitem "UnitSphericalPoint constructor" begin
142-
using GeometryOps.UnitSpherical
143-
import GeoInterface as GI
144-
145-
northpole = UnitSphericalPoint{Float64}(1, 0, 0)
146-
# test that the constructor works for a vector of length 3
147-
@test UnitSphericalPoint((1, 0, 0)) == northpole
148-
@test UnitSphericalPoint(SVector(1, 0, 0)) == northpole
149-
@test UnitSphericalPoint([1, 0, 0]) == northpole
150-
# test that the constructor works for a tuple of length 2
151-
# and interprets such a thing as a geographic point
152-
@test UnitSphericalPoint((90, 0)) == northpole
153-
@test UnitSphericalPoint([90, 0]) == northpole
154-
@test UnitSphericalPoint(GI.Point((90, 0))) == northpole
155-
156-
157-
end
141+
# @testitem "UnitSphericalPoint constructor" begin
142+
# using GeometryOps.UnitSpherical
143+
# import GeoInterface as GI
144+
145+
# northpole = UnitSphericalPoint{Float64}(1, 0, 0)
146+
# # test that the constructor works for a vector of length 3
147+
# @test UnitSphericalPoint((1, 0, 0)) == northpole
148+
# @test UnitSphericalPoint(SVector(1, 0, 0)) == northpole
149+
# @test UnitSphericalPoint([1, 0, 0]) == northpole
150+
# # test that the constructor works for a tuple of length 2
151+
# # and interprets such a thing as a geographic point
152+
# @test UnitSphericalPoint((90, 0)) == northpole
153+
# @test UnitSphericalPoint([90, 0]) == northpole
154+
# @test UnitSphericalPoint(GI.Point((90, 0))) == northpole
155+
156+
157+
# end
158158

159159
#=
160160
```@meta

0 commit comments

Comments
 (0)