[Script] WME Advanced Closures

Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Moderators: Unholy, bextein, Glodenox, JustinS83

Forum rules
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

[Script] WME Advanced Closures

Postby dummyd2 » Sat Jun 18, 2016 3:51 pm

EDIT BY Popel22 - 25.02.2019

This version of the script is no longer maintained. The script has been given to the WazeDev group to maintain in d2's absence and the new version/thread can be found here: https://www.waze.com/forum/viewtopic.php?f=819&t=261114



Seb-D59 and I present a new script to add closures from a CSV file or recurrence rules.

Link greasyfork: https://greasyfork.org/scripts/20705-wm ... d-closures

The script adds a tab (slashed road) in the left panel, and a highlight on the map.

In the panel:
  1. a button "add advanced closure"
  2. a button "parse CSV" with a log console.

In the closure panel of a segments selection: a button "add advanced closure".

  1. Add advanced closure

    opens a window to generate recurrent closures.
    The window is draggable through its title. To reset the position, click again the button.

    • Range (start date and end date) is the time range on which all closures will apply. In other words, the script will not gereate closures before and after this range.
    • Start and duration:
      • start is the start time of the closure un a day
      • duration is the duration of the closure
    • Description: free text
    • Direction: on a multiple selection, it is the same direction as shown on the map.
    • Ignore traffic
    • (new in V1.1) MTE: MTE list of MTE loaded in WME and whose dates overlaps the defined range
    • Then, choose a tab:
      • Repeat:
        • Times: the closure count
        • Every: duration between the start date/time of a closure and the start date/time of the text closure
      • Each:
        day of the week of the start date/time (if the duration exceeds midnight, the end date/time will be the next day (or some days after), the closure will be applied even if the day of the closure end is not checked)
      • (new in V1.1) Holidays: holidays list based on holidayapi.com. You must select at least 1 segment before to detect the country, and then, click on "Refresh holidays". If your country is not supported, you can contribute to holidayapi.com. The country abbreviation in WME is not the same as holidayapi.com. So we may need to translate it in the code to get it work. Let us know!
    • The save tab allows you to save all presets but the range and MTE, and to load them.
      New in V1.1: closure details loaded from an existing closure: select 1 segment. If more than 1 segment is selected, closures a read from the first segment only.
    • Once all set correctly, the preview area will show all closures ready to apply. It shows error messages and an orange warning if a closure overlaps on an existing closure, and if a closure is not included in dates of the selected MTE (tooltiptext for details).
    • Select segments
    • The, apply. The preview will print OK or error messages. Before clicking on apply, choose the right tab (Repeat or Each). After the process, the script will select all segments and open the closure tab in the left panel.
    Cases studies:

    Every day from 12:00 to 14:00 between 13/06 and le 26/06 included
    range: 2016-06-13 -> 2016-06-26
    start: 12:00
    duration: 2:00
    Repeat: 500 times (the script will not create closure after the range end)
    Every: 24:00

    From monday to friday, from 20:00 to 06:00 the next day, from June to December:
    range: 2016-06-01 2016-12-31
    start: 20:00
    duration: 10:00
    Each: mon, tue, wed, thu, fri

  2. CSV

    apply closures defined in a CSV file.
    New in V1.1: added a column (requiered) MTE ID before 'comment'. Keep empty if no MTE.
    Code: Select all
    header,reason,start date (yyyy-mm-dd hh:mm),end date (yyyy-mm-dd hh:mm),direction (A to B|B to A|TWO WAY),ignore trafic (Yes|No),segment IDs (id1;id2;...),lon/lat (like in a permalink: lon=xxx&lat=yyy),zoom (2 to 10),MTE ID,comment (optional)
    add,"Closure test, by dummyd2","2016-05-27 00:00","2016-05-28 00:00","A to B",Yes,"297004533;297004532","lon=25.53629&lat=-76.47602",6,
    add,"Closure test 2, by dummyd2","2016-05-29 00:00","2016-05-30 00:00","B to A",No,"297004533;297004532","lon=25.53629&lat=-76.47602",6,,It's cold here...

    • If the fisrt column starts with 'add' or 'remove', it is processed by the script. (new in V1.1: remove is now supported)
    • Any other keyword is ignored, including 'header'.
    • The, the format is described in the header.
    • You must ensure that the map zoom is wide enough to "see" all segments. So, the same CSV can work fine on a screen with a big resolution and doesn't work on another computer with a lower resolution.
    1. Open CSV file
    2. The closure list will display under the button
    3. You can test segments: check all closures and click on "check segments". The script will simulate a map move on the lon/lat positions and zoom provided in the CSV, check if segments exists, if you have permissions to make closures on it, and warn you if your closure will overlap an existing closure.
    4. On each closure:
      • target will move the map and select segments (will not apply the closure)
      • the arrow -> will move the map and apply the closure (will not select segments)
    5. Click 'Apply' to apply all checked closures
    If texts are cut, see the tooltiptext
    A mini-log under each closure displays informations about the closure itself. The log under the list is global to all closures.

    BE CAREFUL: closures are applied on segments ONE BY ONE. This means the direction A->B (or B->A) is not always the one shown on WME when selecting multiple segments!
    So if you have more than one segment to close in one way, you may need to setup 2 closures: one with segments A->B, and another with segments B->A.

  3. Highlight
    Closures made by this script are identified by a non-breaking space added at the end of description. If so, the script adds a "road" icon on the map. This non-breaking space is invisible on the app.
