Skip to content

Commit 0a40f5c

Browse files
committed
use GEOS_jll GEOS 3.8.0 artifacts
This will require at least julia 1.3. Testing to see if it works. Some tests with pointOnSurface had to be updated. This is expected since it can return any point on the surface. Other than that some GeometryCollections are now ordered differently, and the unary union of an empty point remains an empty point.
1 parent c834e01 commit 0a40f5c

File tree

7 files changed

+11
-102
lines changed

7 files changed

+11
-102
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ os:
33
- osx
44
- linux
55
julia:
6-
- 1.0
7-
- 1
6+
- 1.3
87
- nightly
98
matrix:
109
allow_failures:

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ uuid = "a90b1aa1-3769-5649-ba7e-abc5a9d163eb"
33
version = "0.5.1"
44

55
[deps]
6-
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
76
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
7+
GEOS_jll = "d604d12d-fa86-5845-992e-78dc15976526"
88
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
99
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1010
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1111

1212
[compat]
13-
BinaryProvider = "0.5.3"
1413
CEnum = "0.2.0"
1514
GeoInterface = "0.4.0"
1615
julia = "1.0.0"

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
environment:
22
matrix:
3-
- julia_version: 1.0
4-
- julia_version: 1
3+
- julia_version: 1.3
54
- julia_version: nightly
65

76
platform:

deps/build.jl

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/LibGEOS.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
module LibGEOS
22

3-
# Load in `deps.jl`, complaining if it does not exist
4-
const depsjl_path = joinpath(@__DIR__, "..", "deps", "deps.jl")
5-
if !isfile(depsjl_path)
6-
error("LibGEOS not installed properly, run Pkg.build(\"LibGEOS\"), restart Julia and try again")
7-
end
8-
include(depsjl_path)
9-
3+
using GEOS_jll
104
using GeoInterface
115
using Libdl
126
using CEnum
@@ -111,9 +105,6 @@ module LibGEOS
111105
end
112106

113107
function __init__()
114-
# Always check your dependencies from `deps.jl`
115-
check_deps()
116-
117108
global _context = GEOSContext()
118109
end
119110

test/test_geos_functions.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
hole1 = LibGEOS.createLinearRing(Vector{Float64}[[1,8],[2,8],[2,9],[1,9],[1,8]])
1717
hole2 = LibGEOS.createLinearRing(Vector{Float64}[[8,1],[9,1],[9,2],[8,2],[8,1]])
1818
polygon = LibGEOS.createPolygon(shell,LibGEOS.GEOSGeom[hole1,hole2])
19-
@test LibGEOS.getDimensions(polygon) == 2
19+
@test LibGEOS.getGeomDimensions(polygon) == 2
2020
@test LibGEOS.geomTypeId(polygon) == LibGEOS.GEOS_POLYGON
2121
@test LibGEOS.geomArea(polygon) 98.0 atol=1e-5
2222
exterior = LibGEOS.exteriorRing(polygon)
@@ -397,7 +397,7 @@
397397
56.528833333300 25.2103333333,
398398
56.528666666700 25.2101666667))""")
399399
geom2_ = LibGEOS.pointOnSurface(geom1_)
400-
@test LibGEOS.getCoordinates(LibGEOS.getCoordSeq(geom2_))[1] [56.528917,25.210417] atol=1e-5
400+
@test LibGEOS.getCoordinates(LibGEOS.getCoordSeq(geom2_))[1] [56.5286666667, 25.2101666667] atol=1e-5
401401
LibGEOS.destroyGeom(geom1_)
402402
LibGEOS.destroyGeom(geom2_)
403403

@@ -596,7 +596,7 @@
596596
# GEOSUnaryUnionTest
597597
geom1_ = LibGEOS._readgeom("POINT EMPTY")
598598
geom2_ = LibGEOS.unaryUnion(geom1_)
599-
@test LibGEOS._writegeom(geom2_) == "GEOMETRYCOLLECTION EMPTY"
599+
@test LibGEOS._writegeom(geom2_) == "POINT EMPTY"
600600
LibGEOS.destroyGeom(geom1_)
601601
LibGEOS.destroyGeom(geom2_)
602602

@@ -626,7 +626,7 @@
626626

627627
geom1_ = LibGEOS._readgeom("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT(6 7, 6 5, 6 7), LINESTRING(0 5, 10 5), LINESTRING(4 -10, 4 10))")
628628
geom2_ = LibGEOS.unaryUnion(geom1_)
629-
geom3_ = LibGEOS._readgeom("GEOMETRYCOLLECTION (POINT (6 7), LINESTRING (4 -10, 4 5), LINESTRING (4 5, 4 10), LINESTRING (0 5, 4 5), LINESTRING (4 5, 10 5))")
629+
geom3_ = LibGEOS._readgeom("GEOMETRYCOLLECTION (POINT (6 7), LINESTRING (0 5, 4 5), LINESTRING (4 5, 10 5), LINESTRING (4 -10, 4 5), LINESTRING (4 5, 4 10))")
630630
@test LibGEOS._writegeom(geom2_) == LibGEOS._writegeom(geom3_)
631631
LibGEOS.destroyGeom(geom1_)
632632
LibGEOS.destroyGeom(geom2_)

test/test_geos_operations.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ end
147147
56.529000000000 25.2105000000,
148148
56.528833333300 25.2103333333,
149149
56.528666666700 25.2101666667))""")
150-
@test GeoInterface.coordinates(pointOnSurface(g1)) [56.528917,25.210417] atol=1e-5
150+
@test GeoInterface.coordinates(pointOnSurface(g1)) [56.5286666667, 25.2101666667] atol=1e-5
151151

152152
# GEOSSharedPathsTest
153153
factcheck(sharedPaths,
@@ -196,12 +196,12 @@ end
196196

197197
# GEOSUnaryUnionTest
198198
test_unaryunion(geom::String, expected::String) = factcheck(unaryUnion, geom, expected)
199-
test_unaryunion("POINT EMPTY", "GEOMETRYCOLLECTION EMPTY")
199+
test_unaryunion("POINT EMPTY", "POINT EMPTY")
200200
test_unaryunion("POINT (6 3)", "POINT (6 3)")
201201
test_unaryunion("POINT (4 5 6)", "POINT Z (4 5 6)")
202202
test_unaryunion("MULTIPOINT (4 5, 6 7, 4 5, 6 5, 6 7)", "MULTIPOINT (4 5, 6 5, 6 7)")
203203
test_unaryunion("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT(6 7, 6 5, 6 7), LINESTRING(0 5, 10 5), LINESTRING(4 -10, 4 10))",
204-
"GEOMETRYCOLLECTION (POINT (6 7), LINESTRING (4 -10, 4 5), LINESTRING (4 5, 4 10), LINESTRING (0 5, 4 5), LINESTRING (4 5, 10 5))")
204+
"GEOMETRYCOLLECTION (POINT (6 7), LINESTRING (0 5, 4 5), LINESTRING (4 5, 10 5), LINESTRING (4 -10, 4 5), LINESTRING (4 5, 4 10))")
205205
test_unaryunion("GEOMETRYCOLLECTION (POINT(4 5), MULTIPOINT(6 7, 6 5, 6 7), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)))",
206206
"GEOMETRYCOLLECTION (POINT (6 7), POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0), (5 6, 7 6, 7 8, 5 8, 5 6)))")
207207
test_unaryunion("GEOMETRYCOLLECTION (MULTILINESTRING((5 7, 12 7), (4 5, 6 5), (5.5 7.5, 6.5 7.5)), POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(5 6, 7 6, 7 8, 5 8, 5 6)))",

0 commit comments

Comments
 (0)