Modify

Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#6653 closed defect (fixed)

osmChange file format no longer supported for import

Reported by: rickmastfan67 Owned by: team
Priority: major Milestone:
Component: Core Version: latest
Keywords: Cc:

Description (last modified by bastiK)

Alright, I have this older (from February) *.osm file that a friend made for me out of the 2010 TIGER data so I could use it to replace/fix/add roads to OSM where necessary locally.

Well, I had been able to open the file with no problems in JOSM up until recently. It last opened in r4264. Every release after that, it refuses to open. When I try to open it in r4272 or r4274, the following message shows up:

Could not read file 'TIGER2010_Allegheny_PA.osm'.
Error is:
Line 1 column 60: Unsupported version: 0.3 (at line 1, column 60)

Back in r4264 and previous versions, I did notice this when I opened the file in the CL:

Undefined element: 'osmChange' found in input stream. Skipping.
Undefined element: 'modify' found in input stream. Skipping.

But I didn't pay attention to it since it was "skipped".

Is this something that can be fixed in JOSM to have the file work again, or is there something I should fix in the osm file so that it can be loaded in JOSM versions later than r4264?

Attachments (1)

TIGER2010_Butler_PA.7z (1.7 MB ) - added by rickmastfan67 14 years ago.
2010 TIGER Data - Butler County, PA

Download all attachments as: .zip

Change History (25)

comment:1 by bastiK, 14 years ago

Can you attach the file?

comment:2 by rickmastfan67, 14 years ago

Alright, I'm attaching the Butler County 2010 TIGER file my buddy provided me. I would attach the Allegheny County one, but it's 115MB un-compressed, and only compresses down to 6.26MB (with 7-zip). However, the Butler County one compresses down to below 2MB, so I can attach it. It does the same thing as the Allegheny one; works in r4264; doesn't work in r4272 & r4274 and gives the same messages in the CL and inside of JOSM.

Last edited 14 years ago by rickmastfan67 (previous) (diff)

by rickmastfan67, 14 years ago

Attachment: TIGER2010_Butler_PA.7z added

2010 TIGER Data - Butler County, PA

comment:3 by rickmastfan67, 14 years ago

Also, I think [4268] might be the reason this is happening, since I do see "osmChange" mentioned in it.

in reply to:  3 ; comment:4 by bastiK, 14 years ago

Replying to rickmastfan67:

Also, I think [4268] might be the reason this is happening, since I do see "osmChange" mentioned in it.

Right, I think we never really supported import of osc files, it is more a coincidence that this works (or used to work).

Open your file in an editor and change the version from 0.3 to 0.6. JOSM is right to reject this outdated version, this is probably a problem of the generating software. If you open http://api.openstreetmap.org/api/0.6/changeset/98051/download, you'll get a osc file with correct version.

in reply to:  4 comment:5 by rickmastfan67, 14 years ago

Resolution: othersoftware
Status: newclosed

Replying to bastiK:

Open your file in an editor and change the version from 0.3 to 0.6. JOSM is right to reject this outdated version, this is probably a problem of the generating software. If you open http://api.openstreetmap.org/api/0.6/changeset/98051/download, you'll get a osc file with correct version.

That did the trick. The file(s) are now loading once again in JOSM r4277.

I've also directed my friend who originally created the files for me to this ticket. He might comment on it later, but I'll mark this as "othersoftware" right now.

comment:6 by rickmastfan67, 14 years ago

Description: modified (diff)

comment:7 by rickmastfan67, 13 years ago

Resolution: othersoftware
Status: closedreopened

I hate to have to reopen this, but the files are now no longer opening in JOSM. When I go to open said file, JOSM says "No data found in file (file location)".

What do you think this time could have broken the file? I'll try out several older JOSM copies I have to try to nail down when the files stopped working again. It does have the " osmChange version="0.6" " line in it, so it can't be that problem.

Will update this once I find the last version the files worked in.

comment:8 by rickmastfan67, 13 years ago

Alright, found the place where the file stopped loading in JOSM and giving the message above.

[4412] works
[4413] doesn't work

What do you think might be the problem?

comment:9 by Don-vip, 13 years ago

It's because of the unknown tag <modify>. Delete it, and it works again.

