<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中文字幕| 国产成人久久AV免费| 18pao国产成视频永久免费| 亚洲人午夜射精精品日韩| 亚洲av永久无码精品秋霞电影秋 | 国产亚洲蜜芽精品久久| 无人在线观看免费高清| 国产国拍精品亚洲AV片| 亚洲免费在线观看| 久久精品国产亚洲Aⅴ蜜臀色欲| 免费看无码自慰一区二区| 亚洲第一精品电影网| 91短视频在线免费观看| 91亚洲va在线天线va天堂va国产| 亚洲精品永久www忘忧草| 国产日韩AV免费无码一区二区 | 免费无码av片在线观看| 免费无码作爱视频| 亚洲人成网站在线观看青青| 亚洲性色AV日韩在线观看| 成人免费视频网址| 亚洲欧洲av综合色无码| 免费的一级片网站| 立即播放免费毛片一级| 亚洲AⅤ视频一区二区三区| 成年免费a级毛片| 国产亚洲精品资在线| 今天免费中文字幕视频| 自怕偷自怕亚洲精品| 最新猫咪www免费人成| 在线播放亚洲精品| 亚洲人JIZZ日本人| 最近最新高清免费中文字幕| 亚洲一卡2卡4卡5卡6卡残暴在线| 国产精品无码亚洲精品2021| 超清首页国产亚洲丝袜| 最近2019年免费中文字幕高清| 国产免费久久精品| 成人午夜免费视频| 亚洲Av永久无码精品三区在线| 免费一级特黄特色大片|