Skip to content

Commit e1f2b25

Browse files
committed
wrap GEOS 3.9.0
1 parent 4098f61 commit e1f2b25

File tree

5 files changed

+86
-14
lines changed

5 files changed

+86
-14
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LibGEOS"
22
uuid = "a90b1aa1-3769-5649-ba7e-abc5a9d163eb"
33
license = "MIT"
4-
version = "0.6.6"
4+
version = "0.6.7"
55

66
[deps]
77
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
@@ -10,7 +10,7 @@ GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
1010

1111
[compat]
1212
CEnum = "0.2, 0.3, 0.4"
13-
GEOS_jll = "3.8"
13+
GEOS_jll = "3.9"
1414
GeoInterface = "0.4, 0.5"
1515
julia = "1.3"
1616

gen/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[deps]
2+
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
3+
GEOS_jll = "d604d12d-fa86-5845-992e-78dc15976526"
4+
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"

gen/wrap_geos.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#=
22
Run this file to regenerate `geos_c.jl` and `geos_common.jl`.
33
4-
It expects a GEOS install in the deps folder, run `build LibGEOS` in Pkg mode
5-
if these are not in place.
6-
74
The wrapped GEOS version and provided GEOS version should be kept in sync.
8-
So when updating the GEOSBuilder provided version, also rerun this wrapper.
5+
So when updating the GEOS_jll version, also rerun this wrapper.
96
This way we ensure that the provided library has the same functions available
107
as the wrapped one. Furthermore this makes sure constants in `geos_common.jl`
118
like `GEOS_VERSION`, which are just strings, are correct.
@@ -15,8 +12,7 @@ using Clang
1512
using MacroTools
1613
using GEOS_jll
1714

18-
# maybe use GEOS_jll.prefix later pending https://github.com/JuliaPackaging/BinaryBuilder.jl/pull/525
19-
includedir = abspath(joinpath(dirname(GEOS_jll.libgeos_path), "..", "include"))
15+
includedir = joinpath(GEOS_jll.artifact_dir, "include")
2016
headerfiles = [joinpath(includedir, "geos_c.h")]
2117

