ArcGIS Desktop

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

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

ArcGIS Online

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

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS for Developers

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

ArcGIS Solutions

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

ArcGIS Marketplace

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

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

ヘルプ

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • その他...

マップ サービス キャッシュのタイルを管理 (Manage Map Server Cache Tiles)

  • サマリー
  • 使用法
  • 構文
  • コードのサンプル
  • 環境
  • ライセンス情報

サマリー

既存のマップまたはイメージ サービス キャッシュでタイルの作成と更新を行います。このツールは、新しいタイルの作成、欠落したタイルの補充、古くなったタイルの上書き、またはタイルの削除に使用します。

使用法

    レガシー:
    このツールはバージョン 10.1 で、パラメーターが変更されました。このツールを使用するモデルとスクリプトのうち 10.1 より前に作成されたものは、10.1 で動作するように変更する必要があります。
  • このツールを使用する前に、マップ サービスのタイル スキーマが定義されているか確認してください。タイル スキーマは、[サービス エディター] ウィンドウの [キャッシュ] タブ、または [マップ サービス キャッシュの作成 (Create Map Server Cache)] ツールを使用して作成できます。
  • このツールは、広大な地理的範囲または非常に大きな縮尺をカバーするキャッシュを行うために、実行に時間がかかることがあります。もしツールがキャンセルされると、タイルの作成は停止しますが、既存のタイルは削除されません。つまり、時間がないときにはツールをキャンセルし、後で RECREATE_EMPTY_TILES 更新モードを使用して、同じキャッシュに対して再度ツールを実行することができます。

構文

ManageMapServerCacheTiles_server (input_service, scales, update_mode, {num_of_caching_service_instances}, {area_of_interest}, {update_extent}, {wait_for_job_completion})
パラメーター説明データ タイプ
input_service

キャッシュ タイルを更新するマップまたはイメージ サービス。

これは、サーバーとサービスの両方の情報を含む文字列です。この文字列の構築方法を確認するには、ArcCatalog を開き、カタログ ツリーでサービスを選択して、[場所] ツールバーに表示されているテキストを記録します。バックスラッシュをスラッシュに変更します (たとえば、GIS Servers/arcgis on MYSERVER (admin)/USA.MapServer)。

String
scales

このツールの実行中に、更新モードに従って、タイルを作成または削除する縮尺レベル。

Double
update_mode

キャッシュを更新するときのモード。

  • RECREATE_EMPTY_TILES —空タイルだけを作成します。既存のタイルは未変更のままです。
  • RECREATE_ALL_TILES —既存のタイルを置き換え、範囲が変更された場合は新しいタイルを追加します。
  • DELETE_TILES —タイルはキャッシュから削除されます。キャッシュ フォルダー構造は削除されません。キャッシュをフォルダー構造も含めて完全に削除したい場合には、[マップ サービス キャッシュの削除 (Delete Map Server Cache)] ツールを使用します。
String
num_of_caching_service_instances
(オプション)

このツールの実行に専用で使用する、システム/CachingTools サービスのインスタンス数の合計。ArcGIS Server への管理者接続を通して使用できる [サービス エディター] ウィンドウで、システム/CachingTools サービスの [コンピューターごとのインスタンスの最大数] の値を大きく変更することができます。選択したインスタンス数を、サーバー コンピューターでサポートできることを確認してください。

Long
area_of_interest
(オプション)

対象エリアを定義して、タイルを作成または削除する範囲を制限します。フィーチャクラスを指定するか、ArcMap で対話的に定義するフィーチャを指定できます。このパラメーターは、不規則な形状のエリアでタイルを管理する場合に便利です。一部のエリアだけを事前にキャッシュして、表示頻度の低いエリアをキャッシュしない場合にも有効です。

このパラメーターに値を指定しない場合、デフォルトのマップ全体表示が使用されます。

Feature Set
update_extent
(オプション)

update_mode パラメーターの値に従って、タイルを作成または削除する矩形の範囲。update_extent と area_of_interest の両方に値を指定することはお勧めしません。両方のパラメーターに値を設定した場合は、area_of_interest の値が使用されます。

Extent
wait_for_job_completion
(オプション)

