Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Layers and Table Views toolset > Tools

Make Feature Layer (Data Management)

Release 9.3
Last modified March 8, 2012
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

NOTE: This topic was updated for 9.3.1.


The Make Feature Layer tool is used to create a feature layer from an input feature class or layer file. The layer that is created by the tool is temporary and will not persist after the session ends unless the document is saved.

Learn more about working with layers.


Usage tips

Command line syntax
An overview of the Command Line window
MakeFeatureLayer_management <in_features> <out_layer> {where_clause} {workspace} {field_info}

Parameter Explanation Data Type
<in_features>

The input feature class or layer. Complex feature classes, such as annotation and dimensions, are not valid inputs to this tool.

Feature Layer
<out_layer>

The name of the feature layer to be created.

Feature Layer
{where_clause}

A SQL expression used to select a subset of features.

The syntax for the expression differs slightly depending on the data source. For example, if you're querying file or ArcSDE geodatabases, shapefiles, or coverages, enclose field names in double quotes:

"MY_FIELD"

If you're querying personal geodatabases, enclose fields in square brackets:

[MY_FIELD]

For more information on SQL syntax and how it differs between data sources, see SQL Reference.

SQL Expression
{workspace}

The input workspace used to validate the field names. If the input is a geodatabase feature class and the output workspace is a folder, the field names may be truncated, since shapefile attributes can only have names of ten characters or less. The new names may be reviewed and altered using the Field Information control.

Workspace | Feature Dataset
{field_info}

The Field Information control is used to review and alter the field names for the new layer. Fields can be hidden, and a split policy can be specified.

Field Info
Data types for geoprocessing tool parameters


Command line example

MakeFeatureLayer_management D:\Workspace.mdb\Transport 'Major Roads' '[ROADCODE] = "4"' "D:/Workspace"  "LEVEL ROAD_CLASS VISIBLE, LENGTH LENGTH VISIBLE RATIO"

Scripting syntax
About getting started with writing geoprocessing scripts
MakeFeatureLayer_management (in_features, out_layer, where_clause, workspace, field_info)

Parameter Explanation Data Type
in_features (Required)

The input feature class or layer. Complex feature classes, such as annotation and dimensions, are not valid inputs to this tool.

Feature Layer
out_layer (Required)

The name of the feature layer to be created.

Feature Layer
where_clause (Optional)

A SQL expression used to select a subset of features.

The syntax for the expression differs slightly depending on the data source. For example, if you're querying file or ArcSDE geodatabases, shapefiles, or coverages, enclose field names in double quotes:

"MY_FIELD"

If you're querying personal geodatabases, enclose fields in square brackets:

[MY_FIELD]

For more information on SQL syntax and how it differs between data sources, see SQL Reference.

SQL Expression
workspace (Optional)

The input workspace used to validate the field names. If the input is a geodatabase feature class and the output workspace is a folder, the field names may be truncated, since shapefile attributes can only have names of ten characters or less. The new names may be reviewed and altered using the Field Information control.

Workspace | Feature Dataset
field_info (Optional)

The Field Information control is used to review and alter the field names for the new layer. Fields can be hidden, and a split policy can be specified.

Field Info

Data types for geoprocessing tool parameters


Script example

# ExtractFeaturesByLocationAndAttribute.py
# Description: Extract features to a new feature class based on a Location and an attribute query
# Requirements: Python and the Python win32all extension
# Author: ESRI
# Data 1/1/2004

# Create the Geoprocessor
import arcgisscripting
gp = arcgisscripting.create()

# Put in error trapping in case an error occurs when running tool
try:
    # Make a layer from the feature class
    gp.MakeFeatureLayer("c:/mexico.mdb/cities","lyr")

    # Select all cities that overlap the chihuahua polygon
    gp.SelectLayerByLocation("lyr", "intersect", "c:/mexico.mdb/chihuahua", 0, "new_selection")

    # Within the selection (done above) further select only those cities that have a population >10,000
    gp.SelectLayerByAttribute("lyr", " [population] > 10000 ", "SUBSET_SELECTION")

    # Write the selected features to a new featureclass
    gp.CopyFeatures("lyr", "c:/mexico.mdb/chihuahua_10000plus")

except:
    # If an error occurred print the message to the screen
    print gp.GetMessages()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.