count
汇总
包含起点 - 目的地成本矩阵分析结果的对象,可用于访问输出和求解程序消息。
讨论
无法直接创建此类的实例。 相反,它们由 OriginDestinationCostMatrix 类的 solve 方法返回。
语法
count()
属性
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
isPartialSolution (只读) |
如果求解程序产生了部分解决方案,则将返回 |
Boolean |
|
solveSucceeded (只读) |
如果求解程序成功执行,则将返回 |
Boolean |
|
spatialReference (只读) |
返回输出要素的空间参考。 例如,通过 |
SpatialReference |
方法
count(output_type)
返回输出类型的行数。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
output_type |
用于计数的输出要素类型。 使用 |
Object |
返回值
| 数据类型 | 说明 |
|---|---|
|
Integer |
行数。 |
export(output_type, output_features)
将分析结果导出到要素类或表。
输出要素将在用于分析的网络数据集的空间参考中创建。如果已设置 arcpy.env.outputCoordinateSystem 环境,则将使用指定的坐标系创建输出要素。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
output_type |
要导出的输出类型。 使用 |
Object |
|
output_features |
包含导出要素的输出要素类或表的目录路径。 |
String |
extent({output_type})
返回分析输出的范围。
如果分析求解失败,此方法将返回 RuntimeError 异常。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
output_type (可选) |
The type of output features for which to get the extent. 使用 If you do not specify a value, or you specify a value of |
Object |
返回值
| 数据类型 | 说明 |
|---|---|
|
Extent |
|
fieldNames(output_type)
返回指定输出类型支持的字段名称列表。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
output_type |
要返回其字段名称列表的输出类型。 使用 |
Object |
返回值
| 数据类型 | 说明 |
|---|---|
|
String |
指定输出类型支持的字段名称列表。 |
saveAsLayerFile(file_name)
将分析结果和设置保存到图层文件或图层包。 可以在 ArcGIS Pro 中将图层文件或包作为分析设置记录打开或用于可视化结果。 也可以在 ArcGIS Desktop 中打开图层文件。
如果求解程序对象上的 allowSaveLayerFile 属性设置为 False ,该方法将返回 RuntimeError 异常。
旧版本:
基于运行 10.9 之前版本 ArcGIS Enterprise 的门户的路径服务不支持保存图层包。 在这种情况下,该方法将返回
RuntimeError异常。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
file_name |
The catalog path of the output layer file ( 注意:Layer files with an |
String |
searchCursor(output_type, field_names[field_names,...], {where_clause})
在指定的输出类型上建立搜索光标。 此游标可用于直接从输出读取行。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
output_type |
The type of output that will be read. 使用 |
Object |
|
field_names[field_names,...] |
A list of field names of the output type whose values will be returned by the cursor. You can get the names of the fields supported by an output type using the Learn more about 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 提示:Retrieving geometry for the |
String |
|
where_clause (可选) |
用于限制所返回的记录的可选表达式。 有关 WHERE 子句和 SQL 语句的详细信息,请参阅 在 ArcGIS 中使用的查询表达式的 SQL 参考 。 (默认值为 None) |
String |
返回值
| 数据类型 | 说明 |
|---|---|
|
Object |
从输出读取行的 |
solverMessages(severity)
获取求解程序返回的错误、警告和信息性消息。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
severity |
要返回的消息类型。 应使用 |
Object |
返回值
| 数据类型 | 说明 |
|---|---|
|
List |
返回的消息为由 列表组成的列表。内部列表包含两个值;第一个值为表示消息代码的数字,第二个值为消息文本。 从失败的起点 - 目的地成本矩阵分析返回的消息列表的示例。
|
toArrowTable(output_type, field_names[field_names,...], {file_name}, {max_batch_size})
以 Apache Arrow 格式返回 OD 成本矩阵结果。
注:
如果求解器对象使用服务 URL 作为其网络数据源,Arrow 输出不可用。 在这种情况下,该方法将返回
RuntimeError异常。
| 名称 | 说明 | 数据类型 |
|---|---|---|
|
output_type |
The type of output that will be read. 使用 注意:Only the |
Object |
|
field_names[field_names,...] |
A list of field names of the output type to include in the Arrow table. Learn more about the fields included in each output type 注意:For the |
String |
|
file_name (可选) |
The file path to use to save the analysis results permanently. The file will contain one or more Arrow record batches and can be opened in any package or library that supports the Arrow format. This parameter is optional. If it is not specified, the Arrow table returned by the method can be used within the current Python operation but will not be stored permanently. |
String |
|
max_batch_size (可选) |
The maximum number of records to include in a single record batch in the output Arrow table. When no value or For very large analyses, writing the output in batches prevents out-of-memory errors. The method always returns a single Arrow table and output file (if the For the The value for |
Integer |
返回值
| 数据类型 | 说明 |
|---|---|
|
Object |
此 Apache Arrow 表 Python 对象 表示指定字段所需的输出类型。 |