Name

Majority (raster) — A tool to compute overlaps between polygons in a base coverage and a zone coverage using a raster algorithm

Synopsis

Synopsis

ca.spatial.gis.raster.Majority {input1} {label1} {input2} {label2} {cellSize} {output}
	

Arguments

NameTypeDefault
input1The file name of the input coverage or shape fileNone
label1The polygon label column nameNone
input2The file name of the overlay coverage, shapefile or grid that defines the zonesNone
label2The column name of the zone of interest. If the zone file is a raster grid then this argument is ignored.None
cellSizeThe size of the cell to use for rasterization. If the zone file is a raster grid then this argument is ignored.None
outputThe name of the output fileNone

Description

The Majority program will compute and report on overlaps between two sets of polygons. The first set of polygons is the base layer, and one output record is created for each polygon. The second set of polygons is called the zone layer. This tool will calculate the value of the zone polygon that predominantly covers each base polygon.

The output file contains one record for each base polygon. The first field in the record is the label from the base polygon. The second field in the record is the label from the zone polygon that predominantly overlaps the base polygon.

Processing Notes

A missing value of '-9999' will be used in areas where the base coverage extends beyond the zone coverage.

If a raster grid is used as the zone coverage then the sampling grid of the raster coverage will be used. Otherwise, a sampling grid will be extended from the lower left corner of the base coverage.

In case of exact even coverage of two or more zone polygons on a base polygon, the lowest sorted label is chosen for output.

This program is less exact than a vector overlay, but for many purposes (e.g. labeling broad landscape zones) it is sufficiently precise and less trouble to execute than the vector verson.

Examples

      java -jar patchworks.jar ca.spatial.gis.raster.Majority
           gamma2.shp CLUSTER marten.shp  MARTEN 10  majority.csv     
    

This example will compute the intersection between polygons in the 'gamma.shp' shapefile, and zones in the 'marten.shp' shapefile. The raster algorithm will use a 10m cell size. The 'CLUSTER' field will contain the labels for the base polygons, and the 'MARTEN' field will contain the labels for the zone polygons. The output will be written to a file named 'majority.csv'.