-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 ImproveOSM Q/A Layer #5739
Add ImproveOSM Q/A Layer #5739
Conversation
Doing some more work on this today and it actually seems like the ImproveOSM comment system doesn't work. Can anyone else try it on their site and confirm this? |
Thanks @SilentSpike ! This looks pretty great.. FYI we are preparing an iD release for this week, so it won't be in January, but I'd like to try to get it into the February release. |
All critical functionality is in, really just needs implementation cleanup and decisions (i.e. do we want all future QA layers to have consistent UX or each have their own icons/behaviour). For the time being (after trying various new icons) I've made these errors render the same as points with icons (but coloured). From my latest commit message:
Here's a preview of what that looks like. |
Awesome @SilentSpike , looking forward to trying this out. I think it's ok for the different Q/A layers to have their own icons for now. We probably won't add more than a handful. We might be able to generalize what the sidebar does. |
@bhousel I think different icons are actually useful to see which service is being interacted with. My main line of thinking with the more generic icon + detail icon implemented here is geared towards future Osmose support. It's similar to this service in that there's no distinguishable icon to use, but unlike this there are many more error types that could potentially be supported in future to differentiate between. In terms of the current status of this, the current desirable list in my head ordered by ratio of significance/ease:
Beyond that: In this way a lot of the code could be made general to work with these common values, then there could be some cross-service consistency in things like colouring (based on category) to aid workflow (e.g. if someone wanted to investigate all navigation related errors they'd just look for a certain colour). |
I played around with this a bunch today.. I think it's very nearly ready to merge 🎉
I agree, this is a good approach..
They look pretty good to me.. What do you think about calling it an ImproveOSM "Issue" or "Detection" instead of "Error".. Possibly also include some way to show the user the confidence score. There are a lot of false positives in this dataset and I don't want to give users the impression that these are all real errors that need fixing.
Yes, I tried this on the main ImproveOSM site and I couldn't get it to work there either. It's ok to leave the commenting feature out for now.
Ah yeah I noticed this too. It might be best to just invent an id string out of the
What you did looks pretty good for now! I was thinking of drawing some shape or arrows over the whole way (for missing oneways) or over the from/via/to (for missing turn restrictions) like on the ImproveOSM site, but we don't have to.
Yeah without true stable ids, I don't see a good way to do it. We can skip this part.
yes!
Yes, this would be great to have some consistency. FWIW, I did put a bunch of thought into the KeepRight colors. I probably spent a few hours adjusting them so that they
Anyway, great work! I'm happy to merge it whenever you feel that it's finished. |
Yes this is a good idea, something I've had in the back of my mind for a while now.
The potential for false positives is also something I've been considering how best to convey. Unfortunately the detections shown here are only the most confident cases (precisely to reduce the amount of false positives we're exposing to potentially new mappers). This is why I've included the data on number of trips used to make the detection. However, another thought I had was that we could have a note in the sidebar explaining that false positives are likely and the detection should be confirmed via imagery or on the ground. Beyond that (and beyond ImproveOSM) we could provide information on how to solve different QA "error" types, which for these could include mentioning first determining if it's a false positive due to their likelihood.
Will investigate this!
Yeah I realised the one-way data served was more useful than I thought so it should no longer have the curved segments issue. Considered using a more visual overlay, but decided to keep it simple for now as I worry that it'd clutter things too much (already moving these point icons not to block OSM features). Something to investigate once this is merged. |
Only processing one-way errors for now
Fix similar orange colours by using the same zoomed in colours as ImproveOSM for missing geometry (i.e. pink for roads). This frees up red for turn restrictions (as they are typically signed in red) and therefore blue for one-ways (as they tend to be signed blue or black).
This could result in error updates getting aborted when new errors are loaded as their individual ids are never going to match tile IDs (see `abortUnwantedRequests` function).
This allows more diverse representation of the error subject at a glance than relying on colour alone. However, it would be good to have a generic error icon that can contain icons which is differentiated from the point icon for clarity. Sidebar header currently still uses the bolt icon until I figure out how to deal with that. Also the font awesome icons don't seem to work, perhaps there's additional code needed for those that I've missed.
As per my last commit, this icon differentiates errors from points and still allows us to specifiy icons for errors to differentiate them amongst eachother. I learned quite a bit about SVGs and using them in HTML while implementing this 😝Had some issues getting the icon to center in the header so resorted to using a flexbox instead of absolute positioning being used elsewhere.
The direction of travel in the description was misleading as the way segment wasn't necessary linear and so the direction could change as you travel along the way. This is more explicit as it specifies the detected start/end nodes (also useful to show that it's not the whole way that might be one-way). The position is now taken as the central node in the `feature.points` list (or the average of the central two when there are an even number of points).
Clarifies some cases where geometry could be unclear with previous message.
Potential for multiple missing turn restrictions on one node and I've also seen a case of missing one-way along the same stretch of road in opposite directions! Missing geometry is tile based so can't really be coincident, but doesn't hurt to check in case they happen to land on a one-way or turn restriction.
Javascript is not my usual domain so still getting used to how scope works and working with callbacks. Believe this code is now written as intended. As a bonus a response status to the error update request which isn't the expected 200 now returns before visibly removing the error and adding it to the closed cache.
Rebased to master and squashed a few trivial commits in the process. In terms of functionality I'm happy with what's here. The code itself can probably be improved/cleaner in places, but I figure let's get this into the master branch since it's working and improve from there. I haven't used open location codes here as I didn't want to introduce a new dependency just for this, but perhaps worth using if they'll also be used elsewhere. You'll probably want to review e9397aa in particular before merging as it's the first time I've had to properly consider how scope and callbacks work in javascript. |
Yes, I agree.. I think it looks great (and PRs get harder to merge the longer they sit).
Sounds good. I might make an attempt at it this weekend...
You did great 👍 iD is a fantastic project to learn on. Also, ping me on Slack anytime if you ever have any questions, or are looking for more to do! 😄 |
Looks awesome, @SilentSpike, thanks so much for contributing in a big way like this! |
@SilentSpike Do you still need someone to investigate the comments on the ImproveOSM side? |
@mvexel Do you mean to fix the functionality on the ImproveOSM end? We've confirmed that they don't seem to be functional, but if that is updated I'll happily add in the support on this end. |
The comment functionality should work for the ImproveOSM layers, at least in the ImproveOSM plugin works as expected. Example of comment operation request body: One ways (Direction of flow) Turn restrictions The comments of an ImproveOSM element can be accessed by using the "retrieveComments" operation. **Turn restrictions ** : Let me know if you need further assistance with the ImproveOSM API's. |
@beataj-telenav Awesome thank you! I was only going by the requests I observed being sent by the improveosm.org editor so was totally unaware of the With this information I'll see if I can get commenting working here in iD 😃 |
@SilentSpike : I forgot to add a retrieveComments example for the One-way (Direction of flow) component. In this case the request would be: https://directionofflow.skobbler.net/directionOfFlowService/retrieveComments?wayId=229550180&fromNodeId=151993197&toNodeId=2381277816. Btw: great work with the integration, I'm glad that our components will be integrated also to the main iD version. |
@SilentSpike The timestamp is the number of seconds elapsed since 1970-01-01 00:00:00 UTC, not counting leap seconds. In order to display the correct value, you need to format it based on the current timezone. (In the JOSM plugin we first transform the value into milliseconds and then format based on the user timezone). |
@SilentSpike For the missing roads data in some cases, you might get -1 for the numberOfTrips field. This happens for data that came from a 3rd party. In the JOSM plugin for these cases, we display "not available". |
Ref #5683
This PR is still WIP, but opened for progress tracking and collaborative purposes.
My current priorities:
Implement error commenting(appears to be non-functional)There's a lot of similar and duplicate code to the KeepRight implementation that could probably be made more general and shared between the two (and future services). I could probably do this too, but would rather get this working first then worry about that in a later PR.