Create Fishnet (Data Management)

Summary

Creates a fishnet of rectangular cells. The output can be polyline or polygon features.

Learn more about how Create Fishnet works

Usage

  • The Generate Tessellation tool is an alternate tool that generates repeating shapes that cover an area without gaps or overlap. See the tool documentation for details.

  • The coordinate system of the output can be set by either providing a feature class or layer in the Template Extent parameter or setting the Output Coordinate System environment.

  • In addition to the output fishnet, a point feature class will be created with label points at the center of each fishnet cell if the Create Label Points parameter is checked. This feature class will use the name of the output fishnet feature class with a suffix of _label and will be created in the same location.

  • Use the Geometry Type parameter to create output polyline (default) or polygon cells. Creating a polygon fishnet may be slower, depending on the number of rows and columns.

  • The Cell Size Width and the Cell Size Height parameter values are in the same units as defined by the output feature class.

Parameters

LabelExplanationData Type
Output Feature Class

The output feature class containing the fishnet of rectangular cells.

Feature Class
Fishnet Origin Coordinate

The pivot point of the fishnet.

Point
Y-Axis Coordinate

The y-axis coordinate that will be used to orient the fishnet. The fishnet will be rotated by the same angle as defined by the line connecting the origin and the y-axis coordinate.

Point
Cell Size Width

The width of each cell.

To calculate the cell width using the Number of Rows parameter value, leave this parameter unspecified or set the value to zero; the width will be calculated when the tool is run.

Double
Cell Size Height

The height of each cell.

To calculate the cell height using the Number of Columns parameter value, leave this parameter unspecified or set the value to zero; the height will be calculated when the tool is run.

Double
Number of Rows

The number of rows in the output fishnet.

To calculate the number of rows using the Cell Size Width parameter value, leave this parameter unspecified or set the value to zero; the number of rows will be calculated when the tool is run.

Long
Number of Columns

The number of columns in the output fishnet.

To calculate the number of columns using the Cell Size Height parameter value, leave this parameter unspecified or set the value to zero; the number of columns will be calculated when the tool is run.

Long
Opposite corner of Fishnet
(Optional)

The opposite corner of the fishnet set by the Fishnet Origin Coordinate parameter. The values for opposite corner are automatically set if the Template Extent parameter is specified.

This parameter is inactive if the Fishnet Origin Coordinate, Y-Axis Coordinate, Cell Size Width, Cell Size Height, Number of Rows, and Number of Columns parameters are specified.

Point
Create Label Points
(Optional)

Specifies whether a point feature class will be created containing label points at the center of each fishnet cell.

  • Checked—A point feature class will be created. This is the default.
  • Unchecked—A point feature class will not be created.
Boolean
Template Extent
(Optional)

The extent of the fishnet. The extent can be provided by specifying the coordinates or using a template dataset.

  • Current Display Extent Map View—The extent will be based on the active map or scene.
  • Draw Extent Square and Finish—The extent will be based on a rectangle drawn on the map or scene.
  • Extent of a Layer Layer—The extent will be based on an active map layer. Choose an available layer or use the Extent of data in all layers option. Each map layer has the following options:

    • All Features Select All—The extent of all features.
    • Selected Features Area from Selected Features—The extent of the selected features.
    • Visible Features Extent Indicator—The extent of visible features.

  • Browse Browse—The extent will be based on a dataset.
  • Clipboard Paste—The extent can be copied to and from the clipboard.
    • Copy Extent Copy—Copies the extent and coordinate system to the clipboard.
    • Paste Extent Paste—Pastes the extent and coordinate system from the clipboard. If the clipboard does not include a coordinate system, the extent will use the map’s coordinate system.
  • Reset Extent Reset—The extent will be reset to the default value.

When coordinates are manually provided, the coordinates must be numeric values and in the active map's coordinate system. The map may use different display units than the provided coordinates. Use a negative value sign for south and west coordinates.

Extent
Geometry Type
(Optional)

Specifies whether the output fishnet cells will be polyline or polygon features.

  • PolylineThe output will be a polyline feature class. Each cell is defined by four line features.
  • PolygonThe output will be a polygon feature class. Each cell is defined by one polygon feature.
String

Derived Output

LabelExplanationData Type
Output Label Feature Class

The output point feature class with label points at the center of each fishnet cell

