3

This is a general question about how a feature class is stored or can be stored using python/arcpy.

Can a list of created points (a feature class) be saved as a shapefile or in a shapefile, or to create a new feature class do you have to create a gdb and then add the feature class to it, then ultimately convert this to a shapefile using ArcPy?

0

3 Answers 3

7

To put it really simply, a shapefile is a feature class that is not stored within a geodatabase. So you can use a tool like Conversion > Feature Class To Feature Class (or arcpy.FeatureClassToFeatureClass_conversion) and convert a feature class or layer to a shapefile.

Modifying the sample script from Feature Class to Feature Class Desktop Help slightly, here is an example of converting a feature class to a shapefile. This takes a feature class called buildings_point from a geodatabase C:\data\GreenvalleyDB.mdb\PublicBuildingsand outputs them to a shapefile postoffices.shp in the folder C:\output

# Name: FeatureClassToFeatureClass_Example2.py
# Description: Use FeatureClassToFeatureClass with an expression to create a subset
# of the original feature class.  

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "C:/data/GreenvalleyDB.mdb/PublicBuildings"

# Set local variables
inFeatures = "buildings_point"
outLocation = "C:/output"
outFeatureClass = "postoffices.shp"
expression = ""

# Execute FeatureClassToFeatureClass
arcpy.FeatureClassToFeatureClass_conversion(inFeatures, outLocation, outFeatureClass, expression)
0
5

I found a Spatial Times blog entitled Shapefile vs Feature Class by searching Google:

A Shapefile is a Feature Class. Although the intended question probably wasn’t answered here. But let’s go a little deeper into this before moving on, so what is a Feature Class then (from: http://wiki.gis.com/wiki/index.php/Feature_class)?

Feature classes are homogeneous collections of common features, each having the same spatial representation, such as points, lines, or polygons, and a common set of attribute columns, for example, a line feature class for representing road centerlines.

By this definition, a Shapefile is a Feature Class.

0
4

Yes, a shapefile is considered a Feature Class, which lends it several attributes.

Esri provides this overview about the shapefile <updated link 200828 based on comment by @Rex below>Geoprocessing considerations for shapefile output :

A shapefile is an Esri vector data storage format for storing the location, shape, and attributes of geographic features. It is stored as a set of related files and contains one feature class. Shapefiles often contain large features with a lot of associated data and historically have been used in GIS desktop applications such as ArcGIS for Desktop and ArcGIS Explorer Desktop. If you have a small amount of data in a shapefile—generally fewer than 1,000 features—you can make it available for others to view through a web browser by adding it as a .zip file containing the .shp, .shx, .dbf, and .prj files to a map you create with the map viewer.

When you add a shapefile, the map viewer converts it to a format that web clients can quickly read and display. To help further improve the performance of the display, you can choose to generalize the features in your shapefile. Generalizing reduces the size of the shapefile by simplifying the features and is often appropriate for data at small scales.

To expand further, the Duke University Libraries provides additional insight to both the shapefile and feature classes, providing a good comparison.

Here is a snippet from the article:

Feature datasets store Feature Classes (which are the equivalent to shapefiles) with the same coordinate system. Like shapefiles, users can create points, lines, and polygons with feature classes; feature classes also have the ability to create annotation, and dimension features.

enter image description here

2
  • 4
    Note that a feature dataset should only be used to group features which are related spatially and not just as a way to organise a geodatabase "neatly". "Their primary purpose is for organizing related feature classes into a common dataset for building a topology, a network dataset, a terrain dataset, or a geometric network" reference Commented Feb 16, 2016 at 4:08
  • 1
    For the purposes of the question and by many general definitions, a shapefile is equivalent to a feature class, but a feature class an esri geodatabase can have many different properties. The link about shapefiles above is regarding AGOL and is a very narrow one. I would encourage anyone pondering this question to view this link from esri.
    – Rex
    Commented Aug 28, 2020 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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