AE development-Geodatabase database-Core geodatabase

Source: Internet
Author: User

The Geodatabase consists of the following 12 subsystems (or 12 OMD:

1. Core Geodatabase
2. Geometric network
3. Topology
4. Data Elements
5. Tin
6. Data Transfer
7. Versioning
8. Name Objects
9. Relation Query Table
10. Raster
11. Metadata
12. Piug-in datasource
This section briefly describes and explains the first part.

1. Core Geodatabase
This database is the core database of GeoDatabase. It covers the most interfaces and object types and is the most complex. It is also difficult to master the database.

1.1 Workspace (Class)
Includes spatial and non-spatial datasets ).
Workspace objects provide methods to instantiate existing datasets and create new ones.
There are three main types:
EsriFileSystemWorkspace (Shapefiel and ArcInfo Workspace)
EsriLocalDatabaseWorkspaCe (personal geodatabase)
EsriRemoteDatabaseWorkspAce (enterprise geodatabase)
Other types include:
RasterWorkspace (Grids and Images)
TinWorkspace
CADWorkspace
VPFWorkspace

1.2 Editing Data
Enables applications to use transactions to manage direct data updates.
The ITransaction interface is used to manage Transaction.
The IWorkspaceEdit interface is used to manage the Transaction of a session (the main methods include StartEditing, StartEditOperation, AbortEditOperation, and StopOperation)
The following example shows a simple editing process in a workspace:

Public Sub WorkspaceEdit ()
Dim pWorkspaceFactory As IWorkspaceFactory
Set pWorkspaceFactory = New esriDataSourcesGDB. AccessWorkspaceFactory
Dim pFeatureWorkspace As IFeatureWorkspace
Set pFeatureWorkspace = pWorkspaceFactory. OpenFromFile ("D: \ Usa. mdb", 0)
Dim pFeatureClass As IFeatureClass
Set pFeatureClass = pFeatureWorkspace. OpenFeatureClass ("States ")
Dim pWorkspaceEdit As IWorkspaceEdit
Set pWorkspaceEdit = pFeatureWorkspace
Dim pFeature As IFeature
Dim iResponse As Integer
Dim bHasEdits As Boolean
PWorkspaceEdit. StartEditing True
PWorkspaceEdit. StartEditOperation
Set pFeature = pFeatureClass. GetFeature (1)
PFeature. Delete
PWorkspaceEdit. StopEditOperation
IResponse = MsgBox ("Undo operation? ", VbYesNo)
If iResponse = vbYes Then
PWorkspaceEdit. UndoEditOperation
End If
PWorkspaceEdit. HasEdits bHasEdits
If bHasEdits Then
PWorkspaceEdit. StopEditing MsgBox ("Save edits? ", VbYesNo)
End If
End Sub

Correct object editing principles:
1. All Editing objects should be in the editing process
2. Edit the changes into groups in the editing operation.
3. Discard all references for row objects on the editing process Boundary
4. Retrieve the edited object to be updated using non-cyclic pointers
5. Retrieve all attributes of the edited object
6. Mark the row object and notify all other related objects.
7. Maintain database integrity

1.3 Workspace Extension (Class)
Expand the Workspace function in some aspects, such as managing a new type of custom dataset and maintaining a custom data dictionary.

1.4 Datasets (Abstract Class)
Datasets is an abstract class. It is a collection of data in a Workspace and can include other Datasets. All Datasets support the IDataset, IDatasetEdit, and IMetadata interfaces.
Datasets include tables, feature class, relation classes, feature datasets, topologies, and geometric networks.
Feature Datasets is a collection of feature classes, including relationship classes, geometric networks, and topologies.
Stores Simple features Feature classes and organizes them externally or internally in the feature dataset. Those outside the feature dataset are called independent feature classes; the Feature classes that store topological features must be included in the feature dataset to ensure public space reference.
A FeatureDataset is a dataset, which only exists in a geodatabase workspace. All datasets in FeatureDataset are also part of the same geodatabase. Each dataset in geodatabase must have a unique name.

1.5 Table, object class, and feature class
1.5.1Table object contains at least one column, corresponding field)
A Table is a Dataset. You can use the IDataset interface to obtain attributes such as the Table name and workspace.
The ISqlsyntax interface ParseTableName method can be used to separate file names from corresponding parts in different databases (such as SQL and ORCAL.

1.5.2 object class is a table whose rows correspond to objects and are simulated as objects using attributes and behaviors.
The object controls the row object through the IRow and IObject interfaces.
A FeatureClass is an ObjectClass, where the object is Feature, that is, a Feature class is a collection of spatial entities.

1.5.3Rows, objects and features
The Row class is generated from the Table class, while the Object class inherits from the Row class, and the Feature class inherits from the Object class.
The Row class object is a fixed Row of a table, which is obtained through the table pointer. Row has a series of Fields.
An Object of the Object class is a table with a row corresponding to an Object. The other name is Entities Object. Use the IRow and IObject interfaces of ObjectClass to control objects in a row.
Feature is a space object and a member of Feature class.

1.5.4Query, cursors, and selection
1.5.4.1 Cursors is a data access object and has three types:
Search
Insert
Update
The following is an example of a simple Cursors operation:

Dim pCursor As ICursor
Dim pRow As IRow
Set pCursor = pTable. Search (Nothing, False)
Set pRow = pCursor. NextRow
Do Until pRow Is Nothing
Debug. Print pRow. Value (0)
Set pRow = pCursor. NextRow
Loop

1.5.4.2Query filters and spatial filters
Queryfilter is a class used to filter table data by attribute values.
Spatialfilters inherits from Queryfilters, which has restrictions on space and attributes.
The ISpatialFilter interface is used to define the geographical filter criteria.

1.5.4.3 Selection
The SelectionSet object allows the application to reference the row selection set.
The ISelectionSet interface is used to manage query selection sets.

1.5.4.4 QueryDef
The QueryDef object defines a dataset query in one or more tables and Feature classes.
It is mainly used to determine how to calculate a dataset query in arbitrary tables.
The IQueryDef interface is used to create and define a query. You can also provide a calculation method for calculating the query and returning the pointer.

1.5.4.6Class Extensions
ClassExtension provides developers with customization and advanced Geodatabase extension capabilities.
IClassExtension interface is the main interface for executing ClassExtension.

1.5.4.7Domains and validation rules
Rules is associated with the object class and used in the Validating object processing process in the object class.
Three types of child classes are generated from the Rule abstract class:
AttributeRule
RelationshipRule
ConnectivityRule (further split with junctionconnecticonnectivityruleAnd EdgeConnectivityRule)

1.5.4.7.1Attribute rules and domains
Attribute rule uses attribute domain to generate an object class.
Domain is an abstract class that defines the interfaces used by the RangeDomain and CodedValueDomain component classes to constrain each lost value. These lost values are associated with specific fields in the Object and Feature classes.
Domain is specified in the Self-type.

1.5.4.7.2Relationship rules
The cardinalities constraint between the two child types involved in RelationshipClass.

1.5.4.7.3Connectivity rules
Connectivity Rule specifies the type of network Connectivity constraints.

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.

From http://blog.sina.com.cn/s/blog_53fc3ca10100db4h.html ~ Type = v5_one & label = rela_nextarticle

 

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.