When the Create Label Points parameter is checked, a point feature class will be created with label points at the center of each fishnet cell. This feature class will use the name of the output fishnet feature class with a suffix of _label and will be created in the same location.

When the labels parameter is set to LABELS, a point feature class will be created with label points at the center of each fishnet cell. This feature class will use the name of the output fishnet feature class with a suffix of _label and will be created in the same location.

Feature Class

arcpy.management.CreateFishnet(out_feature_class, origin_coord, y_axis_coord, cell_width, cell_height, number_rows, number_columns, {corner_coord}, {labels}, {template}, {geometry_type})
NameExplanationData Type
out_feature_class

The output feature class containing the fishnet of rectangular cells.

Feature Class
origin_coord

The pivot point of the fishnet.

Point
y_axis_coord

The y-axis coordinate that will be used to orient the fishnet. The fishnet will be rotated by the same angle as defined by the line connecting the origin and the y-axis coordinate.

Point
cell_width

The width of each cell.

To calculate the cell width using the number_rows parameter value, leave this parameter unspecified or set the value to zero; the width will be calculated when the tool is run.

Double
cell_height

The height of each cell.

To calculate the cell height using the number_columns parameter value, leave this parameter unspecified or set the value to zero; the height will be calculated when the tool is run.

Double
number_rows

The number of rows in the output fishnet.

To calculate the number of rows using the cell_width parameter value, leave this parameter unspecified or set the value to zero; the number of rows will be calculated when the tool is run.

Long
number_columns

The number of columns in the output fishnet.

To calculate the number of columns using the cell_height parameter value, leave this parameter unspecified or set the value to zero; the number of columns will be calculated when the tool is run.

Long
corner_coord
(Optional)

The opposite corner of the fishnet set by the origin_coord parameter.

This parameter is disabled if the origin_coord, y_axis_coord, cell_width, cell_height, number_rows, and number_columns parameters are specified.

Point
labels
(Optional)

Specifies whether a point feature class will be created containing label points at the center of each fishnet cell.

  • LABELSA point feature class will be created. This is the default.
  • NO_LABELSA point feature class will not be created.
Boolean
template
(Optional)

The extent of the fishnet. The extent can be provided by specifying the coordinates or using a template dataset.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent
geometry_type
(Optional)

Specifies whether the output fishnet cells will be polyline or polygon features.

  • POLYLINEThe output will be a polyline feature class. Each cell is defined by four line features.
  • POLYGONThe output will be a polygon feature class. Each cell is defined by one polygon feature.
String

Derived Output

NameExplanationData Type
out_label

The output point feature class with label points at the center of each fishnet cell

Feature Class

Code sample

CreateFishnet example 1 (Python window)

The following Python window script demonstrates how to use the CreateFishnet function in immediate mode.

import arcpy

# Create a fishnet with 9 columns and 9 rows
# with origin at (1, 1) and output geometry is set to default (POLYLINE)
arcpy.management.CreateFishnet("C:/data/output/fishnet1.shp", "1 1", "1 9", "1", "1", "9", "9", "#", "NO_LABELS")
CreateFishnet example 2 (stand-alone script)

The following stand-alone script shows how to create rectangular cells (fishnet) using the CreateFishnet function.

# Name: CreateFishnet.py
# Description: Creates rectangular cells

# import system module
import arcpy

# set workspace environment
arcpy.env.workspace = "C:/data/output"

# Set coordinate system of the output fishnet
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference("NAD 1983 UTM Zone 11N")

outFeatureClass = "fishnet10by10.shp"

# Set the origin of the fishnet
originCoordinate = '1037.26 4145.81'

# Set the orientation
yAxisCoordinate = '1037.26 4155.81'

# Enter 0 for width and height - these values will be calcualted by the tool
cellSizeWidth = '0'
cellSizeHeight = '0'

# Number of rows and columns together with origin and opposite corner 
# determine the size of each cell 
numRows =  '10'
numColumns = '10'

oppositeCoorner = '19273.61 18471.17'

# Create a point label feature class 
labels = 'LABELS'

# Extent is set by origin and opposite corner - no need to use a template fc
templateExtent = '#'

# Each output cell will be a polygon
geometryType = 'POLYGON'

arcpy.management.CreateFishnet(outFeatureClass, originCoordinate, yAxisCoordinate, cellSizeWidth, cellSizeHeight, numRows, numColumns, oppositeCoorner, labels, templateExtent, geometryType)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics