Skip to content

Conversation

@cyrossignol
Copy link
Collaborator

This adds the ability to select an OSM XML file for import with the "Create Workspace from File" workflow. I used this while testing the output of the new SQL-based converter. It seems useful enough to keep around.

Signed-off-by: Cy Rossignol <cy@rossignols.me>
&& datasetFile.value instanceof File
&& datasetFile.value.name.endsWith('.zip')
&& (datasetFile.value.name.endsWith('.zip')
|| datasetFile.value.name.endsWith('.xml'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No .osm?

Copy link
Collaborator Author

@cyrossignol cyrossignol Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .osm extension is a little messy—OSM publishes the official planet file with the .osm extension, but other tools like JOSM may use the extension for both OSM XML and for changeset diffs (instead of .osc). We would need to peek the file to determine how to process it.

Though, I suppose the same issue exists with the .xml extension. Maybe we should shelve this until we have time to write out the validation logic.


async _run(data: Blob, workspace): Promise<number> {
if (workspace.type === 'osw') {
if (workspace.type === 'osw' && !isMimeXml(data.type)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a check for the mime type of a .zip file and display an error if the file is neither .zip or .xml vs. assuming anything not .xml is .zip?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that makes sense. Originally, this was "feed anything through to the converter, and let it complain if it doesn't support it", but it looks like the converter API's error messages are not helpful at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LMK if you wanna connect on wrapping this up!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(when you get back!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants