ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

ListSpatialReferences

  • Summary
  • Syntax
  • Code sample

Summary

Returns a Python list of available spatial reference names for use as an argument to arcpy.SpatialReference.

Syntax

ListSpatialReferences ({wild_card}, {spatial_reference_type})
ParameterExplanationData Type
wild_card

Limit the spatial references listed by a simple wildcard check. The check is not case sensitive.

For example, arcpy.ListSpatialReferences("*Eckert*") would list Eckert I, Eckert II, and so forth.

String
spatial_reference_type

Limit the spatial references listed by type.

  • GCS —List only Geographic Coordinate Systems.
  • PCS —List only Projected Coordinate Systems.
  • ALL —List both Projected and Geographic Coordinate Systems. This is the default.

(The default value is All)

String

Return Value

Data TypeExplanation
String

A Python list of spatial references that match the wildcard and spatial reference type. Each item in the list includes qualifying information, separated with forward slashes, to help limit your search or better understand the purpose of the spatial reference.

For example, u'Projected Coordinate Systems/World/Sinusoidal (world)' might be in the list. You can see from the path that this spatial reference is Sinusoidal, is a projected coordinate system, and is intended to be used at a global extent.

Here is another example: u'Projected Coordinate Systems/UTM/South America/Corrego Alegre UTM Zone 25S'. This is a UTM spatial reference for a UTM zone in South America.

Code sample

ListSpatialReferences example 1

List all geographic spatial references.

import arcpy

# Get the list of spatial references and print it.
srs = arcpy.ListSpatialReferences(spatial_reference_type="GCS")
for sr_name in srs:
    print sr_name
ListSpatialReferences example 2

Print the central meridians and names of UTM zones in New Zealand.

import arcpy

# Get the list of spatial references
srs = arcpy.ListSpatialReferences("*utm/new zealand*")

# Create a SpatialReference object for each one and print the
# central meridian
for sr_string in srs:
    sr_object = arcpy.SpatialReference(sr_string)
    print "{0.centralMeridian}   {0.name}".format(sr_object)

Related topics

  • ListTransformations

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal