RecordSet/FeatureSet properties (arcpy)

Récapitulatif

The Describe function returns the following properties for instances of RecordSet and FeatureSet. Table Properties and Dataset Properties are also supported by both. In addition, FeatureSet supports FeatureClass Properties. Many of these properties will be empty unless the RecordSet or FeatureSet has been populated by calling its load method.

A RecordSet returns a dataType of "RecordSet".

A FeatureSet returns a dataType of "FeatureSet".

A REST client (such as a web application that uses a geoprocessing service) uses JSON streams to exchange data with a Service End point. You can use the json or pjson property for generating test input for a service or to examine the JSON representation of features and tables that are used by an ArcGIS REST Service. For an example of this, see Using a service in Python scripts.

RemarqueRemarque :

For typical ArcPy use, passing a table or feature class as an argument to a service is faster than passing the JSON string representation of the same table or feature class.

Propriétés

PropriétéExplicationType de données
json
(Lecture seule)

A JSON string representing the table or feature class that underlies the arcpy.RecordSet or arcpy.FeatureSet.

String
pjson
(Lecture seule)

Pretty JSON. A JSON string formatted to be easily readable. This string is a little larger because it includes extra newline and whitespace characters.

String

Exemple de code

FeatureSet properties example (stand-alone script)

The following stand-alone script loads a feature class into an arcpy.FeatureSet, then prints the pjson string.

import arcpy

# Describe a populated arcpy.FeatureSet
#
fSet = arcpy.FeatureSet()
fSet.load("C:\data\moad.gdb\Water_Bodies")
desc = arcpy.Describe(fSet)

# print a JSON representation
print (desc.pjson)
9/12/2013