Modify

Opened 3 years ago

Closed 15 months ago

Last modified 15 months ago

#4043 closed enhancement (fixed)

Have an 'upload prohibited' flag in .osm files

Reported by: Ldp Owned by: team
Priority: normal Component: Core
Version: latest Keywords: upload prohibit
Cc: skyper

Description (last modified by Don-vip)

While working with a few layers in JOSM, it's very easy to start an upload from the wrong layer. If you don't catch it right away, it would mean time lost to revert it, a spot of agony, and no matter the other destructive things that could occur to live OSM data.

I propose to add an upload prohibit flag to .osm files, so when JOSM loads one of them in a layer, and you try to upload, it refuses to do so.

For example: <osm version='0.6' upload='no'>

This prohibit status should also be settable on a layer, through the GUI, so one can protect oneself from inadvertently doing stupid things, and should then be written out when saving the layer.

This would also apply neatly to other test files around, like the osmarender test file.

Attachments (2)

patch1.diff (23.0 KB) - added by Don-vip 15 months ago.
patch2.diff (15.7 KB) - added by Don-vip 15 months ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 3 years ago by avar

This would be nice, fwiw this is how I hacked up a non-uploadable file:

bzcat ourfootprints-roads.osm.bz2 | perl -pe "s/ id='-(.*?)' / id='1000\$1' version='1000\$1' timestamp='2106-08-08T22:26:50Z' /; s/ ref='.(.*?)'/ ref='1000\$1'/" | bzip2 > ofp.osm.bz2

comment:2 Changed 2 years ago by framm

I think this is an important concept that we should indeed add to the OSM file format. I thought of a per-object flag, for example <node id="1" ... transient="yes" /> or so. Use cases include:

  • Utilities that generate a pseudo OSM format - like poly2osm or srtm2osm - would set the extra attribute to make sure that their output isn't accidentally uploaded.
  • Utilities that process OSM data in a lossy fashion - e.g. when saving with reduced coordinate precision (osmosis --write-bin) or truncating cut-in-half entities (osmosis --bb) - would also make use of the extra attribute. In the second case, only a fraction of objects in the file would actually have the flag.

To consider:

  • The flag might have to be evaluated in conjunction with the "source" attribute of the <osm> tag, as something downloaded from source A is of course not (usually) uploadable to source B.

comment:3 Changed 2 years ago by stoecker

There also must be a way to get rid of that flag when uploading is wanted.

comment:4 follow-up: Changed 2 years ago by bastiK

We generally trust the user, so this is more like a reminder: "Are you really sure you want to upload this? It could be a bad idea, because: ...".

Including a lengthy message for each object is not practical. If you use some kind of message id, this leads to more complicated file structure. So a single flag per file could be a simpler concept.

comment:5 Changed 18 months ago by simon04

Ticket #4732 has been marked as a duplicate of this ticket.

comment:6 Changed 15 months ago by Don-vip

Ticket #4922 has been marked as a duplicate of this ticket.

comment:7 Changed 15 months ago by skyper

  • Cc skyper added

Changed 15 months ago by Don-vip

comment:8 Changed 15 months ago by Don-vip

  • Description modified (diff)
  • Summary changed from Have an 'upload prohibited' flag in .osm files to [patch] Have an 'upload prohibited' flag in .osm files

Here's a first version of a patch adding this prohibit flag. The flag is called upload='true/false' in <osm> tag, with a default value set to true if absent. The flag is not just a warning but effectively blocks JOSM from uploading data from the concerned layer. There is nothing yet in the GUI allowing to toggle the flag, I'd like to hear your thoughts first on this subject, before continuing. I was thinking of introducing the flag toggle only in expert mode, in the layer contextual menu.

comment:9 in reply to: ↑ 4 Changed 15 months ago by simon04

I like the suggestion of bastiK in comment 4 to "bypass" the warning dialog when being sure to do a correct thing. In contrast, when having a config checkbox, this setting may be forgotten, and thus later warnings are not shown. The idea of this flag was to prohibit accidental uploads. Therefore IMO, there shouldn't be a way to disable this warning.

Changed 15 months ago by Don-vip

comment:10 Changed 15 months ago by Don-vip

OK, here's a second patch taking into account your comments and adding the GUI toggle.

comment:11 Changed 15 months ago by Don-vip

In 5025/josm:

see #4043 - Have an 'upload prohibited' flag in .osm files

comment:12 follow-up: Changed 15 months ago by Don-vip

  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from [patch] Have an 'upload prohibited' flag in .osm files to Have an 'upload prohibited' flag in .osm files

Feature is here. Just set data.layer.upload_discouragement.menu_item property to true to enable it in layer contextual menu.

comment:13 in reply to: ↑ 12 Changed 15 months ago by skyper

Replying to Don-vip:

Feature is here. Just set data.layer.upload_discouragement.menu_item property to true to enable it in layer contextual menu.

Thanks a lot. I can not wait to try it.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.