Resumen
An object containing the results of a closest facility analysis that can be used to access outputs and solver messages.
Debate
Instances of this class cannot be created directly. Instead, they are returned by the solve method of the ClosestFacility class.
Propiedades
Propiedad | Explicación | Tipo de datos |
isPartialSolution (Sólo lectura) | Returns True if the solver produced a partial solution, meaning that not all inputs were included in the results. This can occur if one of the inputs is unlocated and the solver class's ignoreInvalidLocations property is set to True. | Boolean |
solveSucceeded (Sólo lectura) | Returns True if the solve was successful. | Boolean |
Descripción general del método
Método | Explicación |
count (output_type) | Returns the number of rows for an output type. |
export (output_type, output_features) | The output features will be created in the spatial reference of the network dataset used for the analysis. If the arcpy.env.outputCoordinateSystem environment is set, the output features will be created with the specified coordinate system instead. Exports the analysis results to a feature class or table. |
fieldNames (output_type) | Returns a list of field names supported by a specified output type. |
saveAsLayerFile (file_name) | Save the analysis result and settings to a layer file or layer package. The layer file or package can be opened in ArcGIS Pro as a record of the analysis settings or to visualize the results. A layer file can also be opened in ArcGIS Desktop. A layer package cannot be saved if the analysis references a portal service as the network data source. The method returns a RuntimeError exception if the allowSaveLayerFile property on the solver object is set to False. |
saveRouteData (file_name) | Save the outputs from the analysis to a .zip file. The .zip file can be used to share the routes from the analysis as route layer items in ArcGIS Online or ArcGIS Enterprise using the Share As Route Layers tool. Los elementos de capa de ruta pueden usarse desde distintas aplicaciones, por ejemplo, ArcGIS Navigator para proporcionar indicaciones de ruta a los trabajadores de campo, el panel Indicaciones de Map Viewer para personalizar aún más la ruta contenida en la capa de ruta, o bien ArcGIS Pro para crear una nueva capa de análisis de ruta a partir de una capa de ruta. The output features will be created in the spatial reference of the network dataset used for analysis. If the arcpy.env.outputCoordinateSystem environment has been set, the output will be created in that spatial reference instead. If the solve fails, saveRouteData returns a RuntimeError exception. The method returns a RuntimeError exception if the allowSaveRouteData property on the solver object is set to False. |
searchCursor (output_type, field_names, {where_clause}) | Establishes a search cursor on the specified output type. This cursor can be used to read rows directly from the output. |
solverMessages (severity) | Get error, warning, and informational messages returned by the solver. |
Métodos
count (output_type)
Parámetro | Explicación | Tipo de datos |
output_type | The type of output features to count. The parameter should be set using the ClosestFacilityOutputDataType enumeration. | Object |
Tipo de datos | Explicación |
Integer | The number of rows. |
Raises no exception.
export (output_type, output_features)
Parámetro | Explicación | Tipo de datos |
output_type | The type of output to export. The parameter should be set using the ClosestFacilityOutputDataType enumeration. | Object |
output_features | The catalog path to the output feature class or table that will contain the exported features. | String |
fieldNames (output_type)
Parámetro | Explicación | Tipo de datos |
output_type | The type of output for which to return a list of field names. The parameter should be set using the ClosestFacilityOutputDataType enumeration. | Object |
Tipo de datos | Explicación |
String | A list of field names supported by the specified output type. |
saveAsLayerFile (file_name)
Parámetro | Explicación | Tipo de datos |
file_name | The catalog path of the output layer file (.lyr) or layer package (.lpkx) to write. | String |
saveRouteData (file_name)
Parámetro | Explicación | Tipo de datos |
file_name | The full path of the output .zip file. | String |
searchCursor (output_type, field_names, {where_clause})
Parámetro | Explicación | Tipo de datos |
output_type | The type of output to read. The parameter should be set using the ClosestFacilityOutputDataType enumeration. | Object |
field_names [field_names,...] | A list of field names of the output type whose values the cursor will return. You can get the names of the fields that are supported by an output type using the fieldNames method. See descriptions of the fields included in each output type In addition to regular fields, you can also access the geometry of the output using one of the following geometry tokens:
The SHAPE@XY and SHAPE@XYZ tokens are only supported for point-based output types. The x-, y-, and z-values returned when using the SHAPE@XY and SHAPE@XYZ tokens are in the spatial reference of the network data source used for the analysis. | String |
where_clause | An optional expression that limits the records returned. For more information on WHERE clauses and SQL statements, see SQL reference for query expressions used in ArcGIS. (El valor predeterminado es None) | String |
Tipo de datos | Explicación |
Object | A SolverResultSearchCursor object that reads rows from the output. |
solverMessages (severity)
Parámetro | Explicación | Tipo de datos |
severity | The type of messages to be returned. The parameter should be specified using the MessageSeverity enumeration. | Object |
Tipo de datos | Explicación |
List | The messages are returned as a list of lists. The inner list contains two values; the first is a number representing the message code, and the second value is the message text. An example of a list of messages returned from a failed origin destination cost matrix analysis. |