Geospatial Modelling Environment

geom.difference (Difference Between Geometries)

Calculates the geometric difference between the input features and the polygons in a clip feature data source


This tool calculates the geometric difference of the features in the input feature data source to the polygons in the clip feature data source. All attribute data in the input table is copied to the output table. The geometric difference retains the feature data that is outside of the clip polygon boundaries, and is thus the opposite of the clip command.

This tool modifies the source data, and is therefore dangerous if not applied with caution. It is advised that you use the copyfeaturedataset command to make a backup of your input feature data source before using this command. As a safety precaution, you must set the modifysource command option to TRUE to run this command. If you do not explicitly set this option then the command will not run.

By default the tool will write multipart geometries as output. However, if you specify the singlepart=TRUE option then any multipart geometries will be split into singlepart geometries and written back to the input data source as separate records.

The ‘where’ clause can be used to define a subset of polygon clip features to use. See the ‘where’ section for further details on how to formulate a where clause.


geom.difference(in, clip, modifysource, [singlepart], [where]);

inthe input feature data source (WARNING: the input data source is modified; use copyfeaturedatasource first if you need to preserve the original)
clipthe input polygon data source that is used to clip the input feature data source
modifysource(TRUE/FALSE; default=FALSE) a safety measure that forces you to explicitly authorize the source input data to be modified (the command does not run if set to false)
[singlepart](TRUE/FALSE; default=FALSE) if TRUE, forces the output geometries to be singlepart geometries
[where]the selection statement that will be applied to the clip polygon feature data source to identify a subset of polygons to process (see full Help documentation for further details)


geom.difference(in=”C:datafields.shp”, clip=”C:dataplots.shp”, modifysource=TRUE);

geom.difference(in=”C:datafields.shp”, clip=”C:dataplots.shp”, modifysource=TRUE, singlepart=TRUE, where=”YEAR=2010″);


Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently 


Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn