GeoScript

Previous topic

API Reference

Next topic

Point

This Page

geom

The geom module provides geometry classes and utilities for the construction and manipulation of geometry objects.

geoscript.geom.geom.prepare(g)

Constructs a prepared geometry. Prepared geometries make repeated spatial operations (such as intersection) more efficient.

g is the Geometry to prepare.

>>> from geoscript.geom import readWKT
>>> prep = prepare(readWKT('POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))'))
>>> prep.intersects(readWKT('POLYGON ((4 4, 6 4, 6 6, 4 6, 4 4))'))
True
geoscript.geom.geom.simplify(g, tol)

Simplifies a geometry object using the Douglas-Peucker simplfication method.

g is the Geometry to simplify.

tol is the distance tolernance such that all veriticies in the resulting simplified geometry will be within this distance from the original geometry.

geoscript.geom.geom.transform(g, dx=0, dy=0, sx=1, sy=1, shx=0, shy=0, r=0)

Tranforms a geometry with an affine transformation.

g is the Geometry to transform.

dx, dy specify the x,y translation.

sx, sy specify the x,y scale factors.

shx, shy specify the x,y shear factors.

r specifies the rotation angle in radians.

geoscript.geom.geom.buffer(g, distance, singleSided=False)

Computes the buffer (optionally single sides) of a geometry.

g is the Geometry to buffer.

distance is the buffer distance.

singleSided specifies whether to compute a single sided buffer.

geoscript.geom.geom.delaunay(obj, tol=0.0)

Computes a Delaunay Triangulation.

obj is a Geometry or a list of geometries.

tol is the snapping tolerance used to improved the robustness of the triangulation computation.

This function returns a tuple containing two geometry collections. The first contains the resulting triangles, the second contains the edges of the resulting triangles.

geoscript.geom.geom.voronoi(obj, tol=0.0, bounds=None)

Computes a Voronoi diagram.

obj is a Geometry or a list of geometries.

tol is the snapping tolerance used to improved the robustness of the

bounds is an optional Bounds used to clip the resulting diagram.

This function returns a geometry collection containing the polygons composing the diagram.