Basic Tools for Spatial Query

Spatial query is a query mode that constructs filters through spatial relationships between geometries. The application currently supports 8 basic spatial query tools, including: Cross, Contain, Within, Overlap, Disjoint, Touch, Identity, and Intersect.

Spatial query involves three elements: query layers, query layer, and search results. In the illustrations of each tool, the query layer is shown in green, non-matching objects in query layers are shown in black, and search results are shown in red.

Cross

Returns all objects in query layers (line, region, CAD) that cross the query object (line).

  • Basic relationship: Query layer (A) crosses query layers (B).
  • Line to line: A enters from one side of B's interior and exits at another point. The intersection of A's interior and B's interior is non-empty with topological dimension 0.
  • Line to region: The intersection of A's interior and B's interior is non-empty; The intersection of A's interior and B's exterior is non-empty.

Cross tool details:

Spatial Query Condition Query Relationship Illustration Description
Cross_LineLine Line to line A line crosses another line, entering from one side and exiting through another point in the interior, with intersection points only.
Cross_LineRegion Line to region A line crosses a region with at least one endpoint outside the region.

Contain

Returns objects in query layers (point, line, region, text, CAD) that contain the query layer (point, line, region). (May include boundary intersections.)

Basic relationships:

  • Query layers (A) contain query layer (B) (boundary intersections allowed).
  • The intersection of A's exterior and B's interior is empty, and the interior intersection is non-empty or A's boundary has no intersection with B's interior.
  • Dimension of A ≥ Dimension of B.

Contain tool details:

Spatial Query Condition Query Relationship Illustration Description
Contain_PointPoint Point to point Points coincide.
Contain_LinePoint Line to point Line A contains point B on its path, including endpoints.
Contain_TextPoint Text to point Text A contains point B within its position.
Contain_LineLine Line to line Line A contains line B, allowing endpoint coincidences.
Contain_TextLine Text to line Text A contains line B within its position.
Contain_RegionPoint Region to point Region A contains point B in its interior or boundary.
Contain_RegionLine Region to line Region A contains line B, allowing endpoints on boundary.
Contain_RegionRegion Region to region Region A contains region B with boundary coincidences allowed.
Contain_RegionText Region to text Region A contains text B in its interior or boundary.

Within

Returns objects in query layers (point, line, region, CAD) that are contained by the target layer. For regions, must be fully contained (including boundaries); for lines, must be completely contained; for points, must be on the query layer.

Basic relationship:

  • Query layers (A) are contained by target layer (B). Inverse of Contain.

Within tool details:

Spatial Query Condition Query Relationship Illustration Description
Within_PointPoint Point to point Points coincide.
Within_PointLine Point to line Point A is contained by line B, including endpoints.
Within_PointRegion Point to region Point A is contained by region B in interior or boundary.
Within_LineLine Line to line Line A is contained by line B with endpoint coincidences.
Within_LineRegion Line to region Line A is contained by region B in interior or boundary.
Within_RegionRegion Region to region Region A is contained by region B with boundary coincidences.

Overlap

Returns objects in query layers (line, region, CAD) that partially overlap with query layer (line, region).

Basic relationship:

Overlap tool details:

Spatial Query Condition Query Relationship Illustration Description
Overlap_LineLine Line to line Partial overlap between lines. Complete containment excludes match.
Overlap_RegionRegion Region to region Partial overlap between regions. Complete containment excludes match.

Disjoint

Returns objects in query layers (point, line, region, CAD) that are separated from query layer (point, line, region).

Basic relationship:

Disjoint tool details:

Spatial Query Condition Query Relationship Illustration Description
Disjoint_PointPoint Point to point Points are separate.
Disjoint_PointLine Point to line No intersection between point and line.
Disjoint_PointRegion Point to region No intersection between point and region.
Disjoint_LinePoint Line to point No intersection between line and point.
Disjoint_LineLine Line to line No intersection between lines.
Disjoint_LineRegion Line to region No intersection between line and region.
Disjoint_RegionPoint Region to point No intersection between region and point.
Disjoint_RegionLine Region to line No intersection between region and line.
Disjoint_RegionRegion Region to region No intersection between regions.

Touch

Returns objects in query layers (point, line, region, CAD) whose boundaries touch query layer (point, line, region).

Basic relationship:

Touch tool details:

Spatial Query Condition Query Relationship Illustration Description
Touch_PointLine Point to line Point A is on line B's endpoint.
Touch_PointRegion Point to region Point A is on region B's boundary.
Touch_LinePoint Line to point Point B is on line A's endpoint.
Touch_LineLine Line to line Three contact cases:
Touch_LineRegion Line to region Line has endpoints on region boundary or partial overlap with boundary.
Touch_RegionPoint Region to point Point B is on region A's boundary.
Touch_RegionLine Region to line Line has endpoints on region boundary or partial overlap with boundary.
Touch_RegionRegion Region to region Regions share boundary only.

Identity

Returns objects in query layers (point, line, region, CAD) that completely coincide with query layer (point, line, region), allowing different control points.

Basic relationship:

Identity tool details:

Spatial Query Condition Query Relationship Illustration Description
Identity_PointPoint Point to point Points coincide.
Identity_LineLine Line to line Lines coincide with possible different control points.
Identity_RegionRegion Region to region Regions coincide with possible different control points.

Intersect

Returns all intersecting objects in query layers (point, line, region) with query layer (point, line, region, text, CAD).

Basic relationship:

Intersect tool details:

Spatial Query Condition Query Relationship Illustration Description
Intersect_PointPoint Point to point Points coincide.
Intersect_PointLine Point to line Point intersects line.
Intersect_PointRegion Point to region Point intersects region.
Intersect_PointText Point to text Point coincides with text.
Intersect_LinePoint Line to point Line intersects point.
Intersect_LineLine Line to line Lines intersect.
Intersect_LineRegion Line to region Line intersects region.
Intersect_LineText Line to text Line intersects text.
Intersect_RegionPoint Region to point Region intersects point.
Intersect_RegionLine Region to line Region intersects line.
Intersect_RegionRegion Region to region Regions intersect.
Intersect_RegionText Region to text Region intersects text.
  • Basic relationship: Query layer (A) overlaps query layers (B).
    • A and B have same dimension
    • Interior intersections exist between A and B
    • Intersection maintains original geometry type
    • Query layer (A) and query layers (B) are completely separate
    • No interior intersections but boundary intersections exist
    • Geometry types must match with complete coincidence
    • Any spatial interaction between query object and target objects