NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I'm not sure if this is the right place to ask this, but figured there are a lot of people around here that are familiar with JOSM, so it can't hurt to try.

I am copying a relation to another layer so I can cut the file size down of the data I'm importing. However, when I copy the relation, create a new layer and paste it, the relation's ways and nodes all have an id of 0. How can I copy the relation while saving the original ids? Thanks

asked 21 Oct '14, 03:02

chillNZ's gravatar image

chillNZ
76338
accept rate: 0%

edited 21 Oct '14, 22:41

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


When you copy nodes and/or relations, they are new objects (and therefore have temporary id 0 until they get assigned their definitive id after uploading). I don't think there's a way around that, but you could use other techniques:

  • Delete stuff you don't want from the current layer instead of copying stuff you want to a different layer. You might find the search function (Ctrl-F) helpfull for that.
  • Edit the *.osm file mannually (in a text editor, with tools like grep, or even with osm parsing libs) to remove the bits you don't want, instead of using josm.
permanent link

answered 21 Oct '14, 10:28

Vincent%20de%20Phily's gravatar image

Vincent de P... ♦
17.3k18152249
accept rate: 19%

2

Thanks, I had tried the deleting method but turns out JOSM doesn't like actually deleting the nodes and ways from the source file either. I understand why, but it means deleting the nodes does effectively nothing for me as the program I'm using still tries to parse the nodes with tag action=delete. After a bit of research I think I'll just use XMLStarlet to remove the deleted nodes from the file to reduce the import time.

(21 Oct '14, 21:58) chillNZ

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×622
×128

question asked: 21 Oct '14, 03:02

question was seen: 3,464 times

last updated: 21 Oct '14, 22:41

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum