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
[FEATURE][needs-docs] Add to Browser panel XYZ connection to provide default OpenStreetMap tiles #4352
Conversation
+1 to add some default there, -1 for way it's being done in this PR. We would only trigger addition of an OSM tile server upon profile creation. ATM this PR will re add the server if manually removed, or even simply renamed. Thanks for tackling this. It'll surely be appreciated by many users. |
Come to think of it. This kind of thing might be better as something in globel settings that @elpaso implemented. We should use that for any defaults that we want. Main issue is that can't be overriden by the user because it's in the install folder. @nirvn thoughts on that? initProfile or shipped as default in the package folder. |
Why not use same approach as in WMS/WFS dialogs? I mean "Add default servers" button which will add to the connection list some default servers. |
I would not hard code the server URL in the code but rather having a resource file on qgis.org with a list of default providers. (They would need internet anyway to use providers).
Gnome was using MapQuest provider last year in their map application. Then suddenly, MapQuest switched off his service. The application on Gnome Desktop was out of service too with a big 404 tile. We need to avoid this case in QGIS. |
I think the intention here is that these are always available (unless a user explicitly removes them), as opposed to the "opt-in" approach used by WMS/WFS dialogs. |
@alexbruy , what (I think) we agreed on in the mailing list is for OSM tiles to be available by default; The "add default servers" button method still requires someone to actually take action before those show up in the browser panel / source selection window. My suggestion here would actually be to remove this "add default servers" button once @NathanW2 's profile work lands, and add default WMS/WFS servers when creating a profile. @Gustry , IMO a list of XYZ tile servers on qgis.org can be useful (or even redirect to OSM's wiki page on that), but can't replace having a default server in the browser panel when users first launch QGIS. Using the main OSM tile server greatly reduces the chance of a mapquest situation happening. But this eventual "server going down" is yet another reason why we can't enforce an hardcoded name + url upon eveyr QGIS launch 😄 |
Thanks for the comments @nirvn, @nyalldawson, @NathanW2, @alexbruy and @Gustry. |
@NathanW2 , I would opt for the option that gives users the most freedom, including freedom to delete the server off his/her list of saved servers. |
@jgrocha the |
I forgot the link: https://github.com/qgis/QGIS/blob/master/src/core/qgssettings.h |
@elpaso Sorry for this basic question, but where do I add these kind of settings, out of the code? |
@jgrocha I think that @NathanW2 knows more about the new profiles support he's working on, I can speak for the
Global settings are optional and read-only, and are stored in an
The purpose of the global settings is to provide default values to the When a user saves a new setting value, it is stored in So, I think that the times are mature to create a On installation, the file should be placed in the appropriate folder in order to be automatically loaded by QGIS: |
Thanks @elpaso for the detailed explanation. I'll create this |
@jgrocha @elpaso would be great to use http://doc.qt.io/qt-5/qstandardpaths.html instead of (or between the env var and) |
@m-kuhn wrote:
Not sure I agree with using QStandardPaths for the packaged global settings. I do think that the following is appropriate for settings relative to what the QGIS project expects to be present with an install, i.e. similar to having the URLs, etc. still inline with source code:
After that, any further overrides, like on QStandardPaths, etc. can override those global settings and persist between reinstalls of QGIS. We certainly don't want to be clobbering any settings outside of the base QGIS install. Likewise, it's important that the global settings be a standard fallback, and always present, for those support instances where one asks a user to blow away all their override settings. Unless I misunderstand what you are saying about QStandardPaths. |
@dakcarto that's why I added the "(or between env var and)" part, this approach is perfectly fine for me as well. The one point which I'm still not sure how to handle it best is "Likewise, it's important that the global settings be a standard fallback, and always present, for those support instances where one asks a user to blow away all their override settings.". I remember a couple of occasions where
I think we can do better by
|
@m-kuhn http://doc.qt.io/qt-5/qstandardpaths.html#details it seems there are only user locations ( I believe that we should keep this simple, as implemented in |
@m-kuhn wrote:
Ah, now your comments make sense to me. Sorry about that.
This is the tricky one. On macOS, for example, that would be Ignoring what may be done with @NathanW2's profiles setup for a minute, what would be the advantage of using the above QStandardPaths over continuing to use
+1 on these points, especially the |
I should have profile stuff in by the end of the month so consider that in
any of your designs. Just need time to finish the final parts
…On Fri, 14 Apr 2017, 12:15 AM Larry Shaffer ***@***.***> wrote:
@m-kuhn <https://github.com/m-kuhn> wrote:
that's why I added the "(or between env var and)" part, this approach is
perfectly fine for me as well.
Ah, now your comments make sense to me. Sorry about that.
I think we can do better by
Using system standard locations
This is the tricky one. On macOS, for example, that would be
~/Library/Preferences/, as per QStandardPaths, but this is only where
QGIS.app settings have been stored. Pragmatically, ~/.qgis2|3/ is where
many other config items have been stored. Technically speaking, that folder
on macOS should be in ~/Library/Application Support/QGIS/<maybe version
here>, though that's a separate discussion.
Ignoring what may be done with @NathanW2 <https://github.com/NathanW2>'s
profiles setup for a minute, what would be the advantage of using the above
QStandardPaths over continuing to use ~/.qgis2|3/ at this point, other
than automatic searching of those directories?
Giving the user a qgis-settings.conf.template file that he needs to
manually copy to qgis-settings.conf in the very same folder. I think this
is a soft way to suggest keeping this file around as a backup for reference.
Writing down the paths where this file can/should be overridden in the
template.
Then we can still have an internal fallback one around somewhere in our
installation path.
+1 on these points, especially the .template one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4352 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAXS3H5V_pN9g2gG7IfZSm-YZF60jR6Kks5rvi3rgaJpZM4M5aJf>
.
|
My main points are
|
This PR is deprecated in favour of the new #5000. |
Description
This PR adds a default XYZ connection to the Browser panel. No layer is added to the map.
With this connection available, users can add the OpenStreetMap as a new layer with just one double click on it.
This feature was discusssed on the mailing list. The thread was started by @pcav.
The result is illustrated in the following screen shot:
UserAgent
The OpenStreetMap Tile Usage Policy regarding the use of a valid HTTP User-Agent identifying the application is respected. Even if the user changes the UserAgent in settings, the string QGIS/version is always added to the UserAgent defined. For this development version, the default userAgent string is
Mozilla/5.0 QGIS/2.99.0-Master
.XYZ requests to another server (running MapProxy under Apache) were logged to confirm the valid userAgent:
Unit test
I was not able to have QgsSettings filled with the settings on the unit test. I've wrote this initial unit test, but it should be improved once the QgsSettings usage is more stable.
Checklist
fixes #11111
in the commit message next to the description[FEATURE]
in the commit message[needs-docs]
in the commit message and containt sufficient information in the commit message to be documentedscripts/prepare-commit.sh
script before each commit