Get a sneak peek at whats next for Permanent Hazards on our April 7th Office Hours!
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.

Locked
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 Closest Segment

Post by
——— ——— ——— ——— ——— ——— ——— ——— ———
MOD NOTE – MOD NOTE – MOD NOTE

Note 2. JustinS83 added the functionality of this script to WME Place Interface Enhancements. He will no longer work on the fork he created in note 1.

Note 1. Due to the original script author's absence, please get the forked version of the script from this here link.

THANK YOU!
edited by sketch – 2 Mar 2017
edited by carloslaso – 13 Jul 2017
——— ——— ——— ——— ——— ——— ——— ——— ———


Description:
WME Closest Segment helps you determine the closest segment to the navigation stop point of a place. A line is drawn from a selected place (for point places) or its navigation point (for area places) to the nearest segment.

Current version: 1.00

Installation:
Use Greasemonkey (Firefox) or Tampermonkey (Chrome) and get the script here.

To use:
The line to the closest segment will appear on the map when a place is selected/moved. To disable the line, disable the "Closest Segment" layer in the layer selector or press Ctrl+Shift+C.

For best results, make sure you can see the segments on all sides of the navigation stop point on the map. If the navigation stop point is at the edge of the map, the line will be drawn to the closest segment in the visible map area but the actual closest segment could be outside of the visible map area.

Please report bugs, feature requests, or other issues. Known issues and development goals can be seen here.

Change log:
  • v1.00
    • Ignores pedestrian boardwalk, stairways, runways, and railroads when finding the closest segment.
  • v0.93
    • Bug fix: line no longer drawn outside of map area
    • Bug fix: editing house numbers now works correctly with this script enabled
  • v0.92
    • Quick fix for last version which broke the script in Firefox
    • Improved finding nearest segment
  • v0.91:
    • Changed the line and point styles
    • Added ctrl-shift-c as keyboard shortcut
  • v0.9: Performance improvements
  • v0.8: First release

POSTER_ID:16875504

1

Send a message
Last edited by SAR85 on Sun Jul 19, 2015 12:03 am, edited 5 times in total.

Post by Bmtg
Hey SAR85, cool script. I've noticed that it will snap to railroads and other non-routing segments if they are closest. Any way to exclude those types? Thx!
Bmtg
Area Manager
Area Manager
Posts: 1075
Has thanked: 463 times
Been thanked: 158 times
Send a message
Waze Southeast specific Links (Alabama, Florida, Georgia)
Southeast Wiki
Southeast Discord server

Post by Bmtg
Apologies, somehow I missed the second and third pages of the discussion. Doh.
Bmtg
Area Manager
Area Manager
Posts: 1075
Has thanked: 463 times
Been thanked: 158 times
Send a message
Waze Southeast specific Links (Alabama, Florida, Georgia)
Southeast Wiki
Southeast Discord server

Post by carloslaso
G_W1Z wrote:
dspille wrote:
G_W1Z wrote:This script disrupts edits for AP's.
Have you considered using WME PIE, which has now incorporated the CS functionality (and improved upon it)?
I have PIE installed and use it. I just wanted to pass along my experience in case it was considered a bug worth squashing.
Like dspille said, it would be better if you continue using WME Place Interface Enhancements (WME PIE).

This script is not being worked on at the moment. I'll lock this thread and I will reopen it when/if the original developer comes back.

More info.
carloslaso
Waze Global Champs
Waze Global Champs
Posts: 3299
Answers: 1
Has thanked: 729 times
Been thanked: 1225 times
Send a message

Coordinador de Comunidad en México / Foro MX
Supervisor Noroeste México

iPhone 15 Pro Max / iOS 17ß / Waze ß 4.x

Post by davielde
Nice work!

Aesthetically, I really like the stroke color matching WME, at least for point Places. I'm kind of up in the air about it though when looking at an area Place. It may be better to differentiate more between your closest segment line and area outline--if not by color then perhaps by stroke width?



Second thing is something that I would recommend after having coded the Measurement Tool for Toolbox. I noticed that you are using distanceTo between two points. In most cases, it probably would not make a difference, especially with smaller distances. With the spherical mercator map projection, however, it would be more appropriate to get the geodesic length, which is available if you first create a linestring between the two points. Here's some sample code from Toolbox:

Code: Select all

var line = new OpenLayers.Geometry.LineString([array containing your two OL.Geometry.Point(s)]);
var measureDistance = line.getGeodesicLength(Waze.map.getProjectionObject());
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by davielde
Suggestion retracted! ;)
davielde
Posts: 1219
Has thanked: 454 times
Been thanked: 735 times
Send a message
https://www.waze.com/wiki/images/6/69/W ... 00k_5c.png
CM: USA
SM: Michigan, Vermont
AM: Ann Arbor, MI & Thunder Bay, ON
WME Michigan

Post by dspille
I may have identified a possible issue with this script and the new entry points for PP venues feature in today's WME Version v1.35-7 release. With WME Closest Segment running, any changes to the venue entry point do not result in a change so you can press the save button. The new feature works properly if I disable this script. I'm running version 1.0.2.9.
dspille
Country Manager
Country Manager
Posts: 416
Has thanked: 477 times
Been thanked: 139 times
Send a message

Post by dspille
Thanks, JustinS83. That worked. I did restart my browser and disabled and re-enabled scripts one by one, but I didn't think to force an update, which is why I posted here. That would have definitely saved some time and trouble.
dspille
Country Manager
Country Manager
Posts: 416
Has thanked: 477 times
Been thanked: 139 times
Send a message

Post by dspille
G_W1Z wrote:This script disrupts edits for AP's.
Have you considered using WME PIE, which has now incorporated the CS functionality (and improved upon it)?
dspille
Country Manager
Country Manager
Posts: 416
Has thanked: 477 times
Been thanked: 139 times
Send a message

Post by Fredo-p
Stop point location shifts depending on how much of the area is show. This is on version 0.93.

When the place only has part of it shown, it snaps to the closest segment available.
place point ofset 01.jpg
(146.69 KiB) Downloaded 1593 times

When the place is centered in the map, it snaps to the correct, assuming it's the correct, location of the true stop point.
place point offset 02.jpg
(191.99 KiB) Downloaded 1585 times
Fredo-p
Posts: 2008
Has thanked: 240 times
Been thanked: 522 times
Send a message

Arizona Wiki | @Waze_Arizona Twitter
Verizon Samsung Galaxy S8+

Post by G_W1Z
First time using the script. It is nice. Thanks for your time put towards it!
G_W1Z
State Manager
State Manager
Posts: 1124
Answers: 1
Has thanked: 2022 times
Been thanked: 433 times
Send a message
G_W1Z
Pennsylvania SM | New Jersey LAM | District of Columbia & Maine AM
USA Regions: NOR, MAR, NER
A phoenix out of the ashes...together building a more perfect map.
» Waze Etiquette | PA Wiki | Glossary | Places | Lanes | Shields | JSG | Scripts «
https://storage.googleapis.com/wazeoped ... anager.pnghttps://j.mp/2X2TtcVhttps://www.dropbox.com/s/3o2pi4wjn6w1s ... .jpg?raw=1https://www.dropbox.com/scl/fi/yezyes6g ... 0rem&raw=1