openbenches.org icon indicating copy to clipboard operation
openbenches.org copied to clipboard

Creating a GPX file of benches in a certain area to avoid duplicate recording

Open jrbray1 opened this issue 4 years ago • 4 comments

When I go out benching, I don't want to use the full web-gui on my phone, but would like to see what benches have already been recorded. Would it be possible to allow a user to chose an area on a map (either using a bounding box or a radius) and get a GPX file with the co-ordinates of the benches. Only the text descriptions would be needed. I could then put that on my mapping app, and see at a glance whether a bench needed to be recorded.

I see you have a API call to get benches by area, but its hard-wired 20 item limit makes it unworkable for even a day's wandering.

jrbray1 avatar Apr 24 '21 06:04 jrbray1

I've updated the API to take a results parameter.

https://openbenches.org/api/v1.0/data.json/?latitude=51.234&longitude=-1.234&radius=20&format=raw&results=100

That will get you as many results as you want within a radius.

I'm unfamiliar with how GPX works - but I can add it. Would you just like every bench added as a waypoint?

edent avatar Apr 25 '21 15:04 edent

Thanks for doing that. I'm no expert on GPX, but using https://l-36.com/waypoints.php it seems a minimal GPX with waypoints and not tracks that works fine in OSMAnd on my phone is:

<gpx version="1.1" creator="L-36.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" > Bench 1 Waypoint Bench 2 Waypoint Bench 3 Waypoint Bench 4 Waypoint Bench 5 Waypoint

Perhaps you could output as that?

jrbray1 avatar Apr 25 '21 16:04 jrbray1

Bother

<?xml version="1.0" encoding="utf-8"?> <gpx version="1.1" creator="L-36.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" > <wpt lat="51" lon="0"> <name>Bench 1</name> <sym>Waypoint</sym> </wpt> <wpt lat="51.1" lon="0.1"> <name>Bench 2</name> <sym>Waypoint</sym> </wpt> <wpt lat="51.2" lon="0.2"> <name>Bench 3</name> <sym>Waypoint</sym> </wpt> <wpt lat="51.3" lon="0.3"> <name>Bench 4</name> <sym>Waypoint</sym> </wpt> <wpt lat="51.4" lon="0.4"> <name>Bench 5</name> <sym>Waypoint</sym> </wpt> </gpx>

jrbray1 avatar Apr 25 '21 16:04 jrbray1

Bother bother. If you go to the site you can create a file and see where the line breaks are :-)

jrbray1 avatar Apr 25 '21 16:04 jrbray1

Barely two years later and GPX now works.

https://openbenches.org/api/nearest/gpx/?latitude=52.6&longitude=1.24&distance=20

I tried it on https://gpx.studio/ and everything seems to pop up as planned.

Let me know if you need any extra bits adding to it.

edent avatar May 23 '23 11:05 edent

I had a quick go, and it looks very good. I'll try it when I next go benching

On Tue, 23 May 2023 at 12:57, Terence Eden @.***> wrote:

Closed #239 https://github.com/openbenches/openbenches.org/issues/239 as completed.

— Reply to this email directly, view it on GitHub https://github.com/openbenches/openbenches.org/issues/239#event-9315276404, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGE3HVJ2VGZII5URZFATEMTXHSQZFANCNFSM43PZQEIQ . You are receiving this because you authored the thread.Message ID: @.***>

jrbray1 avatar May 24 '23 18:05 jrbray1