pyguymer3.geo.bufferSrc.buffer_MultiPolygon

pyguymer3.geo.bufferSrc.buffer_MultiPolygon(multipoly, dist, /, *, debug=True, eps=1e-12, fill=1.0, fillSpace='EuclideanSpace', keepInteriors=True, nAng=9, nIter=100, prefix='.', ramLimit=1073741824, simp=0.1, tol=1e-10)[source]

Buffer a MultiPolygon

This function reads in a MultiPolygon, made up of Polygons (with an exterior and any number of interiors), that exists on the surface of the Earth and returns a [Multi]Polygon of the same MultiPolygon buffered by a constant distance (in metres).

Parameters:
  • multipoly (shapely.geometry.multipolygon.MultiPolygon) – the MultiPolygon

  • dist (float) – the Geodesic distance to buffer each point within the MultiPolygon by (in metres)

  • debug (bool, optional) – print debug messages

  • eps (float, optional) – the tolerance of the Vincenty formula iterations

  • fill (float, optional) – the Euclidean or Geodesic distance to fill in between each point within the shapes by (in degrees or metres)

  • fillSpace (str, optional) – the geometric space to perform the filling in (either “EuclideanSpace” or “GeodesicSpace”)

  • keepInteriors (bool, optional) – keep the interiors of the Polygon

  • nAng (int, optional) – the number of angles around each point within the MultiPolygon that are calculated when buffering

  • nIter (int, optional) – the maximum number of iterations (particularly the Vincenty formula)

  • prefix (str, optional) – change the name of the output debugging CSVs

  • ramLimit (int, optional) – the maximum RAM usage of each “large” array (in bytes)

  • simp (float, optional) – how much intermediary [Multi]Polygons are simplified by; negative values disable simplification (in degrees)

  • tol (float, optional) – the Euclidean distance that defines two points as being the same (in degrees)

Returns:

buffs – the buffered MultiPolygon

Return type:

shapely.geometry.polygon.Polygon, shapely.geometry.multipolygon.MultiPolygon

Notes

According to the Shapely documentation for the method object.buffer() :

“Passed a distance of 0, buffer() can sometimes be used to “clean” self-touching or self-crossing polygons such as the classic “bowtie”. Users have reported that very small distance values sometimes produce cleaner results than 0. Your mileage may vary when cleaning surfaces.”

According to the Shapely documentation for the function shapely.geometry.polygon.orient() :

“A sign of 1.0 means that the coordinates of the product’s exterior ring will be oriented counter-clockwise.”

Copyright 2017 Thomas Guymer [1]

References