This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Introduce distance expression - #16397
Merged
Merged
Conversation
zmiao
force-pushed
the
zmiao-distance-expression
branch
2 times, most recently
from
April 15, 2020 12:28
48cedce to
3fe3a32
Compare
zmiao
requested review from
alexshalamov,
galinelle,
jmalanen,
mourner,
pozdnyakov and
tmpsantos
April 15, 2020 12:29
zmiao
force-pushed
the
zmiao-distance-expression
branch
4 times, most recently
from
April 19, 2020 18:20
1192b49 to
21e3c22
Compare
pozdnyakov
reviewed
Apr 20, 2020
|
|
||
| // <distance, range1, range2> | ||
| using DistPair = std::tuple<double, IndexRange, IndexRange>; | ||
| class Comparator { |
Contributor
There was a problem hiding this comment.
could be free function (in a nameless namespace)
Contributor
Author
There was a problem hiding this comment.
I use this customer class as the comparator of priority_queue, I tried to use lambda, but it does not work with alias-declaration.
zmiao
marked this pull request as ready for review
April 20, 2020 09:22
zmiao
force-pushed
the
zmiao-distance-expression
branch
2 times, most recently
from
April 20, 2020 09:58
dd9c186 to
8a655e3
Compare
tmpsantos
reviewed
Apr 20, 2020
tmpsantos
left a comment
Contributor
There was a problem hiding this comment.
Please rebase the branch, the new clang-tidy checks have landed.
zmiao
force-pushed
the
zmiao-distance-expression
branch
3 times, most recently
from
April 20, 2020 13:45
9db4c43 to
7a64458
Compare
zmiao
force-pushed
the
zmiao-distance-expression
branch
from
April 21, 2020 14:31
d445ea5 to
19f794a
Compare
alexshalamov
approved these changes
Apr 21, 2020
Add distance unit choices Fix cmake and add license Add support for LineString Features Add template to geometry helper function Only support line and point Rename geometry_within.cpp hpp file to geometry_util.cpp .hpp Remove incorrect indexFilter, fix pointSetsDistance Fix distance expression
…ion in geometry_util, add range assertion for distance contaniner IndexRange Change distance units to small letters, update tests accordingly
zmiao
force-pushed
the
zmiao-distance-expression
branch
from
April 22, 2020 08:11
7f669f7 to
d2c08b8
Compare
This was referenced Apr 22, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Launch Checklist
This pr introduces a new expression called
distance. It calculates the shortest distance between the geoObject input and the feature geometry. The expression will return. distance in the unit that is provided inside the expression as an argument. If theUnitis not provided, the default unit typeMeterswill be taken into use.The format of this expression is as following:
The first version of this expression will support Geometry type :
Point,MultiPoint,LineStringandMultiLineString.One example of using expression with
filterwould have following effects :@mapbox/maps-android @mapbox/maps-ios @mapbox/core-sdkif this PR adds or updates a public API@mapbox/gl-jsif this PR includes shader changes or needs a js port @mapbox/gl-jsneeds changeloglabel if a changelog is needed (remove label when added)expression-tests and render-tests: mapbox/mapbox-gl-js#9602