Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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

Esri provides this overview about the shapefile in their help:

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

share|improve this answer
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 – Stephen Lead Feb 16 at 4:08

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)
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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