0

I am writing a Python script tool within a toolbox with *.tbx extension.

I need to make the input parameter flexible (feature class or shapefile) , so which data type I should select for this parameter?

  • Based on what you have read in the Help, which one(s) are you considering? – PolyGeo Jun 25 '16 at 9:13
  • there is the option to choose "feature class" as a data type for the input parameter, but what about if the user has a shape file or other format? – N.G Jun 25 '16 at 10:24
  • 1
    If there is no option for shapefile to create a dilemma why not test "feature class" to see if that lets you browse to either? – PolyGeo Jun 25 '16 at 10:51
1

Feature Class data type option will allow the end user the ability to choose from either shapefile or gdb feature class.

[ESRI software] In ArcGIS, a collection of geographic features with the same geometry type (such as point, line, or polygon), the same attributes, and the same spatial reference. Feature classes can be stored in geodatabases, shapefiles, coverages, or other data formats. Feature classes allow homogeneous features to be grouped into a single unit for data storage purposes. For example, highways, primary roads, and secondary roads can be grouped into a line feature class named "roads." In a geodatabase, feature classes can also store annotation and dimensions.

Feature Class

  • A shapefile is a feature class. I wish intro GIS courses would better define "feature class", "shapefile", and "layer", because when you use them correctly people completely misinterpret you, but their popular usages are too ambiguous to be useful. A shapefile is a type of feature class. A "geodatabase feature class" is a type of feature class. Together, shapefile and geodatabase feature class (which are mutually exclusive) comprise the bulk of feature classes that you'll encounter (there are kmls, CAD files, and some others that are hardly used anymore). – Tom Jun 26 '16 at 15:17
1

"Feature Layer" is going to be the most flexible, as this will accept any vector-based layer that is available on disk, and it will ALSO accept any layer that is in your table of contents.

The "Feature Class" option will only accept inputs on disk (or database).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.