Skip to content
On this page

geos.GEOSBuffer ⇒ number

Computes a buffer area around this geometry having the given width and with a specified accuracy of approximation for circular arcs.

Kind: Exported member
Returns: number - A pointer to the resulting geometry, or NULL if an exception was thrown.

ParamTypeDescription
gnumberA pointer to the input geometry.
widthnumberThe width of the buffer area around this geometry. Negative values create a buffer inside this geometry.
quadsegsnumberThe number of segments used to approximate a quarter circle (defaults to 8).

geos.GEOSBufferParams_create ⇒ number

Create a new GEOSBufferParams object

Kind: Exported member
Returns: number - A pointer to the newly allocated GEOSBufferParams object


geos.GEOSBufferParams_create_r ⇒ number

Create a new GEOSBufferParams object with a context handle

Kind: Exported member
Returns: number - A pointer to the newly allocated GEOSBufferParams object

ParamTypeDescription
handlenumberThe context handle

geos.GEOSBufferParams_destroy ⏏

Destroy a GEOSBufferParams object

Kind: Exported member

ParamTypeDescription
paramsnumberA pointer to the GEOSBufferParams object to destroy

geos.GEOSBufferParams_destroy_r ⏏

Destroy a GEOSBufferParams object with a context handle

Kind: Exported member

ParamTypeDescription
handlenumberThe context handle
paramsnumberA pointer to the GEOSBufferParams object to destroy

geos.GEOSBufferParams_setEndCapStyle ⇒ number

Set the end cap style for a GEOSBufferParams object

Kind: Exported member
Returns: number - 1 on success, 0 on failure

ParamTypeDescription
paramsnumberA pointer to the GEOSBufferParams object to modify
stylenumberThe end cap style, one of GEOSBUF_CAP_ROUND, GEOSBUF_CAP_FLAT, or GEOSBUF_CAP_SQUARE

geos.GEOSBufferParams_setEndCapStyle_r ⇒ null

Sets the end cap style of the buffer parameters.

Kind: Exported member

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
pnumberThe pointer to the buffer parameters object.
stylenumberThe end cap style code. Possible values are: - 1: round - 2: flat - 3: square

geos.GEOSBufferParams_setJoinStyle ⇒ null

Sets the join style of the buffer parameters.

Kind: Exported member

ParamTypeDescription
pnumberThe pointer to the buffer parameters object.
joinStylenumberThe join style code. Possible values are: - 1: round - 2: mitre - 3: bevel

geos.GEOSBufferParams_setJoinStyle_r ⇒ null

Sets the join style of the buffer parameters.

Kind: Exported member

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
pnumberThe pointer to the buffer parameters object.
joinStylenumberThe join style code. Possible values are: - 1: round - 2: mitre - 3: bevel

geos.GEOSBufferParams_setMitreLimit ⇒ null

Sets the mitre limit of the buffer parameters.

Kind: Exported member

ParamTypeDescription
pnumberThe pointer to the buffer parameters object.
mitreLimitnumberThe mitre limit value. This is used for very sharp corners. The mitre limit is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend the original geometry. To prevent unreasonable geometry, the mitre limit allows controlling how far the miter join can extend from the original geometry. If the limit is exceeded, the join will be beveled.

geos.GEOSBufferParams_setMitreLimit_r ⇒ null

Sets the mitre limit of the buffer parameters.

Kind: Exported member

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
pnumberThe pointer to the buffer parameters object.
mitreLimitnumberThe mitre limit value. This is used for very sharp corners. The mitre limit is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend the original geometry. To prevent unreasonable geometry, the mitre limit allows controlling how far the miter join can extend from the original geometry. If the limit is exceeded, the join will be beveled.

geos.GEOSBufferParams_setQuadrantSegments ⇒ null

Sets the number of line segments used to approximate an angle fillet.

Kind: Exported member
Returns: null - - No return value.

ParamTypeDescription
pnumberA pointer to a GEOSBufferParams object.
quadSegsnumberThe number of segments in a fillet for a quadrant, must be >= 1.

geos.GEOSBufferParams_setQuadrantSegments_r ⇒ null

Sets the number of line segments used to approximate an angle fillet, with a context handle.

Kind: Exported member
Returns: null - - No return value.

ParamTypeDescription
handlenumberA pointer to a GEOSContextHandle object.
pnumberA pointer to a GEOSBufferParams object.
quadSegsnumberThe number of segments in a fillet for a quadrant, must be >= 1.

geos.GEOSBufferParams_setSingleSided ⇒ null

