OSMBuilding icon indicating copy to clipboard operation
OSMBuilding copied to clipboard

Support render from .osm files

Open deevroman opened this issue 7 months ago • 4 comments

In fact, you need to replace the /map call with the contents of this file. And probably redo /relation/full, /way/full so that their contents are updated...

I'm thinking of adding something like &fromFile to prompt for a file selection dialog. After that, you just need to save the file from JOSM and reload the tab.

What do you think?

upd: We can go further and set the value, for example fromFile=https://overpass-api.de/api/interpreter?data=(node(50.746%2C7.154%2C50.748%2C7.157)%3Brel(bn)-%3E.x%3Bway(bn)%3Brel(bw)%3B)%3Bout%20meta%3B

или fromFile=localhost/path/to

https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example#More_complex_recursion

This is potentially useful because you can query the map state at any point in time from the past.

deevroman avatar Apr 26 '25 20:04 deevroman

I’m confused.

Can you kind of rewrite this more in a standard bug reporting format.

  1. What did you do?
  2. What was the result?
  3. What did you expect?
  4. How do they differ?
  5. Do you have a potential solution?
  6. what is it and why do you think this is the best fix?

If this is a feature request, explain why this is needed.

Beakerboy avatar Apr 27 '25 12:04 Beakerboy

Yes, this is a feature request. On the forum, you mentioned that you want to make a plugin for JOSM so that you can check your edits before submitting them.

The plugin is complicated, but JOSM allows you to save the current map state in .osm by pressing ctrl + S. I suggest that you support rendering data from files .osm, specifying the URL parameter. I will prepare a PR with Proof of Concept

deevroman avatar Apr 27 '25 13:04 deevroman

By the way, the idea of ​​the plugin with JOSM is implemented for indoor=. A button appears in JOSM, which, when clicked, opens [1] a URL containing the path to the .osm file. The plugin itself launches a simple web server on port 8432 [2]

[1] https://github.com/indoorequal/indoorequal-josm-plugin/blob/5f6e20a540dd69e38e267c3dbf3f092b2e1c5cd4/src/org/openstreetmap/josm/plugins/indoorequal/Action.java#L49

[2] https://github.com/indoorequal/indoorequal-josm-plugin/blob/5f6e20a540dd69e38e267c3dbf3f092b2e1c5cd4/src/org/openstreetmap/josm/plugins/indoorequal/IndoorEqualPlugin.java#L18

deevroman avatar May 05 '25 12:05 deevroman

Good news: I was able to extend the Remote Control capabilities in JOSM without writing a plugin. I think I'll be able to offer a patch in JOSM soon.

https://github.com/user-attachments/assets/c88b68a3-2754-4157-a08e-cfe2cdab2716

deevroman avatar May 07 '25 12:05 deevroman

Starting in JOSM 19425 now it is possible to export data 🚀

All you need to do is enable Remote Control and the Export data from JOSM checkbox in the JOSM settings, and then add it to the URL &fromFile=http://localhost:8111/export

Image

You can also use the Utilsplugin2 plugin to add a link to open the viewer: https://beakerboy.github.io/OSMBuilding/index.html?type={#type}&id={#id}&fromFile=http://localhost:8111/export

deevroman avatar Jul 13 '25 13:07 deevroman