SDE open rastercatalog, traversing all rasterdataset under rastercatalog

Source: Internet
Author: User
Irasterworkspaceex prasterwex = utilities. opensderasterwsex ();//Access rastercatalog in SDE

 

// Connect the rastercatalog in SDE

          Public   Static  Irasterworkspaceex opensderasterwsex () {esrilicense ();  //  Licenseproduce. Engine this method is passed.  //  Licenseproduct. engiengeodb this method is abnormal  Ipropertyset propertyset = New ESRI. ArcGIS. esrisystem. propertysetclass (); propertyset. setproperty (  "  Server  "  , Configuration. sdeserver); propertyset. setproperty (  "  Instance  "  , Configuration. sdeinstance); propertyset. setproperty (  "  Database  "  , Configuration. sdedatabase); propertyset. setproperty ( "  User  "  , Configuration. sdeuser); propertyset. setproperty (  "  Password  "  , Configuration. sdepassword); propertyset. setproperty (  "  Version  "  , Configuration. sdeversion); iworkspacefactory pwsfact = New Sdeworkspacefactory (); irasterworkspaceex PWS = Pwsfact. Open (propertyset, 0 ) As  Irasterworkspaceex;  Return  PWS ;} 

// Traverse all rasterdataset in rastercatalog

Irastercatalog rastercatalog = prasterwex. openrastercatalog (configuration. sderastercatalog ); //  Traverse all rasterdataset under rastercatalog Itable table = rastercatalog As  Itable; icursor cursor = Table. Search (Null , False  ); Irow row = Cursor. nextrow (); List <Irasterdataset> li_rasters = New List <irasterdataset> (); //  Traverse rastercatalog and add all rasterds              While (Row! = Null  ) {Irastercatalogitem rastercatalogitem = Row As Irastercatalogitem; irasterdataset rasterdataset = Rastercatalogitem. rasterdataset; li_rasters.add (rasterdataset); row = Cursor. nextrow ();} 

 

// Rastercatalog:

To store a set of spaces, refer to the same rasterdataset. rastercatalog equivalent to featureclass + raster field and shape field. Each rasterdataset in rastercatalog is equivalent to a feature

Reference: rastercatalog... in the search

 

// Use featureclass to process rastercatalog

Irasterworkspaceex prasterwex = utilities. opensderasterwsex (); //  Access rastercatalog in SDE Irastercatalog rastercatalog = prasterwex. openrastercatalog (configuration. sderastercatalog ); //  Traverse all rasterdataset under rastercatalog    Ipolympus Ppart = New Polylineclass (); //  Line of the intersection  Ifeatureclass PFC = Rastercatalog As  Ifeatureclass; ifeaturecursor pfcc = PFC. Search ( Null , False ); Ifeature pf = Pfcc. nextfeature ();  While (PF! = Null  ){  Bool Partialintersect = False  ; Irastercatalogitem rastercatalogitem = Pf As  Irastercatalogitem; iraster praster = Rastercatalogitem. rasterdataset. createdefaultraster (); //                 String Rastername = PF. get_value (PF. Fields. findfield ( "  Name  " ). Tostring (); //  Rasterdataset name                  If (Rastername = configuration. bottomraster) //  If it is the bottommost Layer  {Pf = Pfcc. nextfeature ();  Continue  ;} 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.