このパラメーターを指定すると、サーバーで実行されているキャッシュ ジョブの進行状況を確認できます。

  • WAIT —キャッシュ ジョブを ArcGIS for Server または ArcGIS Online 上で実行しながら、このツールは引き続き ArcGIS for Desktop で実行されます。このオプションを利用すると、いつでも詳細な進行状況のレポートをリクエストして、表示されるジオプロセシング メッセージを確認できます。これはデフォルトのオプションです。Python スクリプトでは、このオプションを使用することをお勧めします。
  • DO_NOT_WAIT —このジオプロセシング ツールはジョブをサーバーに送信し、ArcGIS for Desktop または ArcGIS for Desktop 閉じて他のジオプロセシング タスクを実行できます。このオプションは、サービスを公開するときにキャッシュを自動的に構築するよう選択した場合に使用されます。また、構築する別のキャッシュで、このオプションを設定することもできます。キャッシュ ジョブのステータスの履歴を参照するには、ArcGIS for Desktop を開き、カタログ ウィンドウでサービスを右クリックして、[キャッシュ ステータスの表示] をクリックします。ツールの結果のメッセージに含まれる URL を使用することもできます。Status.gdb ファイル ジオデータベースがサービスのキャッシュ ディレクトリにない場合は、このオプションを使用できません。
Boolean

コードのサンプル

例 1 RECREATE_ALL_TILES オプションを使用して、キャッシュ内のすべてのタイルを作成または更新します。

# Name: ManageMapServerCacheTiles.py
# Description: The following stand-alone script demonstrates how to Recreate all 
# cache tiles for the scales in the cache tiling scheme.

# Requirements: os, sys, time and traceback modules
# Any line that begins with a pound sign is a comment and will not be executed
# Empty quotes take the default value.
# To accept arguments from the command line replace values of variables to
# "sys.argv[]"

# Import system modules
import arcpy
from arcpy import env
import os, sys, time, datetime, traceback, string

# Set environment settings
env.workspace = "C:/data"

# List of input variables for map service properties
connectionFile = r"C:\Users\<username>\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog"
server = "arcgis on MyServer_6080 (publisher)"
serviceName = "Rainfall.MapServer"
inputService = connectionFile + "\\" + server + "\\" + serviceName
scales = [500000,250000,125000,64000]
numOfCachingServiceInstances = 2
updateMode = "RECREATE_ALL_TILES"
areaOfInterest = ""
waitForJobCompletion = "WAIT"
updateExtents = ""

currentTime = datetime.datetime.now()
arg1 = currentTime.strftime("%H-%M")
arg2 = currentTime.strftime("%Y-%m-%d %H:%M")
file = "C:/data/report_%s.txt" % arg1

# print results of the script to a report
report = open(file,'w')

try:
    starttime = time.clock()
    result = arcpy.ManageMapServerCacheTiles_server(inputService, scales,
                                                    updateMode,
                                                    numOfCachingServiceInstances,
                                                    areaOfInterest, updateExtents,
                                                    waitForJobCompletion)
    finishtime = time.clock()
    elapsedtime= finishtime - starttime

    #print messages to a file
    while result.status < 4:
        time.sleep(0.2)
    resultValue = result.getMessages()
    report.write ("completed " + str(resultValue))

    print "Created cache tiles for given schema successfully for " +\
    serviceName + " in " + str(elapsedtime) + " sec on " + arg2
    
except Exception, e:
    # If an error occurred, print line number and error message
    tb = sys.exc_info()[2]
    report.write("Failed at step 1 \n" "Line %i" % tb.tb_lineno)
    report.write(e.message)
report.close()
    
print "Created Map server Cache Tiles "

例 2 RECREATE_EMPTY_TILES オプションを使用して、一部の縮尺の空のタイルを更新します。

# Name: ManageMapServerCacheTiles.py
# Description: The following stand-alone script demonstrates how to Recreate  
# empty tiles for one of the default number of scales in the cache
# tiling scheme

# Requirements: os, sys, time and traceback modules
# Any line that begins with a pound sign is a comment and will not be executed
# Empty quotes take the default value.
# To accept arguments from the command line replace values of variables to
# "sys.argv[]"

# Import system modules
import arcpy
from arcpy import env
import os, sys, time, datetime, traceback, string

# Set environment settings
env.workspace = "C:/data"

# List of input variables for map service properties
connectionFile = r"C:\Users\<username>\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog"
server = "arcgis on MyServer_6080 (publisher)"
serviceName = "Rainfall.MapServer"
inputService = connectionFile + "\\" + server + "\\" + serviceName
scales = [500000,250000,125000,64000]
numOfCachingServiceInstances = 2
updateMode = "RECREATE_EMPTY_TILES"
areaOfInterest = ""
waitForJobCompletion = "WAIT"
updateExtents = ""
cacheDir = "c:\\arcgisserver\\arcgiscache\\"

