[Script] WME Straighten Up!

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 Straighten Up!

Postby dBsooner » Thu Aug 15, 2019 10:41 pm

WME Straighten Up! (WME SU!)

Version: 2019.08.26.01

Greasyfork: https://greasyfork.org/en/scripts/38834 ... aighten-up

Description: Straighten selected WME segment(s) by aligning along straight line between two end points and removing geometry nodes.

Developer(s): dBsooner through WazeDev. WazeDev owns the script and all information attached to it.

Special note: Due to the nature of this script, it will not work for editors rank 1 or 2.

Feature list:
  • Straighten selected segments so they are all in a perfectly straight line between the two endpoint junction nodes. This is done by moving the JNs between the endpoints to the nearest point on the vector line between the two endpoints.
  • All segments must be at least partially in the current view of the map.
  • Recommended to only select continuous segments and segments share at least one name in common.
  • Translatable into any supported WME language. (Calling anyone that wants to assist in translating... PM me.)
  • Safety checks for:
    • Segments with conflicting names.
    • Long junction node moves (when a JN would move a distance greater than 10m).
    • Micro doglegs (mDL) checks:
      • 1 segment selected: Will check for existence of a geometry node within 2 meters, on the selected segment only, of either junction node.
      • More than 1 segment selected: Will check for existence of a geometry node within 2 meters of all junction nodes on all segments connected to the junction node, regardless if the segments are in the selection or not. The reason is if the junction node is moved, it could affect the angle of a mDL on any segment, not just the segments selected.
    • Non-continuous selected segments (when selected segments don't form a continuous selection).
    • Sanity check (when you select more than 10 segments at once).
    Note: These safety checks can be controlled via settings to: Give a warning, give an error or give no warning or error.

Instructions:
  1. Select the starting segment.
  2. ALT+click the ending segment.
    Note: If the segments you wanted to straighten are not all selected, unselect the segmens and start over using CTRL+click to select each segment instead.
  3. Click "Straighten up!" button in the sidebar.

Changelog:
Code: Select all
2019.08.26.01: CHANGE: Added ru translation.
               CHANGE: Detect if selected segments are already straight.
2019.08.16.01: CHANGE: Enhance check for micro doglegs (mDL).
2019.08.15.01: NEW: Initial release.

History: I have worked with an author of a script that wasn't well known that would straighten segments by move nodes to a straight line along a vector between two other points. I took their original code and modified it to be quicker, more reliable and provide some additional features and safety measures.

Special thanks: jonny3D (and impulse200) for allowing me to fork his / their work to create this.

Screenshots:
[ img ] [ img ]
[ img ] [ img ]
Last edited by dBsooner on Tue Aug 27, 2019 3:38 pm, edited 2 times in total.
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 592
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 359 times
Been thanked: 313 times

Re: [Script] WME Straighten Up!

Postby SeveriorumPatrem » Thu Aug 15, 2019 11:07 pm

OK, this is a tremendous timesaving help, especially basemap cities with poorly aligned import segments! No more dragging one JN at a time working your way along.

Thank you!
[ img ][ img ][ img ][ img ]
The Grumpy Dad
The more I learn, the more I discover how much I don't know.
SeveriorumPatrem
Area Manager
Area Manager
 
Posts: 910
Joined: Thu Nov 19, 2015 11:05 pm
Location: SW Washington State
Has thanked: 505 times
Been thanked: 313 times

Re: [Script] WME Straighten Up!

Postby dBsooner » Fri Aug 16, 2019 3:09 am

I forgot to add that it also checks for micro dog legs (mDLs). If a geometry node exists within 2m of a JN, it gives you a warning. I need to add that as a setting override as well.
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 592
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 359 times
Been thanked: 313 times

Re: [Script] WME Straighten Up!

Postby Mvan231 » Fri Aug 16, 2019 10:39 am

I was just going to ask the advantage of this over just using the toolbox function, but I can see the benefit now.

Great work!


Sent from my iPhone using Tapatalk
- mvan231 (3)
GLR | Michigan Editor
Wazeopedia :lol: | Engineer :geek: | iOS user :)
Mvan231
 
