1

I'm trying to develop a Spatial data processing GUI, one of the step uses the "Create Fishnet" tool. From the toolbox it self, there is a drop down let you select template extent, this way user won't need to manually input the X and Y coordinate for fishnet origin and Y-Axis. enter image description here

Though, from the script, it doesn't seem like there is a way to browse a reference extent. Does anyone know how to do this?

enter image description here

Vince
  • 20,017
  • 15
  • 45
  • 64
MaxG
  • 505
  • 3
  • 18
  • Have a look and workaround http://gis.stackexchange.com/questions/121632/determining-y-coordinate-for-create-fishnet-from-desired-angle-of-rotation-in-py/121741#121741 – FelixIP Oct 06 '15 at 22:42

1 Answers1

0

You can create an extent object, or simply use a feature class with the extent you desire, as shown here:

import arcpy

#feature class with desired extent
fc = r"C:\TestData.gdb\District"

...

CreateFishnet_management (out_feature_class,
                          origin_coord,
                          y_axis_coord,
                          cell_width,
                          cell_height,
                          number_rows,
                          number_columns,
                          {corner_coord},
                          {labels},
                          template = fc, #Using feature class extent as template
                          {geometry_type})
Emil Brundage
  • 13,859
  • 3
  • 26
  • 62
  • 2
    This syntax doesn't address the question. The CreateFishnet_management arcpy syntax requires the origin coordinates and numbers of rows and columns as inputs. The GUI tool calculates these when a template feature is supplied, but supplying the optional template parameter in arcpy does not generate these values. – Ian Yau Oct 20 '17 at 20:35