CRCENTROID

Create a centroid layer from a vector or thematic raster layer


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


CRCENTROID is a vector and thematic raster operation that generates a point location (x-coordinate and y-coordinate) for each shape or pixel value in the input layer.
Back to top

Parameters


Name Type Caption Length Value range
FILI * String Input file name 1 - 192  
FILO String Output file name 0 - 192  
DBVS Integer Input vector segment 0 - 1  
DBIC Integer Input raster channel 0 - 1  
SRCATTR String Source attributes 0 - 4 COPY, JOIN
Default: COPY
CENTROID String Generate centroids for (polygons only or all shapes) 0 - 8 Default: Polygons
REPORT String Report mode 0 - 192 Quick links
MONITOR String Monitor mode 0 - 3 ON, OFF
Default: ON

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the file that contains the input vector or thematic raster data from which the centroids will be generated.

FILO

Specifies the name of the PCIDSK image file that receives the point layer (centroids) generated from the input layer.

FILO is created if it does not already exist.

DBVS

Specifies the segment that contains the vectors for which the centroid layer will be constructed. If DBVS is not specified, DBIC must be specified.

DBIC

Specifies the thematic raster channel that contains the image for which the centroid layer will be constructed. If DBIC is not specified, DBVS must be specified.

SRCATTR

Specifies whether the attributes from the source layer are copied or joined to the point (centroid) layer.

CENTROID

Specifies whether the centroid is to be generated for polygons only or for all shapes. This parameter is only used when the input is a vector layer.

Valid values are: POLYGONS or ALL. If this parameter is unspecified, the centroid is generated by default for polygons only.

REPORT

Specifies where to direct the generated report.

Available options are:

MONITOR

The program progress can be monitored by printing the percentage of processing completed. A system parameter, MONITOR, controls this activity.

Available options are:

Back to top

Details

CRCENTROID generates centroids from a vector layer or thematic raster layer.

For vector layers, CRCENTROID creates centroids for polygons only or for all shapes in the layer. If the shape is a point, the resulting centroid is the same as the point. If the shape is a line, the resulting centroid is a point at the center of the line (not necessarily on a vertex of the shape). The generated coordinates are of the same projection as the input polygon layer. The point layer has only one attribute, which is the shape ID of the shape from which the point is generated. The attributes of the source shape are joined or copied to the corresponding point in the point layer.

For thematic rasters, a point is generated for each attribute record. The centroid is contained in the biggest contiguous area. If you want a centroid for each contiguous area of pixels, use RAS2PNT.

Back to top

Example

The following example creates a centroid layer in the output file based on thematic raster 2 in the combined1.pix file.

EASI>FILI = "combined1.pix"	! Specifies the input file name.
EASI>FILO = "output.pix"
EASI>DBVS =			! Uses DBIC.
EASI>DBIC = 2			! Uses channel 2.
EASI>SRCATTR =			! Uses "COPY" by default.
EASI>CENTROID =		! Uses "Polygons" by default.
EASI>REPORT =
EASI>MONITOR  =
EASI>run CRCENTROID
			

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.