GPX file to WME permalink

Hello, I need help for creating a script that would turn a GPX file into a WME permalink list of segments (3 km long each).

This is to help my closer team in the creation of event dynamiques closures.

Can anyone do this for us?
Thank you so much.

Good initiative, it would greatly facilitate our work, and would be a phenomenal time saving.
Thank you.

hello, it would be a big advantage indeed for those who manage the MTE ! :wink:

This should be do-able. Can you post an example GPX file?

Edit: Misspoke. The .gpx file format is the export files from some mapping programs. The one I use that exports it is ExpertGPS. Sorry for early post.

Yes, I know, but that doesn’t give us an example file to use for writing a script to do what was asked :wink:

I edited my above post. Sorry, I misspoke. I use that program (above) to download from my Garmin, then it exports the .GPX formatted file for use on their maps, and I’m guessing other programs. I can send you a fairly short one as an example.

First, thank you very much JustinS83 for taking the time to look at our request.

You can find here an example of how we use our dynamic closures file with Google sheet.

We need the permalink length (3km max) and the URL. The length used to define (with a formula) a dynamic closure throughout the race. Then the closures are applied with the Advanced Closures script (that you know well) and a .csv file.

We are currently using the GPX file with the script WME Geometries and manually enter the permalink and their length in the red boxes in the example.

The idea would be to have a list generated from the GPX file of length and permalink that we could copy and paste on our sheets. Then a verification of the permalink will be done manually, one by one, to close the perpendicular roads.

It must be said that to copy permalink is not very exciting, if a simple script could get rid of this task, the French Team Closures would be happy.

I remain available if there are questions

Thank you

Thank you for the examples!

I have limited time due to two new projects that I have started but I will work with an editor that is looking to get more into scripting to get this project started. We will update you with any progress!

Hello.

I don’t know how to code, but I may suggest some hints for a step by step that couldn’t be the easiest way, but could work using parts of other scripts:

  • The script does some math to cut approximatively the GPX into 3km portions of coordinates (relation between coordinates and length should be “easy”), then for each portion :
  • Have the script go automatically in center of portion in zoom 4
  • Using bricks of code from script Street to River Plus, generate a zone of 5 or 8m width (beware, this script have a limit of nodes that can generate the river area place)
  • With the bricks of code of Toolbox’s function “Select in area place or map comment”, get roads selected (the prompt box “Do you want to select in large mode (including segments only partially in the area)?” could be avoided by asking for it with a checkbox in this new script).
  • Copy the permalink in a table that can be exported to csv in the end

I hope this could help.

Caart

Maybe we can allow the user to change the zoom level and permalink length before the script cuts the GPX.

I say this because I’m on a 13" screen and I have to work with a 50% zoom in google for the creation of permalink and then the zoom of permalink is very often at 2 or 3

Thank you.

The problem is that the GPX file contains paths that are much, much, much larger than the screen, so it would take traversing the map along the GPX file’s path and finding the segments that are closest to the path supplied by the file and adding them to the PL, while checking that you are not exceeding the maximum length and attempting to add the segments in some sort of contiguous order.

I didn’t express myself well.

I thought about the zoom level in the permalink link created by the script.
At zoom 5, on a 13 "screen, I never see the permalink completely.

The idea was that the user could choose the level of zoom that will be in the created link so that it works with its configuration. For me Chrome zoom at 50%.

But for the creation of different links from the GPX, as you say, it’s something else.

It’s just an idea, to see if it’s necessary.

Edit : Street need zoom 4 mini to be selected :frowning:

Is there a script developed in the recent years for this? I dont think the french team is doing all waze closure of the TdF by hand :wink: