hauke96 / simple-task-manager

A simple tasking manager made for OpenStreetMap.
https://stm.hauke-stieler.de
Other
34 stars 6 forks source link

JOSM: Download data based on task geometry #155

Closed westnordost closed 2 years ago

westnordost commented 3 years ago

So STM supports importing task boundaries from geojson/overpass queries, which is a great feature! image

However, when pressing open in JOSM button, I only get the boundary and need to download myself. This is not that helpful, because

What would be great if STM automatically calculated the max bounding box for a task and supplied a URL to download exactly this data from. Maybe this could work easily with https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_polygon_.28poly.29

hauke96 commented 3 years ago

Unfortunately JOSM doesn't offer the possibility to specify a Overpass-query when calling via remote-control URL. A hack-around would be to generate an overpass-URL (like https://overpass-api.de/api/interpreter?data=%5Bout%3Ajson%5D%5Btimeout%3A25%5D%3B%0A........) and pass this over to JOSM like this: 127.0.0.1:8111/import?url=https://overpass-api.de/api/interpreter?data=........ This a) works as far as I just tried manually and b) is even mentioned in a discussion in the JOSM issue tracker, so it's nearly an official solution :smile:

It's maybe even possible to only download the data within the geometry of the task, so that only the data needed is downloaded.

westnordost commented 3 years ago

It's maybe even possible to only download the data within the geometry of the task, so that only the data needed is downloaded.

Yeah, that is what I am suggesting

hauke96 commented 2 years ago

I just deployed a new snapshot version on https://stm-test.hauke-stieler.de where this issue should be implemented. It would be great if you test it a bit to see if it works as expected.

westnordost commented 2 years ago

I tested it with the "Stammtisch Project", it works! Though, the tasks in the Stammtisch projects only consists of squares anyway, so can't say if it works correctly with any polygon

hauke96 commented 2 years ago

Thank, I also tested it a couple of times and it works pretty good so far.