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

I have a custom road network in shapefile format that contains two columns "source" and "target". These columns contain an id number referring to the start and end points of the lines. Using ogr2osm I converted this shapefile succesfully to .osm format. In order to make sure that the node id's in this .osm file correspond to the id's in the source and target columns from the shapefile, I used a translation.py file to accomplish this. However, opening the file in JOSM returns the following error:

Could not read file 'output.osm'. Error is: Missing attribute 'version' on OSM primitive with ID 16604. (at line 3, column 78). 157 bytes have been read

Does anyone have an idea how to prevent this from happening so that I can open and inspect the file in JOSM?

asked 02 Mar '21, 12:14

winecity's gravatar image

winecity
26335
accept rate: 0%

edited 02 Mar '21, 13:17

2

It would help to know where your file came from.

(02 Mar '21, 12:42) SK53 ♦

I updated my question, please have a look

(02 Mar '21, 13:18) winecity

Any OSM primitive (node, way, relation) needs to have these attributes:

  • id
  • uid
  • changeset
  • version
  • timestamp
  • user

If all you want is to open the file in JOSM, you can set uid, changeset, version, and user all to "1", and for timestamp you can put "2000-01-01T00:00:00Z". Maybe you can add that to one of the scripts you're massaging the data with anyway.

permanent link

answered 02 Mar '21, 14:08

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 02 Mar '21, 14:09

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:

×710
×622
×205

question asked: 02 Mar '21, 12:14

question was seen: 2,545 times

last updated: 02 Mar '21, 14:09

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