[Script] WME Validator 1.1.8 / 07.05.2015

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.

Moderator: Unholy

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.

Re: [Script] WME Validator 0.9.7 (BETA) / 08.04.2014

Postby berestovskyy » Wed Apr 09, 2014 5:03 pm

irowiki wrote:I must have missed this change, but the soft turns on minor roads being blue instead of yellow highlighting is throwing me off!

In 0.9.5 #40 'Soft turns' was split into #200 and #300 'Node A/B: Unconfirmed turn on minor road'. Some countries have extremely high number of unconfirmed turns, so those new checks are notes by default to draw more attention to primary roads. You can adjust the severity for US in localization pack.

pumrum wrote:I want to highlight segments that have an Alternate Street specified but no city.

For example, try to put into the template field:
Code: Select all
@@${altCity[0]}##${altStreet[0]}@@${altCity[1]}##${altStreet[1]}

And into RegExp field:
Code: Select all
/@@##[^@]/

Perhaps the code is not optimal, but I hope you got the idea. Let me know if we miss something in the template variables.
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Custom Checks Examples

Postby berestovskyy » Wed Apr 09, 2014 9:28 pm

Custom Checks Examples
Custom check is a powerful tool of WME Validator to highlight very specific map issues, not covered with built-in validations.

To set up a custom check in Validator click Settings->custom. There are two checks: green and blue. Each check has two fields: template and regular expression (RegExp).

Hover your mouse over the template field to get a tooltip with available variables. Validator substitutes those variables with segment's data and then tries to match that string over the RegExp. If the expanded template string matches the RegExp - Validator highlights the segment.

Template Variables
Most of the variables are self-explanatory.
Note: empty address fields expand to empty streets, i.e. if you set "None" next to city name, then template "#${city}#" for this segment will be expanded to "##"

Road type: variable ${typeRank} expands to:
1 for Runways
2 for Railroads
...
14 for Major Highways
15 for Freeways

Road direction: variable ${direction} expands to:
0 for Unknown direction
1 for A->B
2 for B->A
3 for Two-way segments


Regular Expressions (RegExp)
Regular expressions are patterns used to match character combinations in your expanded template. See the detailed description of regular expressions on MDN: link

Validator provides the following two extensions for regular expressions:
Debug RegExp. To debug your RegExp add letter D at the very beginning: D/^[a-z]/
Validator will print debug information to the JavaScript console (Ctrl+Shift+J), so you can see how template variables expand for the segments on the map.

Negate RegExp. Sometimes it's much easier to create a RegExp for a normal condition and then just negate the result. To do so, add an exclamation mark at the very beginning: !/ (St|Ave)$/


Easy Examples
To highlight streets with word North
Template: ${street}
RegExp: /North/

To highlight invalid (null) elevations
Template: ${elevation}
RegExp: /null/

To highlight segments with no state assigned
Template: ${state}
RexExp: /^$/

To highlight segments with a U-turn
Template: ${Uturn}
RexExp: /1/


Medium Examples
To highlight Ramps with non-ground elevation:
Template: ${typeRank}:${elevation}
RegExp: /12:[^0]/

To highlight Freeways which do not start with letter A
Template: ${typeRank}:${street}
RegExp: /15:[^A]/

To highlight streets named "U-Turn" in LA
Template: ${state}:${street}
RegExp: /Louisiana:U-Turn/

To highlight dead-end U-turns
Template: ${deadEnd}:${Uturn}
RegExp: /1:1/

To highlight the opposite: missing dead-end U-turns
Template: ${deadEnd}:${Uturn}
RegExp: /1:0/

New! To highlight Freeways or Major Highways in format 'Axx', 'Ixx' etc
Template: ${typeRank}:${street}
RegExp: /^(15|14):[a-z][0-9]/i

New! To search for segments shorter than 17m:
Template: ${length}
RegExp: /^([0-9]|1[0-6])$/

New! To mark dead-ends without U-turn:
Template: A${deadEndA}:${UturnA}:B${deadEndB}:${UturnB}
RegExp: /A1:0|B1:0/

New! To highlight more than 100m long unnamed drivable streets:
Template: ${drivable}:${street}:${length}
RegExp: /1::...+/


Advanced Examples
To highlight street name which ends in Cntr, or Exd etc (any case variant)
Template: ${street}
RegExp: / (Cntr|Exd|La|Plc|Rvr|Tnpk|Wy)$/i

To highlight segments that have an alt street specified but no city
Template: @@${altCity[0]}##${altStreet[0]}@@${altCity[1]}##${altStreet[1]}
RegExp: /@@##[^@]/

To highlight invalid abbreviations for Australian roads
Template: ${street}
RegExp: !/ (Ave|Blvd|Cl|Cres|Cct|Ct|Dr|Way|Line|Ln|Mtwy|Pde|Pl|Rd|St)$|^$/

To highlight lowercase street names for US (except S, N, W, E and to)
Template: ${street}
RegExp: /^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/

New! To highlight Freeways with no cardinal direction (NSEW)
Template: ${type}:${street}
RegExp: !/^[^3]| [NSEW]$/

