ArcGIS Developer Help  (GeoDatabase)    

ITopology.ValidateTopology Method

Validate the specified area in the topology.

[Visual Basic 6.0]
Function ValidateTopology(
    ByVal areaToValidate As IEnvelope _
) As IEnvelope
[Visual Basic .NET]
Public Function ValidateTopology ( _
    ByVal areaToValidate As IEnvelope _
) As IEnvelope
[C#]
public IEnvelope ValidateTopology (
    IEnvelope areaToValidate
);
[Java]
public IEnvelope validateTopology (
    IEnvelope areaToValidate
)
throws
    IOException,
    AutomationException
[C++]
HRESULT ValidateTopology(
  IEnvelope* areaToValidate,
  IEnvelope** affectedArea
);
[C++]

Parameters

areaToValidate [in]

  areaToValidate is a parameter of type IEnvelope

affectedArea [out, retval]

  affectedArea is a parameter of type IEnvelope

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

ValidateTopology validates the topology in the area specified by the areaToValidate envelope and returns the envelope of the validated area .  If an empty envelope is supplied, ValidateTopology will return an empty validated area. The simplest way to Validate a Topology is to pass in the envelope of the extent of the topology.

  'Assume we have a reference to a Topology called pTopo and an IGeoDataset variable called pGeoDS
  'Set IGeoDataset so we can get the extent of the Topology
  Set pGeoDS = pTopo
 
  'Validate the Topology
  pTopo.ValidateTopology pGeoDS.Extent.Envelope

Before validating a given area, use a polygon object to verify a Dirty Area is present at the given location.  This can be done using the ITopology::DirtyArea property.  The envelope of the polygon can then be passed into ValidateTopology.

Errors Returned

-2147220958 - FDO_E_EDIT_OPERATION_REQUIRED

When ValidateTopology is called on a versioned topology from within and without an edit session or on a Topology in a personal geodatabase from within an edit session.

If nothing is supplied for areaToValidate, an error is returned.

Remarks

ValidateTopology can be performed outside of an edit session on Topologies within Personal Geodatabases or on Topologies within SDE Geodatabases which have not been registered as versioned.  Once the Topology is registered as versioned, ValidateTopology must be performed within an edit session.  When performed within an edit session, ValidateTopology must also be bracketed within an edit operation.

It is not neccessary to validate the entire dirty area of the topology.  Subsets of the dirty area can be specified, resulting in a partial validation. When a partial validation occurs, the original dirty area is clipped by the IEnvelope that was supplied for the validate.

[C#]

ValidateTopology validates the dirty area of the topology in the area specified by the areaToValidate envelope.  The validate process evaluates all the rules and produces any topology errors corresponding to areas in which a rule has been violated.  The ValidateTopology function returns the envelope of the validated area.  If an empty envelope is supplied, ValidateTopology will return an empty validated area.  ValidateTopology can be performed outside of an edit session on topologies within Personal Geodatabases or on topologies within SDE Geodatabases that have not been registered as versioned.  Once a topology is registered as versioned, ValidateTopology must be performed within an edit session and bracketed within an edit operation.  The IWorkspaceEdit or IEditor interfaces can be used to manage edit sessions and edit operations.

An entire topology can be validated by supplying the envelope of the extent of the topology.

By supplying a polygon object to the ITopology::DirtyArea property, the dirty area at a particular location can be returned.  The envelope of the returned dirty area polygon can then be passed into ValidateTopology.

[C++]
[Visual Basic 6.0]

ValidateTopology validates the dirty area of the topology in the area specified by the areaToValidate envelope.  The validate process evaluates all the rules and produces any topology errors corresponding to areas in which a rule has been violated.  The ValidateTopology function returns the envelope of the validated area.  If an empty envelope is supplied, ValidateTopology will return an empty validated area.  ValidateTopology can be performed outside of an edit session on topologies within Personal Geodatabases or on topologies within SDE Geodatabases that have not been registered as versioned.  Once a topology is registered as versioned, ValidateTopology must be performed within an edit session and bracketed within an edit operation.  The IWorkspaceEdit or IEditor interfaces can be used to manage edit sessions and edit operations.

An entire topology can be validated by supplying the envelope of the extent of the topology, demonstrated by the following VBA code example.

  'Assume we have a reference to a Topology called pTopo
  Dim pGeoDS As IGeoDataset
  
  'QI to the IGeoDataset so we can get the extent of the Topology
  Set pGeoDS = pTopo
 
  'Validate the Topology
  pTopo.ValidateTopology pGeoDS.Extent.Envelope

By supplying a polygon object to the ITopology::DirtyArea property, the dirty area at a particular location can be returned.  The envelope of the returned dirty area polygon can then be passed into ValidateTopology.

  'Assume we have a reference to a Topology called pTopo
  Dim pGeoDS As IGeoDataset
  Dim pLocation As ISegmentCollection
  Dim pPoly As IPolygon
  Dim pAreaToValidate As IEnvelope
  Dim pAreaValidated As IEnvelope
 
  'Create a new polygon object
  Set pLocation = New Polygon
 
  'QI to the IGeoDataset so we can get the extent of the Topology
  Set pGeoDS = pTopo
 
  'Set the rectangle of the pLocation polygon to be equal to the Topology extent
  pLocation.SetRectangle pGeoDS.Extent
 
  'Get the Dirty Area for the entire Topology
  Set pPoly = pTopo.DirtyArea(pLocation)
 
  'Set the Area to validate and validate the topology
  Set pAreaToValidate = pPoly.Envelope
  Set pAreaValidated = pTopo.ValidateTopology(pAreaToValidate)

[Visual Basic .NET]

ValidateTopology validates the dirty area of the topology in the area specified by the areaToValidate envelope.  The validate process evaluates all the rules and produces any topology errors corresponding to areas in which a rule has been violated.  The ValidateTopology function returns the envelope of the validated area.  If an empty envelope is supplied, ValidateTopology will return an empty validated area.  ValidateTopology can be performed outside of an edit session on topologies within Personal Geodatabases or on topologies within SDE Geodatabases that have not been registered as versioned.  Once a topology is registered as versioned, ValidateTopology must be performed within an edit session and bracketed within an edit operation.  The IWorkspaceEdit or IEditor interfaces can be used to manage edit sessions and edit operations.

An entire topology can be validated by supplying the envelope of the extent of the topology.

By supplying a polygon object to the ITopology::DirtyArea property, the dirty area at a particular location can be returned.  The envelope of the returned dirty area polygon can then be passed into ValidateTopology.

See Also

ITopology Interface

Example

ValidateTopology Example

 


Feedback Send feedback on this page