Skip to content

Fix bug in atstbox function#487

Merged
mschoema merged 3 commits intoMobilityDB:masterfrom
mschoema:fix_at_stbox
May 8, 2024
Merged

Fix bug in atstbox function#487
mschoema merged 3 commits intoMobilityDB:masterfrom
mschoema:fix_at_stbox

Conversation

@mschoema
Copy link
Copy Markdown
Member

@mschoema mschoema commented May 7, 2024

This PR fixes a bug in atstbox that happened when a tpoint exited and entered the box in two contiguous segments.
For example:

select astext(atStbox(
    tgeompoint '[Point(1 1)@2000-01-01, Point(1 3)@2000-01-02, Point(1 1)@2000-01-03]', 
    stbox 'STBOX X((0,0),(2 2))'));

Before:

                                                   astext                                                    
-------------------------------------------------------------------------------------------------------------
 {[POINT(1 1)@2000-01-01 00:00:00+01, POINT(1 2)@2000-01-01 12:00:00+01, POINT(1 1)@2000-01-03 00:00:00+01]}
(1 row)

After:

                                                                      astext                                                                      
--------------------------------------------------------------------------------------------------------------------------------------------------
 {[POINT(1 1)@2000-01-01 00:00:00+01, POINT(1 2)@2000-01-01 12:00:00+01], [POINT(1 2)@2000-01-02 12:00:00+01, POINT(1 1)@2000-01-03 00:00:00+01]}
(1 row)

Also added a few more edge cases in the tests.

@mschoema mschoema merged commit 875d31a into MobilityDB:master May 8, 2024
@mschoema mschoema deleted the fix_at_stbox branch May 8, 2024 12:19
mschoema added a commit to mschoema/MobilityDB that referenced this pull request May 8, 2024
mschoema added a commit that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants