ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS for Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

Result

  • 概要
  • ディスカッション
  • 構文
  • プロパティ
  • 手法の概要
  • 手法
  • コードのサンプル

概要

A Result object is returned by geoprocessing tools.

ディスカッション

The advantage of a Result object is that you can maintain information about the execution of tools, including messages, parameters, and output. These results can be maintained even after several other tools have been run.

構文

 Result  (toolname, resultID)
パラメーター説明データ タイプ
toolname

The name of the executed tool.

String
resultID

The job ID.

Integer

プロパティ

プロパティ説明データ タイプ
inputCount
(読み取り専用)

Returns the number of inputs.

Integer
maxSeverity
(読み取り専用)

Returns the maximum severity of the messages.

  • 0 —If the tool produced only informative messages.
  • 1 — If the tool produced a warning message, but no error messages.
  • 2 — If the tool produced an error message.
Integer
messageCount
(読み取り専用)

Returns the number of messages.

Integer
outputCount
(読み取り専用)

Returns the number of outputs.

Integer
resultID
(読み取り専用)

Gets the job ID. If the tool is not a geoprocessing service, the resultID will be "".

String
status
(読み取り専用)

Gets the job status.

  • 0 —New
  • 1 —Submitted
  • 2 —Waiting
  • 3 —Executing
  • 4 —Succeeded
  • 5 —Failed
  • 6 —Timed out
  • 7 —Cancelling
  • 8 —Cancelled
  • 9 —Deleting
  • 10 —Deleted
Integer

手法の概要

手法説明
cancel ()

Cancels an associated job

getInput (index)

Returns a given input, either as a recordset or string.

getMapImageURL ({parameter_list}, {height}, {width}, {resolution})

Gets a map service image for a given output, if one exists.

getMessage (index)

Returns a specific message.

getMessages ({severity})

Returns messages.

getOutput (index)

Returns a given output, either as a recordset or a string.

If the output of the tool, such as MakeFeatureLayer is a layer, getOutput will return a Layer object.

getSeverity (index)

Returns the severity of a specific message.

saveToFile (rlt_file)

Saves the result to a result file.

手法

cancel ()
getInput (index)
パラメーター説明データ タイプ
index

The index position of the input.

Integer

戻り値

データ タイプ説明
Object

The input, either as a recordset or string.

getMapImageURL ({parameter_list}, {height}, {width}, {resolution})
パラメーター説明データ タイプ
parameter_list

Parameter(s) on which the map service image will be based.

Integer
height

The height of the image.

Double
width

The width of the image.

Double
resolution

The resolution of the image.

Double

戻り値

データ タイプ説明
String

The URL of the map image.

getMessage (index)
パラメーター説明データ タイプ
index

The index position of the message.

Integer

戻り値

データ タイプ説明
String

The geoprocessing message.

getMessages ({severity})
パラメーター説明データ タイプ
severity

The type of messages to be returned: 0=message, 1=warning, 2=error. Not specifying a value returns all message types.

  • 0 —informational message
  • 1 —warning message
  • 2 —error message

(デフォルト値は次のとおりです 0)

Integer

戻り値

データ タイプ説明
String

The geoprocessing messages.

getOutput (index)
パラメーター説明データ タイプ
index

The index position of the outputs.

Integer

戻り値

データ タイプ説明
Object

The output, either as a recordset or a string.

If the output of the tool, such as MakeFeatureLayer is a layer, getOutput will return a Layer object.

Result outputs can also be accessed by index, so result.getOutput(0) and result[0] are equivalent.

getSeverity (index)
パラメーター説明データ タイプ
index

The message index position.

Integer

戻り値

データ タイプ説明
Integer

The severity of the specific message.

  • 0 —informational message
  • 1 —warning message
  • 2 —error message
saveToFile (rlt_file)
パラメーター説明データ タイプ
rlt_file

Full path to the output result file (.rlt).

String

コードのサンプル

Result example 1

Use the result object returned from GetCount to determine the count of a table.

import arcpy

in_table = arcpy.GetParameterAsText(0)
result = arcpy.GetCount_management(in_table)
print(result[0])
Result example 2

Obtain the feature set schema from the server tool, load data to the feature set, pass the feature set to the server tool, and check for the result object. Once completed, save the result to the local dataset.

import time
import arcpy

# Add a toolbox from a server
arcpy.ImportToolbox("http://myserver/arcgis/services;GP/BufferByVal",
                    "servertools")

# Use GetParameterValue to get a featureset object with the default
# schema of the first parameter of the tool 'bufferpoints'
in_featureset = arcpy.GetParameterValue("bufferpoints", 0)

# Load a shapefile into the featureset
in_featureset.load("C:/Data/roads.shp")

# Run a server tool named BufferPoints with featureset created above
result = arcpy.BufferPoints_server(in_featureset, "500 feet")

# Check the status of the result object every 0.2 seconds
#    until it has a value of 4 (succeeded) or greater
while result.status < 4:
    time.sleep(0.2)

# Get the output FeatureSet back from the server and save to a local geodatabase
out_featureset = result.getOutput(0)
out_featureset.save("c:/temp/base.gdb/roads_buffer")
Result example 3

Re-create the original geoprocessing service output using the tool name and result id.

import arcpy

# Add the toolbox from the server
arcpy.ImportToolbox("http://myserver/arcgis/services;GP/BufferByVal")

# Recreate the original output using the tool name and result id
result_id = 'jfea96e13ba7b443cb04ba47c19899a1b'
result = arcpy.Result("BufferPoints", result_id)

関連トピック

  • Python のツールの使用

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS プラットフォーム

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

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2019 Esri. | プライバシー | リーガル