5 TIN The Tin subsystem includes the objects used to access and operate tin. TINs are mainly used for surface simulation. Three main interfaces: ITinAdvanced: provides access to basic attributes and obtains the starting point of the basic data structure. ITinEdit: used for TIN building and editing ISurface: used to provide surface analysis functions, such as contour, profile, and volumetrics Basic elements: Triangles Edges Nodes 10 Raster Subsystem Including accessing and operating rasters, rasters datasets, and raster catalogs objects. These objects can be based on files or geodatabases. Both file-based and geodatabase-based systems have two types of raster data: Raster dataset: express existing data Raster catalog: manages the raster dataset set as a whole. A raster dataset is composed of one or more bands. Raster dataset can also include pyramids, statistics, and colormap. 10.1 Raster data access Object To access raster data, you must use workspacefactory (RasterWorkspaceFactory) to create a workspace. AccessWorkspaceFactory is used to initialize an Access Workspace; SdeWorkspaceFactory is used to initialize a database workspace. The above two types of objects are used to access Raster data in different storage forms. Public Function OpenRasterWorkspace (sPath As String) As IRasterWorkspace Dim pWKSF As IWorkspaceFactory Set pWKSF = New RasterWorkspaceFactory Dim pRasterWs As IRasterWorkspace Set pRasterWs = pWKSF. OpenFromFile (sPath, 0) Set OpenRasterWorkspace = pRasterWs End Function The Workspace object provides three interfaces to access the RasterDataset object and the RasterCatalog object: 1. IRasterWorkspace Interface 2. IRasterWorkspace2 Interface The preceding two interfaces are used to open and create a file-based RasterDataset. Dim pRasterDataset as IRasterdataset Dim pRasterWs as IRasterWorkspace2 Set pRasterWs = OpenRasterWorkspace ("D: \ data ") Set pRasterDataset = pRasterWs. OpenRasterDataset ("airphoto. img", 0) You can modify the original value of the source, width, height, and object element through parameters. 3. IRasterWorkspaceEX Interface Access the personnel-based geodatabase through AccessWorkspace; access the enterprise geodatabase through databaseWorkspace. Dim pWorkspace as IRasterWorkspaceEx Dim pRasterDataset as IRasterDataset Dim pRasterCatalog as IrasterCatalog 'From a personal geodatabase. Set pWorkspace = OpenAccessWorkspace ("D: \ data \ images. mdb ") 'Or from an enterprise geodatabase Set pWorkspace = OpenSDEWorkspace ("myserver", "5151", "raster Set pRasterDataset = pWorkspace. OpenRasterDataset ("airphoto ") Set pRasterCatalog = pWorkspace. OpenRasterCatalog ("RedLandImages ") Creating a raster dataset in geodatabase is an empty raster dataset without dimension. It has basic placeholders, such as the number of bands and metadata. Type, RASTER field attribute, and GEOMETRY field attribute. Once an empty raster dataset is created, the raster metadata can be appended from other raster data. Mosaicking method. For example: Dim pWorkspace As IRasterWorkspaceEx Set pWorkspace = OpenSDEWorkspace ("myserver", "5151", "raster 'Create a RasterStorageDef object for storage parameters, define compression Dim pStorageDef As IRasterStorageDef Set pStorageDef = New RasterStorageDef PStorageDef. CompressionType = esriRasterSdeCompressionType20000. 'Create a RasterDef object for the RASTER field Dim pRasterDef As IRasterDef Set pRasterDef = New RasterDef Set pRasterDef. SpatialReference = New UnknownCoordinateSystem 'Create a GeometryDef object for the GEOMETRY field Dim pGeoDef As IGeometryDef Set pGeoDef = New GeometryDef Set pGeoDef. SpatialReference = New UnknownCoordinateSystem Dim pSDERasterDs As IRasterDataset Set pSDERasterDs = pWorkspace. CreateRasterDataset ("mydataset", 1, PT_UCHAR, pS 10.2 Raster datasets A RasterDataset is composed of one or more consecutive raster bands. The RasterDataset object can be used to manage datasets or obtain dataset attributes. You can use the ISaveAs interface to store data in other formats. Dim pSaveAs as ISaveAs Set pSaveAs = pRasterDataset PSaveAs. SaveAs "MyImage. img", pRasterWs, "IMAGINE Image" PSaveAs. SaveAs "MyRaster", pWorkspace, "SDR" RasterDataset supports the IRasterBandColoection interface. In addition to addition, the deletion band does not affect RasterDataset. RasterDataset objects can use initialization Raster or RasterBand objects to depict other aspects of data. Two methods can be used to create a Raster object from RasterDataset. CreateFullRaster: Creates a Raster with full attributes. CreateDefaultRaster: Creates a Raster with a square cell and only contains three bands. In addition to workspace access, RasterDataset can also be obtained from the band using the RasterDataset attribute. 10.3 Raster Bands This object depicts an existing Raster dataset band. The following code shows how to access RasterBand from a Raster or RasterDataset object. Dim pBandCol as IRasterBandCollection Set pBandCol = pRasterPtr 'May be a Raster or a RasterDataset 'Get the first band of the raster Dim pRasterBand as IRasterBand Set pRasterBand = pBandCol. Item (0) Some interfaces only support file-based RasterBand and do not support Database RasterBand. A Raster band includes a pixel value and can be accessed through RasterBand. The following code accesses raster colormap: Dim pColormap As IRasterColormap Dim HasColormap As Boolean HasColormap = pRasterBand. HasColormap If HasColormap = True Then Set pColormap = pRasterBand. Colormap RasterBand supports the IRawPixel interface to read and write the image metadata of the band. 10.4 Raster Compared with RasterDataset and RasterBand objects, this object can change without affecting the original data. Allow the Raster table to fulfill what you want. You can define special projection and amplitude. This makes Raster more conducive to display and analysis. Because Raster's Transient nature, IRasterProps is an important interface used to control Raster attributes, such as amplitude, width, height, spatial reference, pixel type, and Nodata value. Dim pRasterProps as IRasterProps Set pRasterProps = pRaster PRaster. ResampleMethod = RSP_BilinearInterpolation PRasterProps. SpatialReference = pNewSpatialReference Dim pSaveAs as ISaveAs Set pSaveAs = pRaster PSaveAs. SaveAs "MyRaster", pRasterWs, "GRID" The Raster object can use IPixelFilterOperation to create a PixelBlock and modify the pixel value through the pixel filter. You can also use the IrasterEdit interface to directly modify Raster's Image Element value. Raster can be displayed using the RasterLayer object, which is an esriCarto library object. Raster can be created in RasterDataset or obtained from RasterLayer . Set pRaster = pRasterLayer. Raster 10.5 Pixel blocks This object contains a pixel queue that can be read from Raster and Raster band. This object can be created from Raster and RasterBand. The pixel block must be defined in the created manual. Once created, the size of the pixel block cannot be changed. You can obtain the pixel value from the pixel block and change the pixel value. PixelBlockCursor or RasterCursor allows you to split a large image into many small pixel blocks objects. This object is enhanced in 9.0. 10.6 Raster catalogs This object is a new data type in 9.0, This object is used to manage the raster datasets set as a whole. To create a Raster catalogs, first create an empty Raster catalog, and then add the rows containing the raster value to the raster catalog. RasterCatalog can be displayed using the GdbRasterCatalogLayer object in the esriCarto library.
|