国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

怎么對ArcSDE數據庫的要素類進行批量重建空間索引

來源:懂視網 責編:小采 時間:2020-11-09 07:22:37
文檔

怎么對ArcSDE數據庫的要素類進行批量重建空間索引

怎么對ArcSDE數據庫的要素類進行批量重建空間索引:在我們遇到很多有關于性能的問題,我們一般建議用戶重新常見空間索引,那么如果用戶一個庫里面有幾十個甚至上百個空間索引,那么該怎么處理呢? ArcGIS10.1版本 RebuildIndexes:(這個功能只有ArcGIS10.1才有的) 這個功能主要是對用戶進行大范圍數據編輯,
推薦度:
導讀怎么對ArcSDE數據庫的要素類進行批量重建空間索引:在我們遇到很多有關于性能的問題,我們一般建議用戶重新常見空間索引,那么如果用戶一個庫里面有幾十個甚至上百個空間索引,那么該怎么處理呢? ArcGIS10.1版本 RebuildIndexes:(這個功能只有ArcGIS10.1才有的) 這個功能主要是對用戶進行大范圍數據編輯,

在我們遇到很多有關于性能的問題,我們一般建議用戶重新常見空間索引,那么如果用戶一個庫里面有幾十個甚至上百個空間索引,那么該怎么處理呢? ArcGIS10.1版本 RebuildIndexes:(這個功能只有ArcGIS10.1才有的) 這個功能主要是對用戶進行大范圍數據編輯,

在我們遇到很多有關于性能的問題,我們一般建議用戶重新常見空間索引,那么如果用戶一個庫里面有幾十個甚至上百個空間索引,那么該怎么處理呢?

ArcGIS10.1版本


RebuildIndexes:(這個功能只有ArcGIS10.1才有的)
這個功能主要是對用戶進行大范圍數據編輯,在原有數據基礎上做大量的數據加載或者數據刪除后,為了提高數據性能,進行的操作。其實聽到這里有點老生常談,我們原來的方法也是一個圖層一個圖層的進行重建索引,但是這個功能可以批量的重建索引,而且及支持屬性索引也支持空間索引,支持系統表以及版本的增量表的重建索引,比較方便。


ArcGIS10之前的版本

但是對ArcGIS10以及之前的版本并沒有批量重建索引的辦法,我們只能另辟蹊徑了。

1:使用sde命令行的方法

我們可以使用sde命令,load_only_io和normal_io進行切換來進行空間索引的重建,具體請看幫助。

Switch between load only and normal I/O modes.
To modify a feature class's input/output mode, use the load_only_io and normal_io operations.

You must be the owner of the feature class to change it from normal I/O to load-only I/O mode.

It is recommended that you do not place a versioned feature class that uses binary storage in load only I/O mode because, when you switch back to normal I/O mode, the spatial index will be calculated on a versioned representation of the features. This representation may not match what is stored in the nonversioned f table to which the index gets applied. If this is the case, an error is returned.

When the sdelayer command is used to create a layer (i.e., if the register or add operations are used), the resultant feature class is automatically in normal I/O mode. The load-only I/O mode is provided to make bulk data loading processes more efficient. Use load-only mode when performing large inserts to avoid the continuous update of the feature class's indexes.

For feature classes that use a spatial grid index (SDEBINARY, SDELOB, WKB_GEOMETRY, or feature classes in DB2), if the grid fields are updated while the feature class is in load-only I/O mode, the spatial index is rebuilt with the new grid sizes when you reset the feature class to normal I/O mode. While rebuilding the spatial index table, the feature class is inaccessible to other users. Note: You can change the grid sizes while the feature class is in normal or load-only I/O mode. If you reset spatial indexes while the feature class is in normal I/O mode, the indexes on the spatial index table are dropped while the spatial index is being re-created.. 

When the feature class is in normal I/O mode, the envelope is automatically updated whenever a feature that extends the current envelope is added. The envelope is not updated while the feature class is in load-only I/O mode but is recalculated to the full extent when the feature class is reset to normal I/O mode.

These examples show the parcels feature class being moved into load only mode then back to normal I/O mode.

sdelayer -o load_only_io -l victoria,parcels -u av -p mo -i esri_40

sdelayer -o normal_io -l victoria,parcels -u av -p mo -i esri_40

When the feature class is returned to normal I/O mode, the spatial index table and database indexes are rebuilt. If the operation does not complete successfully for any reason, the feature class is left in load-only I/O mode.

When a feature class is in load-only I/O mode, the unique index is removed from the feature class's spatial column. When the index is absent, it is possible to enter nonunique values into the spatial column with an application not created with the ArcSDE C- or Java application programming interface (API). Therefore, no applications besides ArcSDE or applications created with the ArcSDE C- or Java API should ever update the spatial column. Database administrators should be aware of the increased vulnerability of the spatial column when the feature class is in load-only I/O mode.
我知道很多朋友肯定沒有認真看上面的英文解釋,但是沒有關系,大家只需要知道,如果我們使用load_only_io模式,就是刪除空間索引,我們使用normal_io模式就是創建空間索引就可以了。

