adonmo / meos

Mobility Engine, Open Source
https://adonmo.github.io/meos/
MIT License
21 stars 3 forks source link

Implement Set Operators for Box Types #21

Open chaitan94 opened 4 years ago

chaitan94 commented 4 years ago

• +: 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

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