Posts: 608
Joined: Tue Feb 11, 2014 3:05 pm
Location: Great Lakes Region / Michigan
Has thanked: 585 times
Been thanked: 80 times

Re: [Script] WME Straighten Up!

Postby jonny3D » Fri Aug 16, 2019 8:17 pm

Great work! Can you add the ability to select two unrelated segments and straight align all segments including all others between the selected ones without the need to select them all? So it would be easier to select only the initial and final segments of the street line.
jonny3D
 
Posts: 872
Joined: Wed Sep 19, 2012 5:38 am
Location: Russia, Cheboksary
Has thanked: 332 times
Been thanked: 447 times

Re: [Script] WME Straighten Up!

Postby dBsooner » Fri Aug 16, 2019 8:24 pm

jonny3D wrote:Great work! Can you add the ability to select two unrelated segments and straight align all segments including all others between the selected ones without the need to select them all? So it would be easier to select only the initial and final segments of the street line.


I could try. The problem will be we would have to rely on the routing server to determine what the "straight line" is between the two selected segments. Sometimes that ends up being not what we would expect to be. I'll give it some thought and see what I can come up with.
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 592
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 359 times
Been thanked: 313 times

Re: [Script] WME Straighten Up!

Postby jonny3D » Fri Aug 16, 2019 8:52 pm

dBsooner wrote:I could try. The problem will be we would have to rely on the routing server to determine what the "straight line" is between the two selected segments.

I apologize. What I wanted is already there – you need to select the initial segment and with Alt-button select the final one to select the part of the street between two points.
jonny3D
 
Posts: 872
Joined: Wed Sep 19, 2012 5:38 am
Location: Russia, Cheboksary
Has thanked: 332 times
Been thanked: 447 times

Re: [Script] WME Straighten Up!

Postby dBsooner » Fri Aug 16, 2019 11:34 pm

jonny3D wrote:
dBsooner wrote:I could try. The problem will be we would have to rely on the routing server to determine what the "straight line" is between the two selected segments.

I apologize. What I wanted is already there – you need to select the initial segment and with Alt-button select the final one to select the part of the street between two points.


Yep, that's the easiest way to do it. It is in the "help" documentation in the SU! sidepanel button. It's also in the text I sent to you to have translated to Russian.

Thank you again for everything!!
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 592
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 359 times
Been thanked: 313 times

Re: [Script] WME Straighten Up!

Postby dBsooner » Sat Aug 17, 2019 5:21 pm

2019.08.16.01 has been released!!
Code: Select all
2019.08.16.01: CHANGE: Enhance check for micro doglegs (mDL).


Instead of just checking for geometry nodes within 2 meters of the junction nodes along the selected segments, I changed to checking for them along ALL segments connected to the junction nodes.

Micro doglegs (mDL) checks:
  • 1 segment selected: Will check for existence of a geometry node within 2 meters, on the selected segment only, of either junction node.
  • More than 1 segment selected: Will check for existence of a geometry node within 2 meters of all junction nodes on all segments connected to the junction node, regardless if the segments are in the selection or not. The reason is if the junction node is moved, it could affect the angle of a mDL on any segment, not just the segments selected.
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 592
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 359 times
Been thanked: 313 times

Re: [Script] WME Straighten Up!

Postby andrcondon » Fri Aug 23, 2019 12:35 pm

Installing and checking out. It's already my favorite script!
Andrés Condón
andrcondon
[ img ] [ img ] [ img ] [ img ]
andrcondon
Map Editor - Level 6
Map Editor - Level 6
 
Posts: 240
Joined: Mon Jun 10, 2013 11:19 am
Has thanked: 93 times
Been thanked: 84 times

Next

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users

cron