-
-
Notifications
You must be signed in to change notification settings - Fork 215
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 go to coordinate feature to search bar #1181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🔍 🎯
Tried on bee farming demo project as shown on the gif but doesn't seem to work as expected : only "Map CRS" is suggested and selecting this one leads to nowhere. Local parsing issue ? Tried with another kind of parsing but it doesn't suggest anything. Also tried on a local project with another CRS (EPSG:2154, Lambert 93) using known coordinates and it still didn't work. |
Can you give the coordinate string you used which didn't parse as WGS84? I suspect you might have used the Google lat lon which would be parsed as lon lat by QField (and incidentally QGIS). "Leading to nowhere" merely means your project has nothing at the X Y of the Map CRS (very likely in any case :) ) |
Possibly a locale issue? |
Your android phone is set to which language? France/French? |
@nirvn should the "Map CRS" also be filtered by if the numbers fall within the extent of the CRS? |
@m-kuhn , a given CRS' extent (i.e. QgsCoordinateReferenceSystem::bounds() ) is in WGS84m which is no help to us in terms of filtering out Xs and Ys we assume are in the map CRS to begin with. Do you have a better idea? I think this once again highlights the need for QgsProject to have some extent property. |
Are the projected bounds not good enough? |
Unless set explicitly by the user we have two problems:
|
The locator correctly register the coordinates as 9.2523 and 46.8072, but fails to add the WGS84 result. Looking at the code, the only way that could happen is if the coordinate transform (from WGS84 to project CRS) fails here: https://github.com/opengisch/QField/pull/1181/files#diff-c95c177df25569bad8ba579f2adcfa02R122 It doesn't fail on my machine, nor on QGIS. I'll try later on my smartphone. |
yes |
@VxTedxV , glad to hear the WGS84 issue has been addressed (thanks for raising it BTW, you've likely helped fix mysterious issues in other parts of QField :) ). The "weird parsing format" is your French locale 😉 (i.e. thousands separator -> space, decimals separator -> comma). Regarding the use of "Map CRS" as label vs. the project's CRS friendly string (i.e. Lambert93, EPSG:2154), I've relied on the former as there's rarely enough horizontal space to add much more than that. Your screenshot is a good example of that, using Lambert93 EPSG:2154 would end up with elides, chopping off half of the label here. IMHO, most users will not really care about the project CRS either because they are merely viewing a project and have little understanding of a "CRS", or because they already know which CRS the project is in. Would "Project CRS" or "Canvas CRS" be better than "Map CRS"? |
@VxTedxV , oh BTW, when you say it works "very slow", what does that mean? |
OK. If comma is the decimal separator (which is not in my WGS84 test !), what is the one to separate X from Y ?
I understand the use of a generic label. I think "Project CRS" is closer to QGis but it's OK with "Map CRS"
On demo project, it's fast. |
@VxTedxV , ah, that's interesting -- on your large projects, do you have remotely accessed layers (i.e. postgis, oracle, mysql, mssql)? The problem there would be that the list waits until it goes through all the layers (looking for a matching feature based on display name). I thought those should happen in parallel. |
@nirvn can we prioritize a "known-fast" operation such as coordinate go to results? |
@m-kuhn , I thought the locator was emitting results as individual filters were finding those. I'll have a look |
None. If you want me to, I can record a video to see what I experienced (90% of the long video would be looking at the wheel spinning !) PS : you rock guys with all you do ! |
@VxTedxV , so, long story short, locator filters are managed by the OS scheduler. When there are available threads / cores, it'll run in parallel, otherwise sequential. Not sure how much control we have over this. In any case, you can use the "goto" prefix to only trigger a coordinate search. E.g., typing "goto 12.345,123.123" should make things amazingly fast. |
should but doesn't 😢 (about 70sec) |
@VxTedxV , what is the brand and model of your phone? |
Also, if you want to curate your project some more, you can remove a bunch of layers from being "searchable" via project properties dialog in QGIS, so searching becomes faster. |
Samsung Galaxy Xcover4 |
@VxTedxV , if you have a minute, try this APK #1197 (comment) -- should make things faster for you. |
Just tested. But not faster :/ I'll make some other tries in the next days... |
@VxTedxV , one more test: with the APK I linked to above, can you test the updated prefix, i.e. 'go 9.1203, 10.2039' (replace lon,lat with whatever you feel good with). Now that the prefix is only two characters, in theory typing 'golon,lat' should avoid triggering feature search altogether. |
Yes ! Instant recognition of coordinates with this "go" prefix 🎉 |
@VxTedxV , good. As mentioned above, you should probably tweak your project searchable layers settings too regardless of this addressed issue 👍 If you're game, here's something you could do: disable the searchable flag for layers in your large project one by one. You'll likely find one layer that creates this 70sec(?!) delay in getting search results. When you find that layer, let us know, there might be another issue that could be addressed on the QGIS side of things. |
GIF time:
![Peek 2020-08-01 12-54](https://user-images.githubusercontent.com/1728657/89095257-60f05480-d3f6-11ea-9f7e-aaeb2008e688.gif)
This PR adds the capability to type and go to a given coordinate through QField's search bar. Accepted coordinates:
The parsing of numbers is locale aware, allowing users to use their language's decimal and thousand separators.