GeoScript

Previous topic

function

Next topic

layer

This Page

process

The process module provides geoprocessing functions.

class geoscript.process.Process

A runnable geospatial process.

A process is typically obtained by name:

>>> p = Process.lookup('geo:splitPolygon')
>>> p.description
Splits a polygon by a linestring
static list()

Static method that returns a generator over the list of known process names. Each element is returned as a tuple of (prefix, localName).

static lookup(name)

Static method that looks up a process by name. The name parameter is specified as a tuple of (prefix, localName):

>>> p = Process.lookup(('geo', 'splitPolygon'))
>>> p.description
Splits a polygon by a linestring

name may also be specified as a colon delimited string:

>>> p = Process.lookup('geo:splitPolygon')
>>> p.description
Splits a polygon by a linestring
run(**args)

Executes the process with set of named inputs. The input argument names are specified by the inputs property. The output arguments names are specified by the outputs property.

>>> p = Process.lookup('vec:Reproject')
>>> from geoscript import geom, proj
>>> l = Layer()
>>> l.add([geom.Point(-125, 50)])
>>> r = p.run(features=l, targetCRS=proj.Projection('epsg:3005'))
>>> [f.geom.round() for f in r['result'].features()]
[POINT (1071693 554290)]