ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

SIG dans votre entreprise

ArcGIS for Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Extensions

NAClassFieldMap

  • Résumé
  • Discussion
  • Propriétés
  • Exemple de code

Résumé

Provides the ability to map field names or set default values for the properties of a network analysis class within a network analysis layer. The properties of the network analysis class are used as inputs by the solvers while performing the network analyses.

Discussion

The NAClassFieldMap object cannot be instantiated by itself. It is obtained by instantiating an NAClassFieldMappings object, which returns a collection of NAClassFieldMap objects as a Python dictionary. The dictionary keys are the network analysis class property names, and the values are the NAClassFieldMap objects.

Propriétés

PropriétéExplicationType de données
defaultValue
(Lecture/écriture)

Provides the ability to get or set the default value for the property represented by the NAClassFieldMap object. The value can be specified as a string representation of the value or as a value of the data type for the property. For example, the Curb Approach property can have default value specified as number 1 or as a string "1". The default value cannot be set for the Locations property in the Line Barriers and Polygon Barriers sublayer as they require BLOB values. If both mappedFieldName and defaultValue properties are specified for a property, the default value is used only if the feature attribute value corresponding to the mapped field has a null value.

Variant
mappedFieldName
(Lecture/écriture)

Provides the ability to get or set the field name from an input feature class or table that is used to derive the value for the property. If the feature attribute value corresponding to the mapped field has a null value, the value specified for the defaultValue property is used.

String
propertyName
(Lecture seule)

The name of the property for which a default value or a mapped field name is specified using the NAClassFieldMap object.

String

Exemple de code

NAClassFieldMap Example (Python window)

The following script shows how to load fire stations as facilities into an existing service area layer and specify a delay of 10 minutes when loading the facilities using the NAClassFieldMappings object. It assumes that a service area network analysis layer called Fire Stations Coverage, created from the tutorial network dataset for the San Francisco region, and a feature layer called FireStations are already added to an existing map document.

#Get the service area layer called "Fire Stations Coverage" from the table of contents
saLayer = arcpy.mapping.Layer("Fire Stations Coverage")

#Get the list of fields from the FireStations feature layer in the table of contents
fields = arcpy.ListFields("FireStations")

#Get the facilities sublayer name from the service area layer. Note that we are not
#using a string called "Facilities" because the sublayer name can be
#different if using ArcGIS on a non-english operating system.
facilitiesSubLayerName = arcpy.na.GetNAClassNames(saLayer)["Facilities"]

#Create a field mappings object for facilities sublayer based on the fields from
#FireStations layer
fieldMappings = arcpy.na.NAClassFieldMappings(saLayer, facilitiesSubLayerName,
                                              False, fields)

#Get the field map corresponding to the "Attr_TravelTime" property of facilities
fieldMap = fieldMappings["Attr_TravelTime"]

#Set a delay of 10 minutes for the facilities
fieldMap.defaultValue = 10

#Load the fire stations as service area facilities using the field mappings
arcpy.na.AddLocations(saLayer, facilitiesSubLayerName, "FireStations", fieldMappings)

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS Platform

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

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog des initiés
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2018 Esri. | Confidentialité | Légal