File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,10 @@ not disjoint with existing polygons of the feature*/
208
208
/** Test for containment of a point (uses GEOS) */
209
209
bool contains(QgsPoint* p);
210
210
211
+ /** Returns a buffer region around this geometry having the given width and with a specified number
212
+ of segments used to approximate curves */
213
+ QgsGeometry* buffer(double distance, int segments) /Factory/;
214
+
211
215
/**Creates a geos geometry from this features geometry. Note, that the returned object needs to be deleted*/
212
216
// TODO: unsupported class... would be possible to use PyGEOS?
213
217
//geos::Geometry* geosGeometry() const;
Original file line number Diff line number Diff line change @@ -5511,3 +5511,15 @@ double QgsGeometry::distance(QgsGeometry& geom)
5511
5511
5512
5512
return mGeos ->distance (geom.mGeos );
5513
5513
}
5514
+
5515
+
5516
+ QgsGeometry* QgsGeometry::buffer (double distance, int segments)
5517
+ {
5518
+ if (mGeos == NULL )
5519
+ exportWkbToGeos ();
5520
+ GEOS_GEOM::Geometry* geos = mGeos ->buffer (distance, segments);
5521
+ QgsGeometry* g = new QgsGeometry;
5522
+ g->setGeos (geos);
5523
+ return g;
5524
+ }
5525
+
Original file line number Diff line number Diff line change @@ -278,6 +278,10 @@ not disjoint with existing polygons of the feature*/
278
278
/* * Test for containment of a point (uses GEOS) */
279
279
bool contains (QgsPoint* p);
280
280
281
+ /* * Returns a buffer region around this geometry having the given width and with a specified number
282
+ of segments used to approximate curves */
283
+ QgsGeometry* buffer (double distance, int segments);
284
+
281
285
/* * Exports the geometry to mWkt
282
286
@return true in case of success and false else
283
287
*/
You can’t perform that action at this time.
0 commit comments