comment:10 by bastiK, 13 years ago

Summary: Recent change in JOSM has broken some older *.osm filesosmChange file format no longer supported for import

The osc format is different from the (j)osm file format. JOSM's osm parser used to be very lenient, and opened osc files by ignoring the create, modify and delete tags. The result is incorrect, but could be still useful.

We had reasons, to make the osm parser more strict. As a side affect, it won't accept the osmChange files any longer.

So we need a proper implementation of a osc importer.

in reply to:  9 comment:11 by rickmastfan67, 13 years ago

Resolution: othersoftware
Status: reopenedclosed

Replying to Don-vip:

It's because of the unknown tag <modify>. Delete it, and it works again.

:facepalm: That's for letting me know that. I deleted it and it's working again.

comment:12 by bastiK, 13 years ago

Resolution: othersoftware
Status: closedreopened

comment:13 by Don-vip, 13 years ago

In [4530/josm]:

see #6653 and #6960 - Allow JOSM to download osmChange files again

comment:14 by bastiK, 13 years ago

Description: modified (diff)

Thanks. Why not import deleted objects as deleted primitives? I think doNothing() could cause hiccup, when there are inner elements. Use jumpToEnd(false) instead?

in reply to:  14 comment:15 by Don-vip, 13 years ago

Replying to bastiK:

Thanks. Why not import deleted objects as deleted primitives? I think doNothing() could cause hiccup, when there are inner elements. Use jumpToEnd(false) instead?

Cause I just didn't have this bright idea :)

comment:16 by Don-vip, 13 years ago

In [4532/josm]:

see #6653 - Import <delete> primitives as deleted primitives

comment:17 by bastiK, 13 years ago

In [4533/josm]:

add importer for osmChange files (see #6653)

comment:18 by bastiK, 13 years ago

close ticket?

comment:19 by Don-vip, 13 years ago

EDIT: yes :)

Last edited 13 years ago by Don-vip (previous) (diff)

comment:20 by Don-vip, 13 years ago

Resolution: fixed
Status: reopenedclosed

comment:21 by rickmastfan67, 13 years ago

Resolution: fixed
Status: closedreopened

Hate to reopen this once again, but now the files will not open at all in [4537]. I had to go back to [4529] to open the files once again. Any suggestions on making a fix to the file to get them to open in [4537] again, or will another change in JOSM be needed to fix this?

When I do open the file in [4533] and later, I get this message from JOSM:

No data found in file <file location>.

Also, the following is showing up once again in the CL:

Undefined element: 'osmChange' found in input stream. Skipping.

Meanwhile, when I load the same file in [4529], that message doesn't show up in the CL and the file opens with no problems.

I was testing this with the same "TIGER2010_Butler_PA.osm" that's attached to this ticket with the file edited with the fixes mentioned in comment:4 and comment:9 being applied to the file.

comment:22 by bastiK, 13 years ago

Resolution: fixed
Status: reopenedclosed

change file extension to .osc

comment:23 by MikeN, 13 years ago

For the example of the attached file, the file extension cannot be simply changed to .osc. Apparently there is a mix of utilities and one of them used the 'wrong xml markup' per current JOSM.

Instead the file extension must be left as .osm and must be edited as follows:

  1. Change the first line from

<osmChange version="0.6" generator="TIGER abbrev expander">


to the following:

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='TIGER abbrev expander'>

  1. Change the last line from

</osmChange>

to

</osm>

Last edited 13 years ago by MikeN (previous) (diff)

in reply to:  23 comment:24 by bastiK, 13 years ago

Replying to MikeN:

For the example of the attached file, the file extension cannot be simply changed to .osc. Apparently there is a mix of utilities and one of them used the 'wrong xml markup' per current JOSM.

Instead the file extension must be left as .osm and must be edited as follows:

  1. Change the first line from

<osmChange version="0.6" generator="TIGER abbrev expander">


to the following:

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' generator='TIGER abbrev expander'>

  1. Change the last line from

</osmChange>

to

</osm>

and remove <modify> / </modify>.

The attached file is broken as a OsmChange file, because it creates new objects (negative id) in a <modify> section. If <modify> is changed to <create>, this could result in a valid .osc file (untested).

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.