<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答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
        主站蜘蛛池模板: 中文字幕av免费专区| 鲁啊鲁在线视频免费播放| 日韩精品免费视频| 亚洲五月六月丁香激情| 最近2019免费中文字幕视频三| 亚洲精品人成在线观看| 免费无遮挡无码永久视频| 亚洲综合自拍成人| 无码国产精品一区二区免费| 国产成人精品日本亚洲11| 妞干网在线免费观看| 国产成人久久精品亚洲小说| 亚洲精品和日本精品| 高清永久免费观看| 99久久亚洲综合精品成人网| 亚洲免费综合色在线视频| 亚洲精华国产精华精华液网站| 免费在线观看理论片| 三年在线观看免费观看完整版中文 | 污污的视频在线免费观看| 亚洲精品无码99在线观看| 成人黄网站片免费视频 | 久久久久亚洲av成人无码电影| 国内精品久久久久影院免费| 亚洲国产精品综合一区在线| 特级淫片国产免费高清视频| 一级特级女人18毛片免费视频| 亚洲国产精品自在线一区二区| 91视频国产免费| 午夜在线免费视频| 亚洲欧洲在线播放| 免费a级毛片无码av| 国产精品视频白浆免费视频| 亚洲一区二区三区乱码在线欧洲| 亚洲精品国产精品乱码不卡| 最近中文字幕无免费| 美国免费高清一级毛片| 亚洲资源在线观看| 四虎影库久免费视频| 久久成人免费大片| 看Aⅴ免费毛片手机播放|