Data downloaded from OSM XAPI won't open in Maperitive (or JOSM)

Hope this is the appropriate forum, though it is more about Maperitive - I have gotten the same issues when trying opening the file in question in JOSM to isolate the problem.

I suspect the problem here is that I’m missing something very basic, but I haven’t been able to find a solution by Googling - everything I see seems to assume that data downloaded from XAPI works fine with OSM-oriented programs like JOSM and Maperitive, and only describes how to get it working in various geodatabase formats.

I managed to use the following “url” to download data for the rivers in a section of Japan:

http://www.overpass-api.de/api/xapi?*[waterway=river][bbox=134.337998725683,33.8585831397029,137.340574446097,35.5293557214928]

So I’ve got the file, which can be opened in TextEdit or WordPad and is clearly an XML file containing the appropriate data.

I’d like to use it in Maperitive, but I keep getting errors. First was “Script execution error (line 1): The file type could not be recognized”. I tried adding the extensions “.xml” and “.osm” to the filename. The latter got the file type recognizable, apparently. However, I then got the following:

Script execution error (line 1): The file could not be loaded: Name
cannot begin with the ‘’ character, hexadecimal value 0xFFFD. Line 2,
position 19

Line 2 looks like this:

Position 19 is the space before “generator.”

Any ideas what’s behind this error and how to get Maperitive to accept the file?

Are those “typographic” quotation marks at “0.6” really in that file (instead of the common ")?

Hi,

I cannot reproduce this issue with the xapi-link you provided. Somehow your editor must have screwed up your file after the download.
Maybe try wget or some download manager, rename the file and open it straight in Maperitive.

They were - though I downloaded a new “clean” file to replicate the problem and they aren’t there (still getting the same problems though). Seems very bizarre to me.

I tried downloading a new file to test this and I’m having the same issues. I try to open the file, before ever opening or editing it in any way, and Maperitive still rejects it with the error message:

“Script execution error (line 1): The file type could not be recognized”

What would you suggest renaming the file to? Perhaps the extensions I attempted to add to it were not correct?

As Maperitive is closed-source, there’s really nothing we can do to help you out, except to recommend the respective Google Group: https://groups.google.com/forum/#!forum/maperitive