Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Implement Set Operators for Box Types #21

Description

@chaitan94

• +: Union of the bounding boxes
• *: Intersection of the bounding boxes

We can override the respective operators in both C++ and Python
Invalid operations should throw accordingly

Todo Checklist

  • TBox, TBox
    • Union
    • Intersection
  • STBox, STBox
    • Union
    • Intersection

MobilityDB queries for reference/test cases

mobilitydb=# select intrange '[10, 20)' + '[15, 40)';
 ?column? 
----------
 [10,40)
(1 row)

mobilitydb=# select intrange '[10, 20)' * '[15, 40)';
 ?column? 
----------
 [15,20)
(1 row)

mobilitydb=# select intrange '[10, 20)' - '[15, 40)';
 ?column? 
----------
 [10,15)
(1 row)

mobilitydb=# select intrange '[10, 20)' + '[30, 40)';
ERROR:  result of range union would not be contiguous

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions