Modify

Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#4043 closed enhancement (fixed)

Have an 'upload prohibited' flag in .osm files

Reported by: Ldp Owned by: team
Priority: normal Milestone:
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 12 years ago.
patch2.diff (15.7 KB ) - added by Don-vip 12 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by avarab@…, 14 years ago

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 by framm, 13 years ago

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 by stoecker, 13 years ago

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

comment:4 by bastiK, 13 years ago

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 by simon04, 12 years ago

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

comment:6 by Don-vip, 12 years ago

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

comment:7 by skyper, 12 years ago

Cc: skyper added

by Don-vip, 12 years ago

Attachment: patch1.diff added

comment:8 by Don-vip, 12 years ago

Description: modified (diff)
Summary: Have an 'upload prohibited' flag in .osm files[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.

in reply to:  4 comment:9 by simon04, 12 years ago

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.

by Don-vip, 12 years ago

Attachment: patch2.diff added

comment:10 by Don-vip, 12 years ago

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

comment:11 by Don-vip, 12 years ago

In 5025/josm:

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

comment:12 by Don-vip, 12 years ago

Resolution: fixed
Status: newclosed
Summary: [patch] Have an 'upload prohibited' flag in .osm filesHave 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.

in reply to:  12 comment:13 by skyper, 12 years ago

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.