Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using radixtree for check spatialIDs' overlap #35

Merged
merged 20 commits into from
Oct 18, 2024

Conversation

mi-24v
Copy link
Member

@mi-24v mi-24v commented Oct 11, 2024

  • using multidimensional-radix-tree for CheckSpatialIdsOverlap and CheckSpatialIdsArrayOverlap
    • these functions were moved into detector package to prevent cycle import
  • new conversion function that adds offset to f-index for radix tree
    • since negative value cannot be inserted this tree

mi-24v added 14 commits July 26, 2024 09:42
by using altitude index conversion

To avoid cycle import between `integrate` and `transform`, check_spatial_id_overlap.go moved to new package
refactored convertZToMinAltitudekey to reuse index boundary check
multi-dimensional-radix-tree
Merge branch 'refs/heads/develop' into feature/using-radixtree-detectoverlap
Merge branch 'refs/heads/develop' into feature/using-radixtree-detectoverlap
It needs receiver if implementing tree cache;

```
type detector struct {
    tr tree.TreeInterface
}

func CheckSpatialIdsArrayOverlapWithCache(spatialIds1 tree.TreeInterface, spatialIds2 []string) (bool, error){
    // ...
}
```

This reverts commit de00e69
@mi-24v mi-24v marked this pull request as ready for review October 16, 2024 05:26
@mi-24v mi-24v added the enhancement New feature or request label Oct 16, 2024
@mi-24v mi-24v self-assigned this Oct 16, 2024
Copy link
Member

@HarutakaMatsumoto HarutakaMatsumoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this.
Check it out.

// AddZBaseOffsetToZ (拡張)空間IDz成分(fインデックス)にオフセット加算する
// ConvertZToAltitudekey()でズームレベル変換を行わずオフセット変換のみ指定したもの
//
// したがって ConvertZToAltitudekey(f, z, z, consts.ZBaseExponent, zBaseOffset)と等価
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memo: Change over from AddZBaseOffsetToZ(_) to convertZToMinAltitudekey(_).

Copy link
Member Author

@mi-24v mi-24v Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed at 056776c
(note: ConvertZToMinMaxAltitudekey is used since convertZToMinAltitudekey is private.)

And AddZBaseOffsetToZ was removed at a0e7440


const maxCases = 10

func main() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memo: Move this folder to examples/detectOverlap/main.go.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved at d1587dd and e6054cc

it found that `AddZBaseOffsetToZ` is not useful since it is slower than `ConvertZToMinMaxAltitudekey`, and this function existence only matters when `AddZBaseOffsetToZ` is faster than `ConvertZToMinAltitudekey`.
@HarutakaMatsumoto HarutakaMatsumoto merged commit 4834c6f into develop Oct 18, 2024
1 check passed
@HarutakaMatsumoto HarutakaMatsumoto deleted the feature/using-radixtree-detectoverlap branch October 18, 2024 04:37
@HarutakaMatsumoto
Copy link
Member

@mi-24v
I merged it.
Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants