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

[backport queued ltr][processing] Insure that processing algorithms are not used to breach the OSMF tile usage policy on bulk download #58982

Merged
merged 8 commits into from
Oct 10, 2024

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Oct 6, 2024

Description

Manual backport of #58550 and #58584 -- the idea here is to backport onto LTR as many changes as we deem acceptable to insure we are a good citizen towards OSMF and their tiling service.

@nirvn nirvn added the Backport Is a backport of another pull request label Oct 6, 2024
@github-actions github-actions bot added this to the 3.40.0 milestone Oct 6, 2024
…en exporting

the layer to file (both via the browser panel as well as the layer tree)
if ( totalTiles > MAXIMUM_OPENSTREETMAP_TILES_FETCH )
{
// Prevent bulk downloading of tiles from openstreetmap.org as per OSMF tile usage policy
feedback->pushWarning( QObject::tr( "Layer %1 will be skipped as the algorithm leads to bulk downloading behavior which is prohibited by the %2OpenStreetMap Foundation tile usage policy%3" ).arg( rasterLayer->name(), QString(), QString() ) );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the empty arguments used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson , ah, that's because I was trying to avoid creating a new translation string. On master, you can see how the same string is used both with and without HTML formatting when used with pushFormattedMessage: https://github.com/qgis/QGIS/blob/master/src/analysis/processing/qgsalgorithmrasterize.cpp#L203-L204

That function isn't available in 3.34, yet I was thinking it;d be better to stick to the same untranslated string.

if ( QgsMapLayerUtils::isOpenStreetMapLayer( layer ) )
{
// Prevent bulk downloading of tiles from openstreetmap.org as per OSMF tile usage policy
feedback->pushWarning( QObject::tr( "Layer %1 will be skipped as the algorithm leads to bulk downloading behavior which is prohibited by the %2OpenStreetMap Foundation tile usage policy%3" ).arg( layer->name(), QString(), QString() ) );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here -- why the empty static arguments?

@nirvn nirvn merged commit 342b046 into qgis:queued_ltr_backports Oct 10, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport Is a backport of another pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants