User Tools

Site Tools


samples:samples:selectbyshape

Table of Contents

SelectByShape sample

Documentation | Samples | SelectByShape

Summary

SelectByShape sample - demonstrates how to select vector features by drawing an arbitrary shape (circle or rectangle) interactively on the map.

Description

What the sample shows:

  • Selecting vector features using shape boundaries
  • Spatial query using user-drawn shapes
  • Finding features within or intersecting shapes
  • Combining multiple selection criteria
  • Highlighting selected features in viewer
  • Exporting selected feature data
  • Interactive shape drawing for spatial queries
  • Layer-based selection management

This sample illustrates use of:

Name Description
TGIS_LayerVector.DeselectAllClears the selection state of all shapes in the layer.
TGIS_LayerVector.RevertShapesReverts all shapes in the layer to their last saved state and discards all pending shape-level edits.
TGIS_LayerVector.CreateShapeCreates a new editable shape instance from the specified TGIS_Shape descendant class.
TGIS_LayerVector.FindFirstInitiates iteration by finding the first shape in the layer and prepares cursor state for subsequent FindNext calls.
TGIS_LayerVector.FindNextRetrieves the next shape from the active FindFirst query cursor and continues iteration over shapes matching the original criteria.
TGIS_Shape.AddPartStarts a new part in a multipart shape geometry.
TGIS_Shape.AddPointAdds a 2D vertex to the current part of the shape.
TGIS_Topology.MakeBufferComputes a buffer polygon around a shape at the specified distance using 9 vertices to approximate quarter-circle arcs.
TGIS_ViewerWnd.PaintExtraEventPaintExtra event.

Code

This sample is available on the following platforms (click to view the source code on GitHub):

2026/08/30 05:53

Page Tools