New! City name abbreviation 'snt' should be lowercase and at the very beginning
Template: ${city}
RegExp: /(^|[ (])(?!^snt )[Ss][Nn][Tt]([ )]|$)/

New! To highlight segments if primary street name and one of the alt. names are the same
Template: #${street}#${altStreet[#]}#
RegExp: /(#.+)(?=#).*\1#/


See more examples in the "WME Validator localization for US" forum thread.
Last edited by berestovskyy on Fri Aug 08, 2014 11:34 pm, edited 15 times in total.
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.7 (BETA) / 08.04.2014

Postby berestovskyy » Thu Apr 10, 2014 4:12 pm

irowiki wrote:So how do you change the severity of a check? Tried using the localization file but nothing seemed to work.

Sorry, I misled you. Severity is not a per-country, but a per-language property, just like check title etc.

So at the moment you need to switch WME to Spanish, generate localization pack with translations and add the line:
Code: Select all
"200.severity": "warning",


I'm not sure why you need those notes as a warning, but I guess you'd like to hide all the notes. If so, please also consider the following option.

Click Search tab and in the "Reported as" field put the following:
Code: Select all
200,300,!note,*

Means to highlight/report #200, #300, skip other notes and highlight/report everything else.
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.7 (BETA) / 08.04.2014

Postby berestovskyy » Thu Apr 10, 2014 5:39 pm

irowiki wrote:I'm just used to having all soft turns highlighted in yellow

If you don't mind having them in green or blue, you can use a custom check:
Template: ${softTurns}
RegExp: /1/
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.7 (BETA) / 08.04.2014

Postby berestovskyy » Thu Apr 10, 2014 10:12 pm

No messages were lost in this thread:
In original post click F.A.Q. and then Custom checks

Also I'll add a direct link from Validator to that message in the next version.
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.8 (BETA) / 15.04.2014

Postby berestovskyy » Tue Apr 15, 2014 9:53 pm

15.04.2014 v0.9.8:
- Fixed #24 filtering in 'Reported as' field
- Fixed #173 'No space after abbreviation' for '11.'
- Fixed segment length for newly created segments
- Custom check severities are now warnings by default.
(sorry, I'm a bit busy these days, so a "real" fix will come in one of the next releases)

- Improved RegExp debug log
- Added a link to custom checks examples on the forum
- Fixed default regexps for #160-163

- CHECKS REVIEW:
Code: Select all
  Added new checks with params to validate city names:
    #190 'Lowercase city name' (merged #92)
    #191 'Incorrectly abbreviated city name'
    #192 'Unneeded spaces in city name' (merged #31)
    #193 'No space before/after abbreviation' (merged #33)
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.8 (BETA) / 15.04.2014

Postby berestovskyy » Wed Apr 16, 2014 10:02 am

pumrum wrote:There used to be an option to filter based on username - I see it's been removed (or perhaps hidden for non CMs)

Filter by username is available only for Country Managers and only in that countries. Due to privacy concerns, there are no plans to change this nor implement any editor identification for custom checks.

pumrum wrote:is it possible in the future to filter based on the object's Area Manager?

I'll have a look, but I'm not sure if it's even possible to implement.

Try to use "City name" filter in the search tab instead. You can list few city names in there, i.e:
Code: Select all
City, Another City, Town, etc
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.8 (BETA) / 15.04.2014

Postby berestovskyy » Wed Apr 16, 2014 5:03 pm

SuperDave1426 wrote:So I fail to see how this type of filtering would be a privacy concern issue.

Maybe I used the wrong term, but I would not like to see editors to lynch other editors using Validator.
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.8 (BETA) / 15.04.2014

Postby berestovskyy » Fri Apr 18, 2014 5:23 pm

pumrum wrote:I can't seem to find any info on the ${roundabout} template -- i've tried true, false, 1, 0, yes, no, roundabout... what can I regex on to highlight roundabouts?

The following works fine with me (highlights roundabout segments):
Template: ${roundabout}
RegExp: D/1/

You don't have to "guess". Just add D at the very beginning of RegExp (just like above), then open JS console (Ctrl+Shift+J) and check the debug log. Here is an example:
Code: Select all
WME Validator v0.9.8 debug log for segment 248090636, check #128:
1. Expand template: ${roundabout} -> 0
2. Match RegExp: /1/ -> null
=> skip the segment
WME Validator v0.9.8 debug log for segment 248091485, check #128:
1. Expand template: ${roundabout} -> 1
2. Match RegExp: /1/ -> ["1"]
=> REPORT the segment as #128 'User-defined custom check (green)'

So you can easily figure out that ${roundabout} expands to 0 or 1.
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

Re: [Script] WME Validator 0.9.8 (BETA) / 15.04.2014

Postby berestovskyy » Tue Apr 22, 2014 6:24 pm

ctpoole wrote:Is there some way to correct this behavior?

Unfortunately, once a node goes off-screen in WME, there is just a partial information available about the node.

I'll try to fix the issue, but excluding 'Unneeded node A/B' checks for segments with off-screen nodes seems to be the only way...
berestovskyy
Waze Global Champs
Waze Global Champs
 
Posts: 919
Joined: Fri Jul 15, 2011 1:50 pm
Has thanked: 235 times
Been thanked: 637 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users