Thanks to beta testers (Priso19, fafa114, JohnDoe75 and others).
Last edited by dummyd2 on Mon Jul 18, 2016 7:28 am, edited 3 times in total.
Dummyd2 AKA D2.
Retired - retraité de Waze
Posts: 1327
Joined: Wed Oct 23, 2013 12:01 pm
Location: Mentoring Bordeaux + CUB, Lot-et-Garonne
Has thanked: 329 times
Been thanked: 1124 times

Re: [Script] WME Advanced Closures

Postby JohnDoe75 » Sat Jun 18, 2016 4:33 pm

Thanks D2 can't wait to test it :mrgreen:
LC CM France
RM IDF - AM Paris France
AM Singapore
[ img ] [ img ]
Local Champ Mentor
Local Champ Mentor
Posts: 3814
Joined: Sun Dec 25, 2011 10:06 am
Location: Paris, France
Has thanked: 160 times
Been thanked: 831 times

Re: [Script] WME Advanced Closures

Postby vince1612 » Sat Jun 18, 2016 5:17 pm

Wow! Me too! This seems great :D

Thank you both!
[ img ]
Wiki & Forum: Wiki CH (D) (FR) | Forum CH (D) (FR) (I)
Website: waze-switzerland.ch | Facebook: Waze Switzerland
1+1=3 - The result of bringing talents together goes beyond simply adding them up.
Waze Global Champs
Waze Global Champs
Posts: 8241
Joined: Sun Mar 17, 2013 2:30 pm
Location: DACH Group (Germany, Austria, Switzerland)
Has thanked: 4965 times
Been thanked: 5238 times

Re: [Script] WME Advanced Closures

Postby arturoae » Sat Jun 18, 2016 5:18 pm

Posts: 889
Joined: Wed Mar 09, 2011 7:12 am
Has thanked: 651 times
Been thanked: 476 times

Re: [Script] WME Advanced Closures

Postby mincho77 » Sat Jun 18, 2016 5:24 pm

Amazing work!
Mauricio Otálvaro
[ img ]
Waze Global Champ/Country Manager/Mentor/Localizator/Beta Tester/First Responder Member
Email: mincho77@gmail.com
[ img ] [ img ][ img ]
[ img ]
Global Champ Mentor
Global Champ Mentor
Posts: 1092
Joined: Fri May 21, 2010 8:48 pm
Location: Medellín, Antioquia, Colombia
Has thanked: 788 times
Been thanked: 966 times

Re: [Script] WME Advanced Closures

Postby johnsninja58 » Sat Jun 18, 2016 6:41 pm

Looks great and could be really helpful for reoccurring events like baseball game closures
[ img ][ img ]
VT - State Manager
New England - Multi State Manager
Posts: 980
Joined: Thu Jul 23, 2015 4:05 am
Location: New England
Has thanked: 480 times
Been thanked: 497 times

Re: [Script] WME Advanced Closures

Postby shmupi » Sat Jun 18, 2016 6:47 pm

This is awesome !

Thanks !
Israel Coordinator & Community Leader & GC
Country Manager : Israel, Jordan, Thailand, Romania
Resolved Update Requests : 185K

[ img ]
Waze Global Champs
Waze Global Champs
Posts: 21034
Joined: Tue Jan 06, 2009 7:16 am
Has thanked: 6882 times
Been thanked: 2212 times

Re: [Script] WME Advanced Closures

Postby hmarian » Sat Jun 18, 2016 6:53 pm

This is fantastic. Will save me so much time with some manual closures. You are my hero of the day!

Device: Samsung Galaxy S8
Waze Version:
Country Manager: Canada
Area Manager: Greater Toronto Area, Buffalo (NY)
Android/WME Beta Tester
Editing Manual | Editing Best Practice | @Waze_Canada
Waze Global Champs
Waze Global Champs
Posts: 4247
Joined: Tue Sep 24, 2013 9:08 pm
Location: Toronto, Ontario, Canada
Has thanked: 284 times
Been thanked: 1807 times

Re: [Script] WME Advanced Closures

Postby hen20001 » Sat Jun 18, 2016 8:30 pm

Thank you very much,
dummyd2 + Seb-D59
Waze Local Champs
Waze Local Champs
Posts: 15966
Joined: Wed Aug 22, 2012 9:49 pm
Location: Northern Israel
Has thanked: 1914 times
Been thanked: 4489 times

Re: [Script] WME Advanced Closures

Postby carloslaso » Sat Jun 18, 2016 9:16 pm

OMG d2 & Seb-D59!!! Awesome!!! Thanks a lot!!!

[ img ]
[ img ][ img ]
Coordinador de Comunidad en México / Foro MX / Waze Status
Supervisor Noroeste México

iPhone 11 Pro Max / iOS 13ß / Waze ß 4.x
Global Champ Mentor
Global Champ Mentor
Posts: 3143
Joined: Fri Aug 20, 2010 1:30 am
Location: Sonora, Mexico
Has thanked: 1795 times
Been thanked: 2462 times


Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: bz2012, Ershad58, Mythdraug, n4dog