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 an overpass based query tool #721

Merged
merged 34 commits into from Nov 7, 2014

Conversation

Projects
None yet
@tomhughes
Copy link
Member

commented Mar 16, 2014

This pull adds an overpass based query tool. A new icon on the right hand side of the map activates query mode where clicking on the map will ask overpass for both "nearby" and "enclosing" features and display the resulting lists in the side bar.

There are a few things that I no need to be resolved before this is merged:

  • Need a better icon for the tool
  • Work out what to do about https
  • Object highlight left on map when clicking through to details
  • Don't disable query mode when clicking on tool icon

Comments, criticisms, code reviews etc welcome...

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Mar 16, 2014

Oh, and I should have said that there is a live instance running at http://overpass2.apis.dev.openstreetmap.org/ for you to play with.

@pnorman

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2014

The circle you get while clicking fades out quickly. Is this supposed to show the area matching for nearby? Is there some way we could show it after the results are generated? it would give context to them, making it more obvious what to expect.

@pnorman

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2014

Can we order enclosing features by ascending way area? That way the most locally relevant feature is at the top, and as you go down you get more globally relevant features.

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Mar 16, 2014

Yes that is what the circle shows, and originally I had it showing permanently but when you do that it can obscure some of the features that appear as you hover over the list, which is I why I opted to make it fade out instead.

The only ordering that overpass offers is by id or a simple "geo order" which is coarse and based on tiling. Neither of those is really best - what we really is want is to order by distance from the target point for the "nearby" list and size for the "enclosing" list but I don't see any realistic way of doing that.

@pnorman

This comment has been minimized.

Copy link
Contributor

commented Mar 17, 2014

@drolbr I know there are some parts of the overpass QL that aren't on the documentation. Is there any way to do ordering as tom describes that's not in the docs?

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Mar 17, 2014

@pnorman I did look at the overpass source last night and as far as I can see only the two sort methods I mentioned above are supported.

@tyrasd

This comment has been minimized.

Copy link
Member

commented Mar 17, 2014

Is there really much of a point behind sorting things by distance for this use-case?
I'd rather see "more interesting" POIs first (e.g. place-nodes before park benches or individual trees). I mean, if one only wants really nearby objects, one can simply zoom in more to restrict the query.

PS: I really like this new feature – looks very promising. 👍

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Mar 17, 2014

Well distance is an obvious and objective measure, and it's reasonable to assume that the user is looking to see what is at the point where they clicked, so the things closest to that are most likely to be important to them.

How "interesting" something is on the other hand is an entirely subjective measure and everybody will have a different idea of what is interesting and what is not - even for one individual it will likely vary from day to day depending on what exactly they are trying to do at the time.

@tyrasd

This comment has been minimized.

Copy link
Member

commented Mar 17, 2014

Another question is: How do you actually define distance for linear and polygonal features? Distance from centroid, minimum distance from any segment, some kind of median distance, …

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Mar 17, 2014

Well that is certainly a reasonable question ;-)

@danstowell

This comment has been minimized.

Copy link
Contributor

commented Mar 17, 2014

Hi - I think this is a neat idea for interactively querying data. I have some feedback on the interaction:

  • Nearby features as a list in a side panel - it's quite hard to understand how this list relates to the point that I clicked on, and it's a rather effortful interaction to mouseover everything to try and get an idea of where they are. For me, I feel it would be much more comprehensible to put the "nearby features" directly on the map, all as faint highlights, with the description popping up perhaps on mouseover. (The enclosing features I guess should stay in the side panel.)
  • It's really easy to forget where you have clicked. I'd like the circle not to fade out entirely (fade to almost-gone?) or perhaps also leave a small dot-like icon at the query point. (Or maybe it would be obvious enough, if the thing I mentioned above was in place.)
@PaulAnnekov

This comment has been minimized.

Copy link

commented Oct 9, 2014

I think that it might work like on Google Maps. You just click on map and information about this place appears. Current implementation with additional icon is not such intuitive as just click.

As for now, the best solution I have seen is on 2gis. Try it: http://2gis.com.cy/limassol/center/33.032155%2C34.686941/zoom/19

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2014

I've tweaked this a little bit - merged @danstowell's link colour patch and also updated it to use some new overpass features.

I'd like to merge it now, unless anybody can see a good reason not to?

As always, there's a live version at http://overpass2.apis.dev.openstreetmap.org/ that you can play with.

@HolgerJeromin

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2014

Just a minor thing. Not a real blocker (as i cant wait for this feature go live :-)

Clicking the ? got me into an "query mode". I can click several points. I like this.
But clicking the ? again does not deactivate this mode if the query panel is open. IMO the mode should be deactivated, but the side panel should be kept open (until closed by the user).

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2014

That's certainly possible (and @danstowell raised the same issue with me just before you) and I quite like the idea of leaving the panel open if you turn it off in that way.

If we do that then it does raise the question of whether or not the query tool should be activated if you load a query URL directly? My inclination is to leave it disabled (unlike now).

@HolgerJeromin

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2014

I have the same feeling. The question mark at the mouse cursor is not very visible. So it could be irritating. And a person who got the query link perhaps have no idea the ? toggles this mode.

@tomhughes tomhughes force-pushed the tomhughes:overpass branch from e0a95ad to 6b09732 Nov 5, 2014

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2014

I've implemented that now - clicking the tool icon will turn off query mode but leave the sidebar open and loading a query URL will not activate it.

There's a small cost in that old browsers that don't support the history API will turn the query tool off after every query, but there's no real way to avoid that.

@danstowell

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2014

Looking good! I hope the overpass servers are ready for this :)

@pnorman

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

Looks good to me. I wasn't able to test what happens when clicking on a link in terms of zooming in and out, for obvious reasons.

@HolgerJeromin

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

Perhaps the search circle could be hidden at hovering over search results, but not after a few seconds.
But that could be tweaked later.

@Zverik

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

I like it, and see no outstanding issues.

@HolgerJeromin

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

Perhaps use a smaller line/cell height (half size? 2/3 the size?) for large results lists like:
http://overpass2.apis.dev.openstreetmap.org/query?lat=50.77940&lon=6.07458
Is it possible to filter/(make less prominent) nodes without tags?
I can move this after merging this PR to a new issue.

@pnorman

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

Is it possible to filter/(make less prominent) nodes without tags?

The nodes I saw in that list did have tags, just uncommon ones (e.g. https://www.openstreetmap.org/node/3105062026)

@HolgerJeromin

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

Oh, right. There are very few intagged nodes there. I forgot :)

Ok, just checked. Untagged nodes are hidden, as seen with this high detailed buildings:
http://overpass2.apis.dev.openstreetmap.org/query?lat=3.86410&lon=11.50160

@tomhughes

This comment has been minimized.

Copy link
Member Author

commented Nov 6, 2014

Yes - there is a list (https://github.com/tomhughes/openstreetmap-website/blob/overpass/app/assets/javascripts/index/query.js#L7) of tags which are ignored, so we can always add things to that - anything which has a tag that isn't in that list is then shown.

@pnorman

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

That said I was persuaded that there are a few users doing things like DWG investigations who would still find the data layer useful so currently I don't see us removing it, though we might make it less "sticky" so that it doesn't reactivate if you happen to have had it on during your last visit.

I see this replacing what I use the data layer for. The more complicated stuff needs to be done in JOSM/shell scripts anyways. The data layer is still sometimes useful for showing how much data is behind OSM.

In any case, I'd suggest holding off data layer changes until a subsequent PR.


The icon is listed as a to-do. I'm kind of inclined to agree. I was thinking a 🔍 or similar, but that looks very similar to the OSM logo.

@samanpwbb, any thoughts?

@samanpwbb

This comment has been minimized.

Copy link
Member

commented Nov 6, 2014

I find the '?' icon pretty sensible for this interaction, even though it is an overloaded symbol. It could also mean 'help. Magnifying glass, which is the other option, is overloaded too, as @pnorman mentioned.

@SomeoneElseOSM

This comment has been minimized.

Copy link

commented Nov 6, 2014

Re the data layer - I currently often use it to "see what's there" when the standard map tiles haven't displayed. It's only ever a temporary thing though, so having it "less sticky" as @pnorman suggested above would be fine for me (and even turning it off every time the map zoomed out, e.g. to display a larger feature that you've just clicked on, would be too).

@HolgerJeromin

This comment has been minimized.

Copy link
Contributor

commented Nov 6, 2014

the ? fits very well with the mouse cursor in that mode, too. There is no cross browser CSS as alternative for the cursor.

i really like the not-allowed cursor in low zoom :-)

Less sticky data layer would be nice. i am never happy with it reactivating.

Add KSJ2 tags to uninteresting list
The KSJ2 tags often appear on nodes with no interesting tags
as import cruft.

@openstreetmap-mirror openstreetmap-mirror merged commit 758e6da into openstreetmap:master Nov 7, 2014

@tomhughes tomhughes deleted the tomhughes:overpass branch Nov 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.