currentTime = datetime.datetime.now()
arg1 = currentTime.strftime("%H-%M")
arg2 = currentTime.strftime("%Y-%m-%d %H:%M")
file = "C:/data/report_%s.txt" % arg1

# print results of the script to a report
report = open(file,'w')

# use "scales[0]","scales[-1]","scales[0:3]"

try:
    starttime = time.clock()
    result = arcpy.ManageMapServerCacheTiles_server(inputService, scales[-1],
                                                    updateMode, numOfCachingServiceInstances,
                                                    areaOfInterest, updateExtents,
                                                    waitForJobCompletion)
    finishtime = time.clock()
    elapsedtime = finishtime - starttime
    ## print messages to a file
    while result.status < 4:
        time.sleep(0.2)
    resultValue = result.getMessages()
    report.write ("completed " + str(resultValue))
    
    
    print "Created cache tiles for scale =" + str(scales[-1]) + "for " +\
    serviceName + " at " + cacheDir + " in " + str(elapsedtime) +\
    " sec on " + arg2

except Exception, e:
    # If an error occurred, print line number and error message
    tb = sys.exc_info()[2]
    report.write("Failed at step 1 \n" "Line %i" % tb.tb_lineno)
    report.write(e.message)
    
report.close()   
print "Rereated Map server Cache Tiles for scale = " + str(scaleValues[-1])

例 3 [対象地域] パラメーターを使用してタイルを更新します。

# Name: ManageMapServerCacheTiles.py
# Description: The following stand-alone script demonstrates how to Recreate all
# tiles using given feature class.

# Requirements: os, sys, time and traceback modules
# Author: ESRI

# Any line that begins with a pound sign is a comment and will not be executed
# Empty quotes take the default value.
# To accept arguments from the command line replace values of variables to
# "sys.argv[]"

# Import system modules
import arcpy
from arcpy import env
import os, sys, time, datetime, traceback, string

# Set environment settings
env.workspace = "C:/data"

# List of input variables for map service properties
connectionFile = r"C:\Users\<username>\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog"
server = "arcgis on MyServer_6080 (publisher)"
serviceName = "Rainfall.MapServer"
inputService = connectionFile + "\\" + server + "\\" + serviceName
scales = [500000,250000,125000,64000]
numOfCachingServiceInstances = 2
updateMode = "RECREATE_ALL_TILES"
areaOfInterest = "C:/data/shp/CaTxFlMaMin.shp"
waitForJobCompletion = "WAIT"
updateExtents = ""


currentTime = datetime.datetime.now()
arg1 = currentTime.strftime("%H-%M")
arg2 = currentTime.strftime("%Y-%m-%d %H:%M")
file = "C:/data/report_%s.txt" % arg1

# print results of the script to a report
report = open(file,'w')

# use "scales[0]","scales[-1]","scales[0:3]"

try:
    starttime = time.clock()
    result = arcpy.ManageMapServerCacheTiles_server(inputService, scales[-1],
                                                    updateMode,
                                                    numOfCachingServiceInstances,
                                                    areaOfInterest, updateExtents,
                                                    waitForJobCompletion)                                           
    finishtime = time.clock()
    elapsedtime = finishtime - starttime

    #print messages to a file
    while result.status < 4:
        time.sleep(0.2)
    resultValue = result.getMessages()
    report.write ("completed " + str(resultValue))
    
    print "Created cache tiles for scale =" + str(scales[-1]) + "for " +\
    serviceName + "at " + cacheDir + " using specified feature class " +\
    areaOfInterest + " in " + str(elapsedtime) + " sec on " + arg2

except Exception, e:
    # If an error occurred, print line number and error message
    tb = sys.exc_info()[2]
    report.write("Failed at \n" "Line %i" % tb.tb_lineno)
    report.write(e.message)

report.close()     
print "Rereated Map server Cache Tiles"
print "for scale = " + str(scaleValues[-1]) + " using area of Interest"

環境

このツールはジオプロセシング環境を使用していません

ライセンス情報

  • ArcGIS Desktop Basic: はい
  • ArcGIS Desktop Standard: はい
  • ArcGIS Desktop Advanced: はい

関連トピック

  • キャッシュ ツールセットの概要

ArcGIS Desktop

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

ArcGIS プラットフォーム

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

Esri について

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