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

Improvements to box search. #1014

Merged
merged 1 commit into from
Aug 13, 2019
Merged

Improvements to box search. #1014

merged 1 commit into from
Aug 13, 2019

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Aug 12, 2019

This returns results in the same format as pointSearch. It also adds a polygonSearch; boxSearch is now implemented as a special case of the polygonSearch.

This correctly uses the feature coordinate system (fixes #705) as the source gcs for feature points (though searches are done in map gcs space).

Before, on polygon features, point searches were done in feature coordinate space. This means that a point that appeared visually in the map gcs to be inside a polygon could fail to be considered in that polygon if in the feature's gcs the point landed outside of the polygon. Now, polygon features' point searches are done in the map's gcs to eliminate this issue. The polygon feature polygonSearch also uses the map's gcs for the same reason.

The partial option is now honored. Before, points were considered in a box if their centers were inside the box. Now, points are considered inside a polygon if they are entirely within it taking into account their radius and stroke. Points are partially within the polygon if their radius and stroke land on the polygon border. The point feature has an additional option of partial: 'center' wherein points whose centers are in the box or polygon are returned.

The pointTo2DTriangleBasis utility function has been renamed to pointToTriangleBasis2d for greater consistency.

The polygon example has been modified to highlight polygons when brushed over (ctrl-shift-drag).

This returns results in the same format as pointSearch.  It also adds a
polygonSearch; boxSearch is now implemented as a special case of the
polygonSearch.

This correctly uses the feature coordinate system (fixes #705) as the
source gcs for feature points (though searches are done in map gcs
space).

Before, on polygon features, point searches were done in feature
coordinate space.  This means that a point that appeared visually in the
map gcs to be inside a polygon could fail to be considered in that
polygon if in the feature's gcs the point landed outside of the polygon.
Now, polygon features' point searches are done in the map's gcs to
eliminate this issue.  The polygon feature polygonSearch also uses the
map's gcs for the same reason.

The `partial` option is now honored.  Before, points were considered in
a box if their centers were inside the box.  Now, points are considered
inside a polygon if they are entirely within it taking into account
their radius and stroke.  Points are partially within the polygon if
their radius and stroke land on the polygon border.  The point feature
has an additional option of `partial: 'center'` wherein points whose
centers are in the box or polygon are returned.

The `pointTo2DTriangleBasis` utility function has been renamed to
`pointToTriangleBasis2d` for greater consistency.

The polygon example has been modified to highlight polygons when brushed
over (ctrl-shift-drag).
Copy link

@matthewma7 matthewma7 left a comment

Choose a reason for hiding this comment

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

These are really useful utilities.
Approving.

@manthey manthey merged commit 209ce83 into master Aug 13, 2019
@manthey manthey deleted the box-search branch August 13, 2019 12:16
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.

BoxSearch is broken
2 participants