GRATGRID

Create graticule or grid


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

Back to top

Description


GRATGRID creates a vector layer representing either a graticule or a grid. The vector layer can be geocoded even though it represents a graticule. The grid or graticule is created based on image extents and increments in the X and Y directions.
Back to top

Parameters


gratgrid(fili, filo, dbvs, dbsn, dbsd, layertype, gridtype, mapunits, llbounds, ulx, uly, lrx, lry, xincre, yincre)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO str Output vector file name 0 -    
DBVS List[int] Input vector segment or layer 0 - 1  
DBSN str Output vector layer name 0 - 8  
DBSD str Output vector layer description 0 - 64  
LAYERTYPE str Layer type 0 - 8 Lines | Points | Polygons
Default: Lines
GRIDTYPE str Grid type 0 - 10 Geocoded | Geographic
Default: Geocoded
MAPUNITS str Map units 0 - 17 Default: METER
LLBOUNDS str Output bounds are in logitude and latitude 0 - 3 YES | NO
Default: NO
ULX str Upper-left X coordinate 0 - 64  
ULY str Upper-left Y coordinate 0 - 64  
LRX str Lower-right X coordinate 0 - 64  
LRY str Lower-right Y coordinate 0 - 64  
XINCRE * List[float] X increment 1 - 1 1.0 -
YINCRE * List[float] Y increment 1 - 1 1.0 -

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the PCIDSK file containing the georeferencing information to use in the new graticule/grid layer.

FILO

Specifies the name of the PCIDSK file to receive the output graticule/grid layer. If this parameter is not specified, it is assumed to be the same as FILI.

If FILO is specified but does not already exist, a new PCIDSK file is created.

DBVS

Specifies the vector segment from which georeferencing information (projection, bounds) will be taken.

DBSN

Specifies a name (up to 8 characters) for the output vector layer.

DBSD

Describes (in up to 64 characters) the contents or origins of the output vector layer.

LAYERTYPE

Specifies the layer type of the output grid/graticule layer.

Supported types are:

GRIDTYPE

Specifies the grid type for the output vector layer.

Supported values are:

MAPUNITS

Specifies the projection definition for the output file.

If the Input vector layer (DBVS) is specified, or if georeferencing is used from the input file (FILI), this parameter is ignored.

Supported map units include:

MAPUNITS can specify the UTM grid zone number and row, and earth model, as follows:

UTM [mm] [r] [Ennn]
where:

For more information about all the projections available, see "Projections and earth models" in the Technical Reference section of the CATALYST Professional help.

LLBOUNDS

Specifies whether the bound values are geographic (longitude and latitude) or geocoded (easting and northing).
Note: If MAPUNITS has the value LONG/LAT, PIXEL, METER, or FEET, this parameter is ignored.

ULX

Specifies the upper-left X coordinate of the bounds, using the coordinate system defined by LLBOUNDS.

ULY

Specifies the upper-left Y coordinate of the bounds, using the coordinate system defined by LLBOUNDS.

LRX

Specifies the lower-right X coordinate of the bounds, using the coordinate system defined by LLBOUNDS.

LRY

Specifies the lower-right Y coordinate of the bounds, using the coordinate system defined by LLBOUNDS.

XINCRE

Specifies the horizontal increment of the graticule or grid. The default value is 1.0.

YINCRE

Specifies the vertical increment of the graticule or grid. The default value is 1.0.

Back to top

Details

GRATGRID creates a vector layer representing either a graticule or a grid. The vector layer can be geocoded even though it represents a graticule. The grid or graticule is created based on image extents and increments in the X and Y directions.

The GRIDTYPE (Grid Type) parameter specifies whether the new grid is geocoded (easting/northing) or geographic (lat/long). A geocoded grid has vector lines parallel to its coordinate system; when the input image has a UTM projection, for example, the output grid will follow lines of constant UTM northing or easting. A geographic grid is actually a "graticule", where the vector lines correspond to lines of constant longitude or latitude.

A geographic grid can be generated from an image with geographic or projected coordinates. A geocoded grid can only be generated from an image with projected coordinates, and not from geographic coordinates.

The X and Y increments can be specified in either Geocoded or Geographic units, depending on the Grid Type. If the Grid Type is geocoded, the increments will be geocoded units (for example, meters or feet). An increment of 1000 m creates a grid line every 1000 m. If the Grid Type is geographic, the increment units are decimal degrees. An increment of 1 (0.01 decimal degrees) creates a grid line every 36 seconds.

Back to top

Examples

A geocoded line grid will be created with bounds taken from the extents of Segment 25 on irvine.pix. This segment is projected.

from pci.gratgrid import gratgrid

fili	=	"irvine.pix"
filo	=	"out_irvine.pix"
dbvs	=	[25]		# Bounds taken from vector segment 25
dbsn	=	"geocgrd1"
dbsd	=	"Geocoded bounds to Geocoded grid"
layertyp	=	"Lines"
gridtype	=	"Geocoded"
mapunits	=	''
llbounds	=	''
ulx	=	''			# No user-specified bounds
uly	=	''
lrx	=	''
lry	=	''
xincre	=	[1000]
yincre	=	[1000]		# Grid spacing is 1000x1000 m

gratgrid( fili, filo, dbvs, dbsn, dbsd, layertyp, gridtype, mapunits, llbounds, ulx, uly, lrx, lry, xincre, yincre )

A geographic point graticule will be created with user-specified geographic bounds. Because irvine_reproj.pix is in geographic (Long/Lat) coordinates, the bounds must also be geographic.

from pci.gratgrid import gratgrid

fili	=	"irvine_reproj.pix"
filo	=   ''
dbvs	=	[]			# Not using segment bounds
dbsn	=	"geoggrd2"
dbsd	=	"Geographic bounds to Geographic grid"
layertype	=	"Points"
gridtype	=	"Geographic"
mapunits	=	"LONG/LAT E000"
llbounds	=	"YES"
ulx	=	"-117.75"
uly	=	"33.75"
lrx	=	"-117.5"
lry	=	"33.5"
xincre	=	[1]
yincre	=	[1]			# Graticule spacing is 1x1 degrees

gratgrid( fili, filo, dbvs, dbsn, dbsd, layertype, gridtype, mapunits, llbounds, ulx, uly, lrx, lry, xincre, yincre )

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