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 coordinate system of the output can be set either by entering a feature class or layer in the Template Extent parameter or by setting the Output Coordinate System environment variable.

  • In addition to creating the output fishnet, a new point feature class is created with label points at the center of each fishnet cell if the Create Label Points parameter is checked (labels = 'LABELS' in Python) The name of this feature class is the same as the output feature class with a suffix of _label and is created in the same location.

  • The Geometry Type parameter gives the option of creating 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 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 starting pivot point of the fishnet.

Point
Y-Axis Coordinate

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

Point
Cell Size Width

Determines the width of each cell. If you want the width to be automatically calculated using the value in the Number of Rows parameter, leave this parameter empty or set the value to zero—the width will be calculated when the tool is run.

Double
Cell Size Height

Determines the height of each cell. If you want the height to be automatically calculated using the value in the Number of Columns parameter, leave this parameter empty or set the value to zero—the height will be calculated when the tool is run.

Double
Number of Rows

Determines the number of rows the fishnet will have. If you want the number of rows to be automatically calculated using the value in the Cell Size Width parameter, leave this parameter empty or set the value to zero—the number of rows will be calculated when the tool is run.

Long
Number of Columns

Determines the number of columns the fishnet will have. If you want the number of columns to be automatically calculated using the value in the Cell Size Height parameter, leave this parameter empty 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 X-Coordinate and Y-Coordinate values. The values for opposite corner are automatically set if a template extent is used. This parameter becomes disabled if the origin, Y-axis, cell size, and number of rows and columns are set.

Point
Create Label Points
(Optional)

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

  • Checked—A new feature class is created with label points. This is the default.
  • Unchecked—The label points feature class is not created.
Boolean
Template Extent
(Optional)

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

  • Default—The extent will be based on the maximum extent of all participating inputs. This is the default.
  • Current Display Extent—The extent is equal to the data frame or visible display. The option is not available when there is no active map.
  • As Specified Below—The extent will be based on the minimum and maximum extent values specified.
  • Browse—The extent will be based on an existing dataset.
Extent
Geometry Type
(Optional)

Determines if the output fishnet cells will be polyline or polygon features.

  • PolylineOutput is a polyline feature class. Each cell is defined by four line features.
  • PolygonOutput is a polygon feature class. Each cell is defined by one polygon feature.
String

Derived Output

LabelExplanationData Type
Output Label Feature Class (Optional)

a new point feature class is created with label points at the center of each fishnet cell

If the Create Label Points parameter is checked (labels = 'LABELS' in Python), a new point feature class is created with label points at the center of each fishnet cell. The name of this feature class is the same as the output feature class with a suffix of _label and is 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 starting pivot point of the fishnet.

Point
y_axis_coord

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

Point
cell_width

Determines the width of each cell. If you want the width to be automatically calculated using the value in the Number of Rows parameter, leave this parameter empty or set the value to zero—the width will be calculated when the tool is run.

Double
cell_height

Determines the height of each cell. If you want the height to be automatically calculated using the value in the Number of Columns parameter, leave this parameter empty or set the value to zero—the height will be calculated when the tool is run.

Double
number_rows

Determines the number of rows the fishnet will have. If you want the number of rows to be automatically calculated using the value in the Cell Size Width parameter, leave this parameter empty or set the value to zero—the number of rows will be calculated when the tool is run.

Long
number_columns

Determines the number of columns the fishnet will have. If you want the number of columns to be automatically calculated using the value in the Cell Size Height parameter, leave this parameter empty 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 X-Coordinate and Y-Coordinate values.

Point
labels
(Optional)

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

  • LABELSA new feature class is created with label points. This is the default.
  • NO_LABELSThe label points feature class is not created.
Boolean
template
(Optional)

Specify the extent of the fishnet. The extent can be entered 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)

Determines if the output fishnet cells will be polyline or polygon features.

  • POLYLINEOutput is a polyline feature class. Each cell is defined by four line features.
  • POLYGONOutput is a polygon feature class. Each cell is defined by one polygon feature.
String

Derived Output

NameExplanationData Type
out_label

a new point feature class is created with label points at the center of each fishnet cell

If the Create Label Points parameter is checked (labels = 'LABELS' in Python), a new point feature class is created with label points at the center of each fishnet cell. The name of this feature class is the same as the output feature class with a suffix of _label and is created in the same location.

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.CreateFishnet_management("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 new rectangular cells (fishnet) using the CreateFishnet function.

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

# import system module
import arcpy
from arcpy import env

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

# Set coordinate system of the output fishnet
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.CreateFishnet_management(outFeatureClass, originCoordinate, yAxisCoordinate, cellSizeWidth, cellSizeHeight, numRows, numColumns, oppositeCoorner, labels, templateExtent, geometryType)

Licensing information

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

Related topics