Sets whether the computed buffer should be single-sided. A single-sided buffer is constructed on only one side of each input line. The side is determined by the sign of the buffer distance:

  • A positive distance indicates the left-hand side
  • A negative distance indicates the right-hand side The single-sided buffer of point geometries is the same as the regular buffer. The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of CAP_FLAT.

Kind: Exported member
Returns: null - - No return value.

ParamTypeDescription
pnumberA pointer to a GEOSBufferParams object.
singleSidednumberA boolean value indicating whether the buffer is single-sided or not.

geos.GEOSBufferParams_setSingleSided_r ⇒ null

Sets whether the computed buffer should be single-sided, with a context handle. A single-sided buffer is constructed on only one side of each input line. The side is determined by the sign of the buffer distance:

  • A positive distance indicates the left-hand side
  • A negative distance indicates the right-hand side The single-sided buffer of point geometries is the same as the regular buffer. The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of CAP_FLAT.

Kind: Exported member
Returns: null - - No return value.

ParamTypeDescription
handlenumberA pointer to a GEOSContextHandle object.
pnumberA pointer to a GEOSBufferParams object.
singleSidednumberA boolean value indicating whether the buffer is single-sided or not.

geos.GEOSBufferWithParams ⇒ number

Returns the buffer computed for a geometry for a given buffer distance and parameters.

Kind: Exported member
Returns: number - - A pointer to a GEOSGeometry object representing the output geometry, or NULL if an exception occurred.

ParamTypeDescription
gnumberA pointer to a GEOSGeometry object representing the input geometry.
pnumberA pointer to a GEOSBufferParams object containing the buffer parameters.
widthnumberThe buffer distance.

geos.GEOSBufferWithParams_r ⇒ number

Creates a buffer area around this geometry having the given width and with a specified accuracy of approximation for circular arcs.

Kind: Exported member
Returns: number - A pointer to the geometry representing the buffer area. Returns NULL on exception.

ParamTypeDescription
handlenumberThe GEOS context pointer handle.
gnumberThe geometry pointer to buffer.
pnumberA pointer to the buffer parameters.
widthnumberThe width of the buffer area.

geos.GEOSBufferWithStyle ⇒ number

Creates a buffer around a geometry with a specified width, number of segments per quadrant, end cap style, join style and mitre limit.

Kind: Exported member
Returns: number - The buffered geometry pointer or NULL if an exception occurred.

ParamTypeDescription
gnumberThe input geometry pointer.
widthnumberThe buffer width.
quadsegsnumberThe number of segments per quadrant.
endCapStylenumberThe end cap style. One of GEOSBUF_CAP_ROUND, GEOSBUF_CAP_FLAT or GEOSBUF_CAP_SQUARE.
joinStylenumberThe join style. One of GEOSBUF_JOIN_ROUND, GEOSBUF_JOIN_MITRE or GEOSBUF_JOIN_BEVEL.

geos.GEOSBufferWithStyle_r ⇒ number

Creates a buffer around a geometry with a specified width, number of segments per quadrant, end cap style, join style and mitre limit using a given context handle.

Kind: Exported member
Returns: number - The buffered geometry pointer or NULL if an exception occurred.

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
gnumberThe input geometry pointer.
widthnumberThe buffer width.
quadsegsnumberThe number of segments per quadrant.
endCapStylenumberThe end cap style. One of GEOSBUF_CAP_ROUND, GEOSBUF_CAP_FLAT or GEOSBUF_CAP_SQUARE.
joinStylenumberThe join style. One of GEOSBUF_JOIN_ROUND, GEOSBUF_JOIN_MITRE or GEOSBUF_JOIN_BEVEL.
mitreLimitnumberThe mitre limit. A positive number or zero.

geos.GEOSBuffer_r ⇒ number

Creates a buffer around a geometry with a specified width, number of segments per quadrant, end cap style, join style and mitre limit.

Kind: Exported member
Returns: number - The buffered geometry pointer or NULL if an exception occurred.

ParamTypeDescription
handlenumberA pointer to the GEOS context handle.
gnumberThe input geometry pointer.
widthnumberThe buffer width.
quadsegsnumberThe number of segments per quadrant.
endCapStylenumberThe end cap style. One of GEOSBUF_CAP_ROUND, GEOSBUF_CAP_FLAT or GEOSBUF_CAP_SQUARE.
joinStylenumberThe join style. One of GEOSBUF_JOIN_ROUND, GEOSBUF_JOIN_MITRE or GEOSBUF_JOIN_BEVEL.
mitreLimitnumberThe mitre limit. A positive number or zero.