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

Add distanceTo and bearingTo methods to arcTimelineItems #15

Open
PalminX opened this issue Mar 15, 2019 · 5 comments
Open

Add distanceTo and bearingTo methods to arcTimelineItems #15

PalminX opened this issue Mar 15, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@PalminX
Copy link
Contributor

PalminX commented Mar 15, 2019

Adding distanceTo and bearingTo methods to arcTimelineItems and to the filters would enable queries like this:

  • give mal all timelineItems that are in a southerly direction from the current timelineItem (bearing between 135 and 225 degrees)
  • show all timelineItems of type visit where the visit center is more than 50 meters from the place center (potentially mislabeled items)
  • give me all timelineItems within a radius of 1000m from Home
@PalminX
Copy link
Contributor Author

PalminX commented Mar 15, 2019

Initial implementation is available at https://github.com/PalminX/arc-data-server/tree/DistanceAndBearing

The current implementation uses this to show the distance of a timelineItem to its "place" in the timelineitems/list view. This use case is quite specific and needs to be changed, this should be available through the filter arguments.

TODO:

  • add filter options for the new methods to expose to web API

@sobri909
Copy link

show all timelineItems of type visit where the visit center is more than 50 meters from the place center (potentially mislabeled items)

This is great! 😄

It's also something I've wanted to build into Arc, for the same purpose (finding mislabelled visits), but haven't had the time to. Great to see it implemented here!

@PalminX
Copy link
Contributor Author

PalminX commented Mar 16, 2019

I see the arc-data-server as a playground to see how the data can be used, and then maybe some of that stuff can later be integrated into Arc

@thoughtgap thoughtgap added the enhancement New feature or request label Mar 17, 2019
@thoughtgap
Copy link
Owner

@PalminX I'm getting loads of

distanceBetween: no place or center objects
bearingBetween: no place or center objects

messages in my nodejs console, I guess for timelineItems without place. Is the implementation of the functions finished (can we remove the logs)?

Regarding your use cases:

  1. give mal all timelineItems that are in a southerly direction from the current timelineItem (bearing between 135 and 225 degrees)
  2. show all timelineItems of type visit where the visit center is more than 50 meters from the place center (potentially mislabeled items)
  3. give me all timelineItems within a radius of 1000m from Home
  1. How are you planning to hand over the "current timelineItem" to the API? By a timelineItem.itemId? Or by coordinate?
  2. That's a simple filter by timelineItems with distanceTo(timelineItem.place) > x
  3. This could work by passing either coordinates, place names or even place categories

We should definitely describe for which purposes each case is useful. (looking at you #14 👀)

@PalminX
Copy link
Contributor Author

PalminX commented Mar 17, 2019

I'm getting loads of

 distanceBetween: no place or center objects
 bearingBetween: no place or center objects

messages in my nodejs console, I guess for timelineItems without place. Is the implementation of the functions finished (can we remove the logs)?

Yes, these can be removed... these were mainly for debugging.

Also, adding the distance and bearing attributes to the /timelineItems/list endpoint was more for testing purposes, not as a final implementation/use of this.

Re 1. and 3.:

  1. How are you planning to hand over the "current timelineItem" to the API? By a timelineItem.itemId? Or by coordinate?

I haven't really thought this through yet... But the idea was more to use a place name as the reference location, i.e. maybe something like

  • /timelineItems/list?referencePlace=Home&minDistance=1000, to show all timelineItems which are at least 1000m away from Home
  • /timelineItems/list?referencePlace=Home&maxDistance=1000, to show all timelineItems which are at most 1000m away from Home
  • /timelineItems/list?referencePlace=Home&minBearing=135&maxBearing=225, to show all timelineItems which are in a southerly direction from home.

For now, I don't think it makes sense to use anything other than Places for location references.

In the future, a map-based frontend application could of course also use a marker on the map as a reference (useful to filter for a specific region)

thoughtgap added a commit that referenced this issue Mar 20, 2019
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

No branches or pull requests

3 participants