那么知道了這兩個模式,我們在對該模式做一個延伸介紹

注意:一般情況下,如果我們業務有變更的情況,比如我們插入一條記錄,如果是使用ArcGIS客戶端或者相關API進行操作,除了我們新添加一條記錄外,我們還同步的對空間索引進行更新,但是如果我們業務上有批量更新的情況,那么我們除了變更數據表,而且我們還要同步的批量變更空間索引信息,這樣對性能會有一些影響。那么我們就可以在批量變更之前,將數據切換到load_only_io模式,然后進行批量變更,等變更業務徹底完成之后,再切換到normal_io模式,以達到重建索引的目的。

那么對數據量比較多的要素類,我們可以使用sde命令編寫批處理文件來對數據進行批量創建空間索引

@echo OFF
pause "按任意鍵開始"
sdelayer -o load_only_io -l quxian,shape -i 5151 -s 192.168.220.165 -u sde -p sde
echo "圖層quxian已經刪除了空間索引"
sdelayer -o normal_io -l quxian,shape -i 5151 -s 192.168.220.165 -u sde -p sde
echo "圖層quxian已經創建了空間索引"

...

sdelayer -o load_only_io -l quxian1,shape -i 5151 -s 192.168.220.165 -u sde -p sde
echo "圖層quxian1已經刪除了空間索引"
sdelayer -o normal_io -l quxian1,shape -i 5151 -s 192.168.220.165 -u sde -p sde
echo "圖層quxian1已經創建了空間索引"


pause "按任意鍵結束"
將以上數據保存為.bat文件,用的時候直接運行即可。

2:使用python腳本重建索引

如果大家留心會發現一個問題,雖然上面使用sde命令可以對要素類進行批量重建索引,但是它仍然需要用戶指定特定的要素類名稱,那么如果及時個甚至上百個要素類,對用戶來說仍然是一個夢魘,那么我們使用python腳本就可以很輕松的實現這個功能。

我們使用Python腳本可以對某個SDE連接下的數據集或者要素類進行遍歷,然后對遍歷的要素類使用GP工具,該GP工具可以刪除和重建空間索引,就是這么簡單

from arcpy import *

env.workspace=r'Database Connections\Connection to 192.168.100.111.sde'
 
for dataset in ListDatasets():
 for fc in ListFeatureClasses("","ALL",dataset):
 RemoveSpatialIndex_management(fc)
 AddSpatialIndex_management(fc)
執行過程中,我們可以看到右邊的信息框的執行過程。

-------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

怎么對ArcSDE數據庫的要素類進行批量重建空間索引

怎么對ArcSDE數據庫的要素類進行批量重建空間索引:在我們遇到很多有關于性能的問題,我們一般建議用戶重新常見空間索引,那么如果用戶一個庫里面有幾十個甚至上百個空間索引,那么該怎么處理呢? ArcGIS10.1版本 RebuildIndexes:(這個功能只有ArcGIS10.1才有的) 這個功能主要是對用戶進行大范圍數據編輯,
推薦度:
標簽: 空間 批量 如何
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 欧美日韩激情 | 韩日视频在线观看 | 精品久久久久久综合日本 | 一区二区三区四区日韩 | 欧美日韩高清一本大道免费 | 国产日韩欧美另类重口在线观看 | 国内精品一区二区三区αv 韩国欧美 | 欧美国产日韩综合 | 91亚洲 欧美 国产 制服 动漫 | 足交在线观看 | 波多野结衣网站 | 欧美精品一区二区三区久久 | 天天搞夜夜 | 国产精品免费精品自在线观看 | 欧美精品福利 | 国产精品亚洲综合 | 中文国产成人精品久久久 | 欧美性xxxxxx爱 | 亚洲一区二区三区在线播放 | 亚洲一区中文字幕 | 在线免费观看国产精品 | 一级全黄60分钟免费网站 | 免费一级 一片一毛片 | 国产日韩欧美一区二区三区视频 | 日韩精品一区二区三区视频 | 在线亚洲精品国产成人二区 | 欧美在线观看不卡 | 日韩电影一区二区 | 欧美一区二区三区免费 | 日韩欧美亚洲 | 美日韩免费视频 | 手机在线国产视频 | 精品亚洲一区二区 | 日韩欧美在线综合网高清 | 国产高清视频 | 国产一区二区免费播放 | 国产最新进精品视频 | 亚洲最新在线 | 一级黄毛片 | 欧美一区二区在线播放 | 欧美色图日韩色图 |