Documentation | ⌂ Topology Layers | « Previous | Next »
Throughout this guide we have focused primarily on topology workflows available through TatukGIS Editor.
One of the key design goals of the TatukGIS topology framework is that the same functionality is also available to developers through TatukGIS Developer Kernel.
This allows custom GIS applications to provide topology capabilities without implementing topology management, validation, hierarchy maintenance, or editing workflows from scratch.
This chapter introduces the High-Level API based on the TGIS_TopoTool class. Low-Level topology classes such as TGIS_TopoStoreAbstract class, and topology primitive management APIs are outside the scope of this introductory guide.
Topology stored using the SQLite topology format is supported natively by TatukGIS Developer Kernel.
A topology layer can be added to a map and used very much like a standard vector layer.
The layer can:
From the application point of view, topology layers behave similarly to ordinary vector layers.
IMPORTANT: SQLite topology support is available natively in TatukGIS Developer Kernel. Support for PostGIS Topology and Oracle Topology requires Enterprise functionality.
The topology framework was intentionally designed to hide the complexity of topology management behind a small set of high-level operations.
Rather than requiring an application developer to manually:
TatukGIS provides a ready-made topology controller in TGIS_TopoTool class. This class exposes the same workflows available in TatukGIS Editor.
The application launches a tool, and the framework handles the complete workflow automatically.
Topology functionality becomes available after creating an instance of TGIS_TopoTool class.
Typically, this is performed during form initialization.
procedure TfrmTopology.FormCreate(Sender: TObject); begin fTopoTool := TGIS_TopoTool.Create( Self, gisViewer, gisLegend, gisAttributes ); end;
The constructor accepts instances of:
Once created, the object is ready to execute topology operations.
Most topology functionality is exposed through:
RunTool(...)
The method accepts one value from the TGIS_TopoTools enumeration.
procedure RunTool( const _tool : TGIS_TopoTools );
The Create Topology Wizard can be launched through:
procedure TfrmTopology.menuTopoCreateTopologyClick( Sender: TObject ); begin fTopoTool.RunTool( TGIS_TopoTools.CreateTopology ); end;
This operation corresponds directly to:
Topology → Create Topology...
in TatukGIS Editor.
Feature Layer creation is exposed through:
procedure TfrmTopology.menuTopoCreateFeatureLayerClick( Sender: TObject ); begin fTopoTool.RunTool( TGIS_TopoTools.CreateFeatureLayer ); end;
Executing this method launches the same Feature Layer Wizard used throughout this tutorial.
Features can be created using:
procedure TfrmTopology.menuTopoCreateFeatureClick( Sender: TObject ); begin fTopoTool.RunTool( TGIS_TopoTools.CreateTopoFeature ); end;
This operation launches the Create Feature Wizard and guides the user through selecting source objects and destination layers.
Feature deletion is performed through:
procedure TfrmTopology.menuTopoDeleteFeatureClick(
Sender: TObject
);
begin
fTopoTool.RunTool(
TGIS_TopoTools.DeleteTopoFeature
);
end;
Hierarchy updates are handled automatically by the topology framework.
Feature composition can be modified using:
procedure TfrmTopology.menuTopoAddElementsToFeatureClick( Sender: TObject ); begin fTopoTool.RunTool( TGIS_TopoTools.AddElementsToTopoFeature ); end;
and:
procedure TfrmTopology.menuTopoDeleteFeatureElementClick( Sender: TObject ); begin fTopoTool.RunTool( TGIS_TopoTools.DeleteTopoFeatureElement ); end;
These operations correspond to the Add Elements and Delete Feature Element workflows described earlier in this guide.
Topology import errors can be repaired automatically or manually.
procedure TfrmTopology.menuTopoAutoFixImportErrorsClick( Sender: TObject ); begin fTopoTool.RunTool( TGIS_TopoTools.AutoFixTopoImportErrors ); end;
procedure TfrmTopology.menuTopoMergeFeatureIntoNeighborClick( Sender: TObject ); begin fTopoTool.RunTool( TGIS_TopoTools.ManualFixTopoImportErrors ); end;
The corresponding repair wizards are displayed automatically.
Additional topology operations are also available.
procedure TfrmTopology.menuTopoSettingsClick( Sender: TObject ); begin fTopoTool.OpenSettingsForm; end; <code pascal>
procedure TfrmTopology.menuTopoRollbackClick( Sender: TObject ); begin fTopoTool.Rollback; end;
Rollback restores the topology to the most recently committed state.
One of the strengths of the High-Level API is its simplicity.
After:
the application immediately gains support for:
TIP: For many applications, the code presented in this chapter is sufficient to build a complete topology-enabled GIS application. The complexity of topology management remains hidden behind the TGIS_TopoTool class interface.
The next chapter shows editing API used ina TopologyLayer sample application.