2218
"""

src/geos_c.jl

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ function GEOSIntersection_r(handle, g1, g2)
282282
ccall((:GEOSIntersection_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), handle, g1, g2)
283283
end
284284

285+
function GEOSIntersectionPrec_r(handle, g1, g2, gridSize)
286+
ccall((:GEOSIntersectionPrec_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), handle, g1, g2, gridSize)
287+
end
288+
285289
function GEOSConvexHull_r(handle, g)
286290
ccall((:GEOSConvexHull_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}), handle, g)
287291
end
@@ -290,6 +294,14 @@ function GEOSMinimumRotatedRectangle_r(handle, g)
290294
ccall((:GEOSMinimumRotatedRectangle_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}), handle, g)
291295
end
292296

297+
function GEOSMaximumInscribedCircle_r(handle, g, tolerance)
298+
ccall((:GEOSMaximumInscribedCircle_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Cdouble), handle, g, tolerance)
299+
end
300+
301+
function GEOSLargestEmptyCircle_r(handle, g, boundary, tolerance)
302+
ccall((:GEOSLargestEmptyCircle_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), handle, g, boundary, tolerance)
303+
end
304+
293305
function GEOSMinimumWidth_r(handle, g)
294306
ccall((:GEOSMinimumWidth_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}), handle, g)
295307
end
@@ -306,10 +318,18 @@ function GEOSDifference_r(handle, g1, g2)
306318
ccall((:GEOSDifference_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), handle, g1, g2)
307319
end
308320

321+
function GEOSDifferencePrec_r(handle, g1, g2, gridSize)
322+
ccall((:GEOSDifferencePrec_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), handle, g1, g2, gridSize)
323+
end
324+
309325
function GEOSSymDifference_r(handle, g1, g2)
310326
ccall((:GEOSSymDifference_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), handle, g1, g2)
311327
end
312328

329+
function GEOSSymDifferencePrec_r(handle, g1, g2, gridSize)
330+
ccall((:GEOSSymDifferencePrec_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), handle, g1, g2, gridSize)
331+
end
332+
313333
function GEOSBoundary_r(handle, g)
314334
ccall((:GEOSBoundary_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}), handle, g)
315335
end
@@ -318,10 +338,18 @@ function GEOSUnion_r(handle, g1, g2)
318338
ccall((:GEOSUnion_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), handle, g1, g2)
319339
end
320340

341+
function GEOSUnionPrec_r(handle, g1, g2, gridSize)
342+
ccall((:GEOSUnionPrec_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), handle, g1, g2, gridSize)
343+
end
344+
321345
function GEOSUnaryUnion_r(handle, g)
322346
ccall((:GEOSUnaryUnion_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}), handle, g)
323347
end
324348

349+
function GEOSUnaryUnionPrec_r(handle, g, gridSize)
350+
ccall((:GEOSUnaryUnionPrec_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}, Cdouble), handle, g, gridSize)
351+
end
352+
325353
function GEOSCoverageUnion_r(handle, g)
326354
ccall((:GEOSCoverageUnion_r, libgeos), Ptr{GEOSGeometry}, (GEOSContextHandle_t, Ptr{GEOSGeometry}), handle, g)
327355
end
@@ -502,6 +530,14 @@ function GEOSPreparedWithin_r(handle, pg1, g2)
502530
ccall((:GEOSPreparedWithin_r, libgeos), UInt8, (GEOSContextHandle_t, Ptr{GEOSPreparedGeometry}, Ptr{GEOSGeometry}), handle, pg1, g2)
503531
end
504532

533+
function GEOSPreparedNearestPoints_r(handle, pg1, g2)
534+
ccall((:GEOSPreparedNearestPoints_r, libgeos), Ptr{GEOSCoordSequence}, (GEOSContextHandle_t, Ptr{GEOSPreparedGeometry}, Ptr{GEOSGeometry}), handle, pg1, g2)
535+
end
536+
537+
function GEOSPreparedDistance_r(handle, pg1, g2, dist)
538+
ccall((:GEOSPreparedDistance_r, libgeos), Cint, (GEOSContextHandle_t, Ptr{GEOSPreparedGeometry}, Ptr{GEOSGeometry}, Ptr{Cdouble}), handle, pg1, g2, dist)
539+
end
540+
505541
function GEOSSTRtree_create_r(handle, nodeCapacity)
506542
ccall((:GEOSSTRtree_create_r, libgeos), Ptr{GEOSSTRtree}, (GEOSContextHandle_t, Csize_t), handle, nodeCapacity)
507543
end
@@ -1090,6 +1126,10 @@ function GEOSIntersection(g1, g2)
10901126
ccall((:GEOSIntersection, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), g1, g2)
10911127
end
10921128

1129+
function GEOSIntersectionPrec(g1, g2, gridSize)
1130+
ccall((:GEOSIntersectionPrec, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), g1, g2, gridSize)
1131+
end
1132+
10931133
function GEOSConvexHull(g)
10941134
ccall((:GEOSConvexHull, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry},), g)
10951135
end
@@ -1098,6 +1138,14 @@ function GEOSMinimumRotatedRectangle(g)
10981138
ccall((:GEOSMinimumRotatedRectangle, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry},), g)
10991139
end
11001140

1141+
function GEOSMaximumInscribedCircle(g, tolerance)
1142+
ccall((:GEOSMaximumInscribedCircle, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Cdouble), g, tolerance)
1143+
end
1144+
1145+
function GEOSLargestEmptyCircle(g, boundary, tolerance)
1146+
ccall((:GEOSLargestEmptyCircle, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), g, boundary, tolerance)
1147+
end
1148+
11011149
function GEOSMinimumWidth(g)
11021150
ccall((:GEOSMinimumWidth, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry},), g)
11031151
end
@@ -1114,10 +1162,18 @@ function GEOSDifference(g1, g2)
11141162
ccall((:GEOSDifference, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), g1, g2)
11151163
end
11161164

1165+
function GEOSDifferencePrec(g1, g2, gridSize)
1166+
ccall((:GEOSDifferencePrec, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), g1, g2, gridSize)
1167+
end
1168+
11171169
function GEOSSymDifference(g1, g2)
11181170
ccall((:GEOSSymDifference, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), g1, g2)
11191171
end
11201172

1173+
function GEOSSymDifferencePrec(g1, g2, gridSize)
1174+
ccall((:GEOSSymDifferencePrec, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), g1, g2, gridSize)
1175+
end
1176+
11211177
function GEOSBoundary(g)
11221178
ccall((:GEOSBoundary, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry},), g)
11231179
end
@@ -1126,10 +1182,18 @@ function GEOSUnion(g1, g2)
11261182
ccall((:GEOSUnion, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}), g1, g2)
11271183
end
11281184

1185+
function GEOSUnionPrec(g1, g2, gridSize)
1186+
ccall((:GEOSUnionPrec, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Ptr{GEOSGeometry}, Cdouble), g1, g2, gridSize)
1187+
end
1188+
11291189
function GEOSUnaryUnion(g)
11301190
ccall((:GEOSUnaryUnion, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry},), g)
11311191
end
11321192

1193+
function GEOSUnaryUnionPrec(g, gridSize)
1194+
ccall((:GEOSUnaryUnionPrec, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry}, Cdouble), g, gridSize)
1195+
end
1196+
11331197
function GEOSCoverageUnion(g)
11341198
ccall((:GEOSCoverageUnion, libgeos), Ptr{GEOSGeometry}, (Ptr{GEOSGeometry},), g)
11351199
end
@@ -1310,6 +1374,14 @@ function GEOSPreparedWithin(pg1, g2)
13101374
ccall((:GEOSPreparedWithin, libgeos), UInt8, (Ptr{GEOSPreparedGeometry}, Ptr{GEOSGeometry}), pg1, g2)
13111375
end
13121376

1377+
function GEOSPreparedNearestPoints(pg1, g2)
1378+
ccall((:GEOSPreparedNearestPoints, libgeos), Ptr{GEOSCoordSequence}, (Ptr{GEOSPreparedGeometry}, Ptr{GEOSGeometry}), pg1, g2)
1379+
end
1380+
1381+
function GEOSPreparedDistance(pg1, g2, dist)
1382+
ccall((:GEOSPreparedDistance, libgeos), Cint, (Ptr{GEOSPreparedGeometry}, Ptr{GEOSGeometry}, Ptr{Cdouble}), pg1, g2, dist)
1383+
end
1384+
13131385
function GEOSSTRtree_create(nodeCapacity)
13141386
ccall((:GEOSSTRtree_create, libgeos), Ptr{GEOSSTRtree}, (Csize_t,), nodeCapacity)
13151387
end

src/geos_common.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33

44
const GEOS_VERSION_MAJOR = 3
5-
const GEOS_VERSION_MINOR = 8
5+
const GEOS_VERSION_MINOR = 9
66
const GEOS_VERSION_PATCH = 0
7-
const GEOS_VERSION = "3.8.0"
8-
const GEOS_JTS_PORT = "1.13.0"
7+
const GEOS_VERSION = "3.9.0"
8+
const GEOS_JTS_PORT = "1.17.0"
99
const GEOS_CAPI_VERSION_MAJOR = 1
10-
const GEOS_CAPI_VERSION_MINOR = 13
11-
const GEOS_CAPI_VERSION_PATCH = 1
12-
const GEOS_CAPI_VERSION = "3.8.0-CAPI-1.13.1"
10+
const GEOS_CAPI_VERSION_MINOR = 16
11+
const GEOS_CAPI_VERSION_PATCH = 2
12+
const GEOS_CAPI_VERSION = "3.9.0-CAPI-1.16.2"
1313
const GEOS_CAPI_FIRST_INTERFACE = GEOS_CAPI_VERSION_MAJOR
1414
const GEOS_CAPI_LAST_INTERFACE = GEOS_CAPI_VERSION_MAJOR + GEOS_CAPI_VERSION_MINOR
1515
const GEOS_PREC_NO_TOPO = 1 << 0

0 commit comments

Comments
 (0)