Skip to content

Commit 19a1eea

Browse files
jaakkor2visr
authored andcommitted
precision functions
1 parent 5eda517 commit 19a1eea

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/geos_functions.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,3 +1097,23 @@ end
10971097
# The first point comes from g1 geometry and the second point comes from g2.
10981098
nearestPoints(g1::GEOSGeom, g2::GEOSGeom, context::GEOSContext = _context) =
10991099
GEOSNearestPoints_r(context.ptr, g1, g2)
1100+
1101+
# -----
1102+
# Precision functions
1103+
# -----
1104+
1105+
function getPrecision(geom::GEOSGeom, context::GEOSContext = _context)
1106+
result = GEOSGeom_getPrecision_r(context.ptr, geom)
1107+
if result == C_NULL
1108+
error("LibGEOS: Error in GEOSGeom_getPrecision_r")
1109+
end
1110+
result
1111+
end
1112+
1113+
function setPrecision(geom::GEOSGeom, gridSize::Real, flags::Int, context::GEOSContext = _context)
1114+
result = GEOSGeom_setPrecision_r(context.ptr, geom, gridSize, flags)
1115+
if result == C_NULL
1116+
error("LibGEOS: Error in GEOSGeom_setPrecision_r")
1117+
end
1118+
result
1119+
end

0 commit comments

Comments
 (0)