@@ -13,80 +13,96 @@ writegeom(obj::Geometry, wktwriter::WKTWriter, context::GEOSContext = _context)
1313 _writegeom (obj. ptr, wktwriter, context)
1414writegeom (obj:: Geometry , wkbwriter:: WKBWriter , context:: GEOSContext = _context) =
1515 _writegeom (obj. ptr, wkbwriter, context)
16- writegeom (obj:: Geometry , context:: GEOSContext = _context) = _writegeom (obj. ptr, context)
17-
18- function geomFromGEOS (ptr:: GEOSGeom )
19- if geomTypeId (ptr) == GEOS_POINT
20- return Point (ptr)
21- elseif geomTypeId (ptr) == GEOS_LINESTRING
22- return LineString (ptr)
23- elseif geomTypeId (ptr) == GEOS_LINEARRING
24- return LinearRing (ptr)
25- elseif geomTypeId (ptr) == GEOS_POLYGON
26- return Polygon (ptr)
27- elseif geomTypeId (ptr) == GEOS_MULTIPOINT
28- return MultiPoint (ptr)
29- elseif geomTypeId (ptr) == GEOS_MULTILINESTRING
30- return MultiLineString (ptr)
31- elseif geomTypeId (ptr) == GEOS_MULTIPOLYGON
32- return MultiPolygon (ptr)
16+ writegeom (obj:: Geometry , context:: GEOSContext = _context) =
17+ _writegeom (obj. ptr, context)
18+
19+ function geomFromGEOS (ptr:: GEOSGeom , context:: GEOSContext = _context)
20+ id = geomTypeId (ptr, context)
21+ if id == GEOS_POINT
22+ return Point (ptr, context)
23+ elseif id == GEOS_LINESTRING
24+ return LineString (ptr, context)
25+ elseif id == GEOS_LINEARRING
26+ return LinearRing (ptr, context)
27+ elseif id == GEOS_POLYGON
28+ return Polygon (ptr, context)
29+ elseif id == GEOS_MULTIPOINT
30+ return MultiPoint (ptr, context)
31+ elseif id == GEOS_MULTILINESTRING
32+ return MultiLineString (ptr, context)
33+ elseif id == GEOS_MULTIPOLYGON
34+ return MultiPolygon (ptr, context)
3335 else
34- @assert geomTypeId (ptr) == GEOS_GEOMETRYCOLLECTION
35- return GeometryCollection (ptr)
36+ @assert id == GEOS_GEOMETRYCOLLECTION
37+ return GeometryCollection (ptr, context )
3638 end
3739end
3840
3941readgeom (wktstring:: String , wktreader:: WKTReader , context:: GEOSContext = _context) =
40- geomFromGEOS (_readgeom (wktstring, wktreader, context))
42+ geomFromGEOS (_readgeom (wktstring, wktreader, context), context )
4143readgeom (wktstring:: String , context:: GEOSContext = _context) =
4244 readgeom (wktstring, WKTReader (context), context)
4345
4446readgeom (wkbbuffer:: Vector{Cuchar} , wkbreader:: WKBReader , context:: GEOSContext = _context) =
45- geomFromGEOS (_readgeom (wkbbuffer, wkbreader, context))
47+ geomFromGEOS (_readgeom (wkbbuffer, wkbreader, context), context )
4648readgeom (wkbbuffer:: Vector{Cuchar} , context:: GEOSContext = _context) =
4749 readgeom (wkbbuffer, WKBReader (context), context)
4850
4951# -----
5052# Linear referencing functions -- there are more, but these are probably sufficient for most purposes
5153# -----
52- project (line:: LineString , point:: Point ) = project (line. ptr, point. ptr)
53- projectNormalized (line:: LineString , point:: Point ) = projectNormalized (line. ptr, point. ptr)
54- interpolate (line:: LineString , dist:: Real ) = Point (interpolate (line. ptr, dist))
55- interpolateNormalized (line:: LineString , dist:: Real ) =
56- Point (interpolateNormalized (line. ptr, dist))
54+ project (line:: LineString , point:: Point , context:: GEOSContext = _context) =
55+ project (line. ptr, point. ptr, context)
56+ projectNormalized (line:: LineString , point:: Point , context:: GEOSContext = _context) =
57+ projectNormalized (line. ptr, point. ptr, context)
58+ interpolate (line:: LineString , dist:: Real , context:: GEOSContext = _context) =
59+ Point (interpolate (line. ptr, dist, context), context)
60+ interpolateNormalized (line:: LineString , dist:: Real , context:: GEOSContext = _context) =
61+ Point (interpolateNormalized (line. ptr, dist, context), context)
5762
5863# # -----
5964# # Topology operations
6065# # -----
6166
62- buffer (obj:: Geometry , dist:: Real , quadsegs:: Integer = 8 ) =
63- geomFromGEOS (buffer (obj. ptr, dist, quadsegs) )
67+ buffer (obj:: Geometry , dist:: Real , quadsegs:: Integer = 8 , context :: GEOSContext = _context ) =
68+ geomFromGEOS (buffer (obj. ptr, dist, quadsegs, context), context )
6469bufferWithStyle (
6570 obj:: Geometry ,
6671 dist:: Real ;
6772 quadsegs:: Integer = 8 ,
6873 endCapStyle:: GEOSBufCapStyles = GEOSBUF_CAP_ROUND,
6974 joinStyle:: GEOSBufJoinStyles = GEOSBUF_JOIN_ROUND,
7075 mitreLimit:: Real = 5.0 ,
71- ) = geomFromGEOS (
72- bufferWithStyle (obj. ptr, dist, quadsegs, endCapStyle, joinStyle, mitreLimit),
73- )
74- envelope (obj:: Geometry ) = geomFromGEOS (envelope (obj. ptr))
75- envelope (obj:: PreparedGeometry ) = geomFromGEOS (envelope (obj. ownedby. ptr))
76- minimumRotatedRectangle (obj:: Geometry ) = geomFromGEOS (minimumRotatedRectangle (obj. ptr))
77- convexhull (obj:: Geometry ) = geomFromGEOS (convexhull (obj. ptr))
78- boundary (obj:: Geometry ) = geomFromGEOS (boundary (obj. ptr))
79- unaryUnion (obj:: Geometry ) = geomFromGEOS (unaryUnion (obj. ptr))
80- pointOnSurface (obj:: Geometry ) = Point (pointOnSurface (obj. ptr))
81- centroid (obj:: Geometry ) = Point (centroid (obj. ptr))
82- node (obj:: Geometry ) = geomFromGEOS (node (obj. ptr))
83-
84- intersection (obj1:: Geometry , obj2:: Geometry ) =
85- geomFromGEOS (intersection (obj1. ptr, obj2. ptr))
86- difference (obj1:: Geometry , obj2:: Geometry ) = geomFromGEOS (difference (obj1. ptr, obj2. ptr))
87- symmetricDifference (obj1:: Geometry , obj2:: Geometry ) =
88- geomFromGEOS (symmetricDifference (obj1. ptr, obj2. ptr))
89- union (obj1:: Geometry , obj2:: Geometry ) = geomFromGEOS (union (obj1. ptr, obj2. ptr))
76+ context:: GEOSContext = _context,) =
77+ geomFromGEOS (bufferWithStyle (obj. ptr, dist, quadsegs, endCapStyle, joinStyle, mitreLimit, context), context)
78+
79+ envelope (obj:: Geometry , context:: GEOSContext = _context) =
80+ geomFromGEOS (envelope (obj. ptr, context), context)
81+ envelope (obj:: PreparedGeometry , context:: GEOSContext = _context) =
82+ geomFromGEOS (envelope (obj. ownedby. ptr, context), context)
83+ minimumRotatedRectangle (obj:: Geometry , context:: GEOSContext = _context) =
84+ geomFromGEOS (minimumRotatedRectangle (obj. ptr, context), context)
85+ convexhull (obj:: Geometry , context:: GEOSContext = _context) =
86+ geomFromGEOS (convexhull (obj. ptr, context), context)
87+ boundary (obj:: Geometry , context:: GEOSContext = _context) =
88+ geomFromGEOS (boundary (obj. ptr, context), context)
89+ unaryUnion (obj:: Geometry , context:: GEOSContext = _context) =
90+ geomFromGEOS (unaryUnion (obj. ptr, context), context)
91+ pointOnSurface (obj:: Geometry , context:: GEOSContext = _context) =
92+ Point (pointOnSurface (obj. ptr, context), context)
93+ centroid (obj:: Geometry , context:: GEOSContext = _context) =
94+ Point (centroid (obj. ptr, context), context)
95+ node (obj:: Geometry , context:: GEOSContext = _context) =
96+ geomFromGEOS (node (obj. ptr, context), context)
97+
98+ intersection (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
99+ geomFromGEOS (intersection (obj1. ptr, obj2. ptr, context), context)
100+ difference (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
101+ geomFromGEOS (difference (obj1. ptr, obj2. ptr, context), context)
102+ symmetricDifference (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
103+ geomFromGEOS (symmetricDifference (obj1. ptr, obj2. ptr, context), context)
104+ union (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
105+ geomFromGEOS (union (obj1. ptr, obj2. ptr, context), context)
90106
91107# # all arguments remain ownership of the caller (both Geometries and pointers)
92108# function polygonize(geoms::Vector{GEOSGeom})
@@ -107,41 +123,53 @@ union(obj1::Geometry, obj2::Geometry) = geomFromGEOS(union(obj1.ptr, obj2.ptr))
107123# result
108124# end
109125
110- simplify (obj:: Geometry , tol:: Real ) = geomFromGEOS (simplify (obj. ptr, tol))
111- topologyPreserveSimplify (obj:: Geometry , tol:: Real ) =
112- geomFromGEOS (topologyPreserveSimplify (obj. ptr, tol))
113- uniquePoints (obj:: Geometry ) = MultiPoint (uniquePoints (obj. ptr))
114- delaunayTriangulationEdges (obj:: Geometry , tol:: Real = 0.0 ) =
115- MultiLineString (delaunayTriangulation (obj. ptr, tol, true ))
116- delaunayTriangulation (obj:: Geometry , tol:: Real = 0.0 ) =
117- GeometryCollection (delaunayTriangulation (obj. ptr, tol, false ))
118- constrainedDelaunayTriangulation (obj:: Geometry ) =
119- GeometryCollection (constrainedDelaunayTriangulation (obj. ptr))
126+ simplify (obj:: Geometry , tol:: Real , context:: GEOSContext = _context) =
127+ geomFromGEOS (simplify (obj. ptr, tol, context), context)
128+ topologyPreserveSimplify (obj:: Geometry , tol:: Real , context:: GEOSContext = _context) =
129+ geomFromGEOS (topologyPreserveSimplify (obj. ptr, tol, context), context)
130+ uniquePoints (obj:: Geometry , context:: GEOSContext = _context) =
131+ MultiPoint (uniquePoints (obj. ptr, context), context)
132+ delaunayTriangulationEdges (obj:: Geometry , tol:: Real = 0.0 , context:: GEOSContext = _context) =
133+ MultiLineString (delaunayTriangulation (obj. ptr, tol, true , context), context)
134+ delaunayTriangulation (obj:: Geometry , tol:: Real = 0.0 , context:: GEOSContext = _context) =
135+ GeometryCollection (delaunayTriangulation (obj. ptr, tol, false , context), context)
136+ constrainedDelaunayTriangulation (obj:: Geometry , context:: GEOSContext = _context) =
137+ GeometryCollection (constrainedDelaunayTriangulation (obj. ptr, context), context)
120138
121139
122- sharedPaths (obj1:: LineString , obj2:: LineString ) =
123- GeometryCollection (sharedPaths (obj1. ptr, obj2. ptr) )
140+ sharedPaths (obj1:: LineString , obj2:: LineString , context :: GEOSContext = _context ) =
141+ GeometryCollection (sharedPaths (obj1. ptr, obj2. ptr, context), context )
124142
125143# # Snap first geometry on to second with given tolerance
126- snap (obj1:: Geometry , obj2:: Geometry , tol:: Real ) =
127- geomFromGEOS (snap (obj1. ptr, obj2. ptr, tol) )
144+ snap (obj1:: Geometry , obj2:: Geometry , tol:: Real , context :: GEOSContext = _context ) =
145+ geomFromGEOS (snap (obj1. ptr, obj2. ptr, tol, context), context )
128146
129147# -----
130148# Binary predicates
131149# -----
132150
133- disjoint (obj1:: Geometry , obj2:: Geometry ) = disjoint (obj1. ptr, obj2. ptr)
134- touches (obj1:: Geometry , obj2:: Geometry ) = touches (obj1. ptr, obj2. ptr)
135- intersects (obj1:: Geometry , obj2:: Geometry ) = intersects (obj1. ptr, obj2. ptr)
136- crosses (obj1:: Geometry , obj2:: Geometry ) = crosses (obj1. ptr, obj2. ptr)
137- within (obj1:: Geometry , obj2:: Geometry ) = within (obj1. ptr, obj2. ptr)
138- Base. contains (obj1:: Geometry , obj2:: Geometry ) = Base. contains (obj1. ptr, obj2. ptr)
139- overlaps (obj1:: Geometry , obj2:: Geometry ) = overlaps (obj1. ptr, obj2. ptr)
140- equals (obj1:: Geometry , obj2:: Geometry ) = equals (obj1. ptr, obj2. ptr)
141- equalsexact (obj1:: Geometry , obj2:: Geometry , tol:: Real ) =
142- equalsexact (obj1. ptr, obj2. ptr, tol)
143- covers (obj1:: Geometry , obj2:: Geometry ) = covers (obj1. ptr, obj2. ptr)
144- coveredby (obj1:: Geometry , obj2:: Geometry ) = coveredby (obj1. ptr, obj2. ptr)
151+ disjoint (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
152+ disjoint (obj1. ptr, obj2. ptr, context)
153+ touches (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
154+ touches (obj1. ptr, obj2. ptr, context)
155+ intersects (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
156+ intersects (obj1. ptr, obj2. ptr, context)
157+ crosses (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
158+ crosses (obj1. ptr, obj2. ptr, context)
159+ within (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
160+ within (obj1. ptr, obj2. ptr, context)
161+ Base. contains (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
162+ Base. contains (obj1. ptr, obj2. ptr, context)
163+ overlaps (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
164+ overlaps (obj1. ptr, obj2. ptr, context)
165+ equals (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
166+ equals (obj1. ptr, obj2. ptr, context)
167+ equalsexact (obj1:: Geometry , obj2:: Geometry , tol:: Real , context:: GEOSContext = _context) =
168+ equalsexact (obj1. ptr, obj2. ptr, tol, context)
169+ covers (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
170+ covers (obj1. ptr, obj2. ptr, context)
171+ coveredby (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
172+ coveredby (obj1. ptr, obj2. ptr, context)
145173
146174
147175# # -----
@@ -150,17 +178,26 @@ coveredby(obj1::Geometry, obj2::Geometry) = coveredby(obj1.ptr, obj2.ptr)
150178
151179prepareGeom (obj:: Geometry , context:: GEOSContext = _context) =
152180 PreparedGeometry (prepareGeom (obj. ptr, context), obj)
153- Base. contains (obj1:: PreparedGeometry , obj2:: Geometry ) = prepcontains (obj1. ptr, obj2. ptr)
154- containsproperly (obj1:: PreparedGeometry , obj2:: Geometry ) =
155- prepcontainsproperly (obj1. ptr, obj2. ptr)
156- coveredby (obj1:: PreparedGeometry , obj2:: Geometry ) = prepcoveredby (obj1. ptr, obj2. ptr)
157- covers (obj1:: PreparedGeometry , obj2:: Geometry ) = prepcovers (obj1. ptr, obj2. ptr)
158- crosses (obj1:: PreparedGeometry , obj2:: Geometry ) = prepcrosses (obj1. ptr, obj2. ptr)
159- disjoint (obj1:: PreparedGeometry , obj2:: Geometry ) = prepdisjoint (obj1. ptr, obj2. ptr)
160- intersects (obj1:: PreparedGeometry , obj2:: Geometry ) = prepintersects (obj1. ptr, obj2. ptr)
161- overlaps (obj1:: PreparedGeometry , obj2:: Geometry ) = prepoverlaps (obj1. ptr, obj2. ptr)
162- touches (obj1:: PreparedGeometry , obj2:: Geometry ) = preptouches (obj1. ptr, obj2. ptr)
163- within (obj1:: PreparedGeometry , obj2:: Geometry ) = prepwithin (obj1. ptr, obj2. ptr)
181+ Base. contains (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
182+ prepcontains (obj1. ptr, obj2. ptr, context)
183+ containsproperly (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
184+ prepcontainsproperly (obj1. ptr, obj2. ptr, context)
185+ coveredby (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
186+ prepcoveredby (obj1. ptr, obj2. ptr, context)
187+ covers (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context)=
188+ prepcovers (obj1. ptr, obj2. ptr, context)
189+ crosses (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
190+ prepcrosses (obj1. ptr, obj2. ptr, context)
191+ disjoint (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
192+ prepdisjoint (obj1. ptr, obj2. ptr, context)
193+ intersects (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
194+ prepintersects (obj1. ptr, obj2. ptr, context)
195+ overlaps (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
196+ prepoverlaps (obj1. ptr, obj2. ptr, context)
197+ touches (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
198+ preptouches (obj1. ptr, obj2. ptr, context)
199+ within (obj1:: PreparedGeometry , obj2:: Geometry , context:: GEOSContext = _context) =
200+ prepwithin (obj1. ptr, obj2. ptr, context)
164201
165202# # -----
166203# # STRtree functions
@@ -175,14 +212,21 @@ within(obj1::PreparedGeometry, obj2::Geometry) = prepwithin(obj1.ptr, obj2.ptr)
175212# # -----
176213# # Unary predicate - return 2 on exception, 1 on true, 0 on false
177214# # -----
178- isEmpty (obj:: Geometry ) = isEmpty (obj. ptr)
179- isEmpty (obj:: PreparedGeometry ) = isEmpty (obj. ownedby. ptr)
180- isSimple (obj:: Geometry ) = isSimple (obj. ptr)
181- isRing (obj:: Geometry ) = isRing (obj. ptr)
182- isValid (obj:: Geometry ) = isValid (obj. ptr)
183- hasZ (obj:: Geometry ) = hasZ (obj. ptr)
184-
185- isClosed (obj:: LineString ) = isClosed (obj. ptr) # Call only on LINESTRING
215+ isEmpty (obj:: Geometry , context:: GEOSContext = _context) =
216+ isEmpty (obj. ptr, context)
217+ isEmpty (obj:: PreparedGeometry , context:: GEOSContext = _context) =
218+ isEmpty (obj. ownedby. ptr, context)
219+ isSimple (obj:: Geometry , context:: GEOSContext = _context) =
220+ isSimple (obj. ptr, context)
221+ isRing (obj:: Geometry , context:: GEOSContext = _context) =
222+ isRing (obj. ptr, context)
223+ isValid (obj:: Geometry , context:: GEOSContext = _context) =
224+ isValid (obj. ptr, context)
225+ hasZ (obj:: Geometry , context:: GEOSContext = _context) =
226+ hasZ (obj. ptr, context)
227+
228+ isClosed (obj:: LineString , context:: GEOSContext = _context) =
229+ isClosed (obj. ptr, context) # Call only on LINESTRING
186230
187231# # -----
188232# # Dimensionally Extended 9 Intersection Model related
@@ -234,16 +278,23 @@ numGeometries(obj::Geometry, context::GEOSContext = _context) =
234278# getGeometries(ptr::GEOSGeom) = GEOSGeom[getGeometry(ptr, i) for i=1:numGeometries(ptr)]
235279# Gets sub-geomtry at index n or a vector of all sub-geometries
236280getGeometry (obj:: Geometry , n:: Integer , context:: GEOSContext = _context) =
237- geomFromGEOS (getGeometry (obj. ptr, n, context))
281+ geomFromGEOS (getGeometry (obj. ptr, n, context), context )
238282getGeometries (obj:: Geometry , context:: GEOSContext = _context) =
239- geomFromGEOS .( getGeometries (obj. ptr, context))
283+ [ geomFromGEOS (gptr, context) for gptr in getGeometries (obj. ptr, context)]
240284
241285# Converts Geometry to normal form (or canonical form).
242- normalize! (obj:: Geometry ) = normalize! (obj. ptr)
243-
244- interiorRing (obj:: Polygon , n:: Integer ) = LinearRing (interiorRing (obj. ptr, n))
245- interiorRings (obj:: Polygon ) = map (LinearRing, interiorRings (obj. ptr))
246- exteriorRing (obj:: Polygon ) = LinearRing (exteriorRing (obj. ptr))
286+ normalize! (obj:: Geometry , context:: GEOSContext = _context) =
287+ normalize! (obj. ptr, context)
288+
289+ # LinearRings in Polygons
290+ numInteriorRings (obj:: Polygon , context:: GEOSContext = _context) =
291+ numInteriorRings (obj. ptr, context)
292+ interiorRing (obj:: Polygon , n:: Integer , context:: GEOSContext = _context) =
293+ LinearRing (interiorRing (obj. ptr, n, context), context)
294+ interiorRings (obj:: Polygon , context:: GEOSContext = _context) =
295+ map (LinearRing, interiorRings (obj. ptr, context))
296+ exteriorRing (obj:: Polygon , context:: GEOSContext = _context) =
297+ LinearRing (exteriorRing (obj. ptr, context), context)
247298
248299# # Geometry must be a LineString, LinearRing or Point (Return NULL on exception)
249300# function getCoordSeq(ptr::GEOSGeom)
@@ -270,30 +321,39 @@ exteriorRing(obj::Polygon) = LinearRing(exteriorRing(obj.ptr))
270321# result
271322# end
272323
273- numPoints (obj:: LineString ) = numPoints (obj. ptr) # Call only on LINESTRING
274- startPoint (obj:: LineString ) = Point (startPoint (obj. ptr)) # Call only on LINESTRING
275- endPoint (obj:: LineString ) = Point (endPoint (obj. ptr)) # Call only on LINESTRING
324+ numPoints (obj:: LineString , context:: GEOSContext = _context) =
325+ numPoints (obj. ptr, context) # Call only on LINESTRING
326+ startPoint (obj:: LineString , context:: GEOSContext = _context) =
327+ Point (startPoint (obj. ptr, context), context) # Call only on LINESTRING
328+ endPoint (obj:: LineString , context:: GEOSContext = _context) =
329+ Point (endPoint (obj. ptr, context), context) # Call only on LINESTRING
276330
277331# # -----
278332# # Misc functions
279333# # -----
280334
281- area (obj:: Geometry ) = geomArea (obj. ptr)
282- geomLength (obj:: Geometry ) = geomLength (obj. ptr)
335+ area (obj:: Geometry , context:: GEOSContext = _context) =
336+ geomArea (obj. ptr, context)
337+ geomLength (obj:: Geometry , context:: GEOSContext = _context) =
338+ geomLength (obj. ptr, context)
339+
340+ distance (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
341+ geomDistance (obj1. ptr, obj2. ptr, context)
342+ hausdorffdistance (obj1:: Geometry , obj2:: Geometry , context:: GEOSContext = _context) =
343+ hausdorffdistance (obj1. ptr, obj2. ptr, context)
283344
284- distance (obj1:: Geometry , obj2:: Geometry ) = geomDistance (obj1. ptr, obj2. ptr)
285- hausdorffdistance (obj1:: Geometry , obj2:: Geometry ) = hausdorffdistance (obj1. ptr, obj2. ptr)
286- hausdorffdistance (obj1:: Geometry , obj2:: Geometry , densify:: Real ) =
287- hausdorffdistance (obj1. ptr, obj2. ptr, densify)
345+ hausdorffdistance (obj1:: Geometry , obj2:: Geometry , densify:: Real ,context:: GEOSContext = _context) =
346+ hausdorffdistance (obj1. ptr, obj2. ptr, densify, context)
288347
289348# Returns the closest points of the two geometries.
290349# The first point comes from g1 geometry and the second point comes from g2.
291- function nearestPoints (obj1:: Geometry , obj2:: Geometry )
292- points = nearestPoints (obj1. ptr, obj2. ptr)
350+ function nearestPoints (obj1:: Geometry , obj2:: Geometry , context :: GEOSContext = _context )
351+ points = nearestPoints (obj1. ptr, obj2. ptr, context )
293352 if points == C_NULL
294353 return Point[]
295354 else
296- return Point[Point (getCoordinates (points, 1 )), Point (getCoordinates (points, 2 ))]
355+ return Point[Point (getCoordinates (points, 1 , context), context),
356+ Point (getCoordinates (points, 2 , context), context)]
297357 end
298358end
299359
@@ -307,8 +367,8 @@ setPrecision(
307367 obj:: Geometry ,
308368 grid:: Real ;
309369 flags = GEOS_PREC_VALID_OUTPUT,
310- context:: GEOSContext = _context,
311- ) = setPrecision (obj. ptr, grid:: Real , flags, context)
370+ context:: GEOSContext = _context,) =
371+ setPrecision (obj. ptr, grid:: Real , flags, context)
312372
313373# ----
314374# Geometry information functions
0 commit comments