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

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

UpdateLayerTime

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

概要

Provides the ability to update a layer's time properties for a layer in a map document (.mxd) by extracting time properties from a source layer.

ディスカッション

The UpdateLayer function has the ability to only update a layer's symbology properties or update ALL layer properties, including time properties.

The UpdateLayerTime function allows you to update only the time properties of a layer and therefore won't overwrite other layer properties that you don't want to change.

The source_layer contains the time properies that you want to apply. It can either be a layer file on disk or a reference to another layer in a map document.

If you want to update the properties for a layer within a layer file, you must modify the properties of the layer in a map document first and then save the changes back to a layer file. See the Layer object's save or saveACopy methods and the code example below.

構文

UpdateLayerTime (data_frame, update_layer, source_layer)
パラメーター説明データ タイプ
data_frame

A reference to a DataFrame object that contains the layer to be updated.

DataFrame
update_layer

A Layer object representing an existing layer that will be updated.

Layer
source_layer

A reference to a Layer object that contains the information to be applied to the update_layer.

Layer

コードのサンプル

UpdateLayerTime example 1

The following script will update a layer's time properties using a layer file. The layer called temperature is not time enabled. The time properties of a time-enabled layer file will be applied to the temperature layer.

import arcpy

mxd = arcpy.mapping.MapDocument(r"C:\Project\Temperature.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "World")[0]
lyr = arcpy.mapping.ListLayers(mxd, "temperature", df)[0]
lyrFile = arcpy.mapping.Layer(r"C:\Project\Data\Time\LayerWithTimeProperties.lyr")
arcpy.mapping.UpdateLayerTime(df, lyr, lyrFile)

# Save changes to a new MXD
mxd.saveACopy(r"C:\Project\Temperature2.mxd")
# Clean up variables
del mxd, df, lyr, lyrFile
UpdateLayerTime example 2

The following script is similar to the one above but saves the changes back out to a layer file.

import arcpy

mxd = arcpy.mapping.MapDocument(r"C:\Project\Temperature.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "World")[0]
lyr = arcpy.mapping.ListLayers(mxd, "temperature", df)[0]
lyrFile = arcpy.mapping.Layer(r"C:\Project\Data\Time\LayerWithTimeProperties.lyr") #orginally authored in ArcMap
arcpy.mapping.UpdateLayerTime(df, lyr, lyrFile)

# Save changes to a new Layer file
lyr.saveACopy(r"C:\Project\TemperatureWithTime.lyr")
# Clean up variables
del mxd, df, lyr, lyrFile

ArcGIS Desktop

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

ArcGIS プラットフォーム

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

Esri について

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