[josm-dev] Save OSM file without information about changed data

jamesmikedupont at googlemail.com jamesmikedupont at googlemail.com
Sun Dec 13 13:51:29 GMT 2009


This attached perl filter "purge.pl" will remove nodes marked a
deleted. you can extend it for ways as well.

usage :
perl purge.pl version2.osm > version21.osm

test :
mdupont at introspector-desktop:~/Desktop$ diff version2.osm version21.osm
2c2
< <osm version='0.6' generator='JOSM'>
---
> <osm version='0.6' generator='h4ck3rm1k3'>
1070d1069
<   <node id='587702957' action='delete'
timestamp='2009-12-12T14:09:26Z' uid='131059' user='h4ck3rm1k3'
visible='true' version='1' lat='36.5967337' lon='-93.5215472' />


mike

On Sun, Dec 13, 2009 at 2:34 PM, jamesmikedupont at googlemail.com
<jamesmikedupont at googlemail.com> wrote:
> On Sun, Dec 13, 2009 at 1:57 PM, Jonas Krückel <osm at jonas-krueckel.de> wrote:
>> Hi,
>>
>> I've loaded a local .osm file into JOSM and deleted some relations. Now I want to save this file, but without the information about what I have edited. I don't want to have the action= tags in the .osm file and I also don't want to have any id's changed etc. How can I save it this way? I'm going to process the file locally with other tools and therefore don't need and want this extra information.
>
> If you made the edits in josm then you will get the modified flags.
> you can just strip them out with a little command line magic.
>
> sed -e 's;action='delete';;g'  -e 's;action='modify';;g' test.osm
>
> that will strip out the delete and modify action.s from an osm file.
>
>
> mike
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: purge.pl
Type: application/x-perl
Size: 1005 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/josm-dev/attachments/20091213/e2de0679/attachment.bin>


More information about the josm-dev mailing list