﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
24385	[PATCH] New Remote Control сommand: export data	TrickyFoxy	team	"I suggest endpoint `localhost:8111/export`, to get the data of the active data layer.

In fact, the [https://github.com/indoorequal/indoorequal-josm-plugin indoor= JOSM plugin ] tried to solve this problem for itself. All it does is provide data from the active layer when accessing the `http://localhost:8432/indoorequal.osm` and adds a button to open `https://indoorequal.org/#url=http://localhost:8432/indoorequal.osm`. However, the [https://github.com/indoorequal/indoorequal-josm-plugin/blob/5f6e20a540dd69e38e267c3dbf3f092b2e1c5cd4/src/org/openstreetmap/josm/plugins/indoorequal/Action.java#L49 implementation] uses a temporary file and requires clicking a button to export fresh data.


Another use I see is when editing buildings in 3D, to check the render before uploading the data to OSM. The [https://github.com/Beakerboy/OSMBuilding OSM Building Viewer] also has the ability to preview the `.osm` file or via a URL. A PoC video using the current patch is [https://github.com/Beakerboy/OSMBuilding/issues/86#issuecomment-2858485032 on GitHub]

I think other applications can be found, from live rendering of tiles/router, to edit validators.

---

1. This API is disabled by default.
2. Export is quite fast, I think applications can allow you to frequently poll this endpoint without being afraid to block editing in JOSM. In extreme cases, web applications can check whether the browser window is in focus.
3. I think the `.osm` format will be enough, but if necessary, it will be easy to add parameters to the request.
4. Export occurs only if the active layer is OsmDataLayer.

Bonus: I fixed the calculation of `Content-Length` for the response. Now it contains the correct length if there are unicode characters in the response.
"	enhancement	closed	normal	25.08	Core remotecontrol		fixed		
