OpenGeofiction

Editing OSM files outside of JOSM

Posted by Paxtar on 16 January 2016 in English (English)

Cleared entry.

Comment from histor on 16 January 2016 at 21:55

If you will only change little things (like names) - why not work with an browser-editor like Podlatch2 ?

Hide this comment

Comment from Paxtar on 16 January 2016 at 22:41

I just gave Potlatch a try, but it is slower than JOSM for trying to update names quickly. Moving around to locate items that need to be update results in a great deal of downloading.

Searching and replacing tagged text in a text editor would be much faster, but would only a good option if it does not cause problems with the OSM file.

Hide this comment

Comment from Luciano on 17 January 2016 at 01:11

I have had frustrating experiences with trying to edit XML directly - because of the version/changeset issues you're addressing here.

There is, maybe, a better solution - there are plugins that allow spreadsheet-style editing of multiple values inside JOSM.

If you install utilplugins2

Luciano_screenshot_plugins_window

Then when you have multiple objects selected, you can open an "ad hoc" spreadsheet using "ctrl-T"... the top left of this "edit tags" window allows you to select what fields you want to edit. Then you can even cut-n-paste between traditional spreadsheets (I use openoffice) as long the columns line up. In the example below, I have been keeping information about the colonial names of Ardispherian places in a spreadsheet. I can select all the place nodes in a given area, and cut-n-paste between my spreadsheet and JOSM - as long as the node list matches up - but that works fine if you've populated your spreadsheet from JOSM in the first place, and haven't modified it in the meantime. Mostly these days I just use the spreadsheet for "staging" and make sure the "official" data is always the set in JOSM.

Luciano_screenshot_edit_tags_window

Hide this comment

Comment from Luciano on 17 January 2016 at 01:15

And I'm still making typos... for first image, try this link instead:

http://opengeofiction.net/wiki/index.php/File:Luciano_screenshot_plugin_window.png

Hide this comment

Comment from Paxtar on 17 January 2016 at 04:35

I wasn't aware of that function, and gave it a try. Unfortunately I'm unable to paste multiple entries simultaneously--all the information ends up in the same cell. I tried from Excel, and also from a text editor.

It is still faster than editing each item one at a time, and less risky than editing the XML file, so I'll use that method. Thank you!

I have a second purpose in mind for editing/creating an XML file directly. I've been (unsuccessfully so far) working on trying to generate a realistic height map for my territory, using simulated erosion. I ultimately want to use the height map data, primarily elevation and slope, modified with a climate overlay, to generate areas of wood, scrub, and grassland. I'd like to avoid tedious months of doing it manually, which is what I assumed you did with The Ardisphere until I noticed your ingenious shortcut.

If I get that far, I'm guessing that a fresh XML file/layer with only new nodes and areas would avoid messing up what's currently been mapped.

Hide this comment

Comment from Luciano on 17 January 2016 at 05:30

Well, my method involves pasting in vaguely fractal patterns of polygons, and then using JOSM filters to do a kind of brushstroke select across parts of it to get large areas of polygons set to a particular land cover type (scrub, forest, grassland, etc). It's still quite tedious - so far I've covered less than half the country. It's also quite data-intensive, because the individual polygons are quite small - less than 100 ha each. The huge advantage, however, is that it's VERY EASY to go back and change my mind and alter individual polygons or areas of polygons to match changed land cover ideas. As I move toward a more "historical" approach for mapping, this is a great feature - I can map small areas with, say, scrub, and then later come back and think - "OK, the polygons along this road convert from scrub to agriculture" ... etc. My intention is to work out the most efficient way to do this kind of historical mapping in Ardisphere as a kind of sandbox, and then take that method and apply it systematically to the country I originally meant to map: Mahhal.

As for the method you're talking about... I think there are some plugins in JOSM that permit import of CSV or other formatted data directly, to create new objects. See here:

http://wiki.openstreetmap.org/wiki/JOSM/Plugins/OpenData

It does seem there's some weird behavior with cut and paste from spreadsheets in the "Edit Tags" window - I just tried it again and it threw an exception error. It does say the plugin is in "alpha".

One workaround might be to use the data import utility mentioned above and import a newly made set of nodes with your corrections (with some additional temporary tag to identify them), and then use filters to delete the old ones.

In general, if I was trying to solve the problem you're discussing, I'd probably move in the direction of doing some custom coding using the JOSM scripting tool, rather than try to edit the XML file directly. I've become very comfortable using my python/perl scripts to EXTRACT data from .OSM (i.e. XML) files, but I'm not at all sure I understand the changeset/versioning stuff well enough to use those tools to implement updates to the XML data outside of a protective environment like JOSM.

Hide this comment

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

    [Text](URL)
  • Image

    ![Alt text](URL)

Login to leave a comment