[Script] WME Validator 1.1.20 / 03.11.2016

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

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 1.1.6 / 06.01.2015

Postby ispyisail » Wed Feb 25, 2015 6:41 am

I've decided that I only want this for "Street" and "Primary street"

Code: Select all
${typeRank}:${street}
/^(1|2):( [a-z])|[A-Z]{2}/


I know this example does not work

Any tips

Thanks
ispyisail
Waze Local Champs
Waze Local Champs
 
Posts: 3367
Joined: Tue Feb 21, 2012 11:59 pm
Location: New Zealand
Has thanked: 573 times
Been thanked: 554 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby PesachZ » Wed Feb 25, 2015 3:46 am

qwaletee wrote:The "hard" part of the second one is that we are looking for two things, either a lowercase at the beginning, ro a space and a lowercase anywhere. We can easily fix that by looking for both separately, but a trick is to put a space in front of your template, so that it is as if every name starts with a space.

So, for your first one, all you need is ("template"="regexp"): "${street}"="[A-Z]{2}" which says street name contains any capital letter somewhere followed immediately by any capital letter. It doesn't matter where in the string it occurs, regexp by default looks throughout.

For your second: " ${street}"=" [a-z]" - there is an space after each opening quote. Again, looks anywhere for a space followed by a lowercase, and since in the template we start with a space, that will include if it is at the beginning - Waze doesn't have a space there, but due to the template, t is the same thing.

Now we can combine the two:

" ${street}"="( [a-z])|([A-Z]{2})"

The parentheses make each statement stand by itself without interfering with the other. The bar | says "check for for or the other, either matches." I'm not sure if the parentheses are needed, I don't recall offhand whether the {2} will try to apply itself to the whole thing or not. I think it doesn't, but I'm lazy.

I have not tried any of the above, so I might have messed up somewhere, but give it a whirl.

*Edit: Note that the second expression in the regexp should NOT have a space before it, unless you want to limit reporting to cases where the two caps are the beginning of a word. For example "MaIN St" only matches as a problem if you leave the space out.

I believe the multiplier only applies to immediately preceding statement unless it is a group (in which case it applies to the entire group). So in the fila rule the second parenthesis after the bar is unnecessary.

Sent using Tapatalk for Android 4.4.2
PesachZ
Wiki Master
Wiki Master
 
Posts: 4431
Joined: Mon Jul 01, 2013 12:51 am
Location: NY, USA (also NJ sometimes) {GC} {ARC}
Has thanked: 1992 times
Been thanked: 2254 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby ispyisail » Mon Feb 23, 2015 11:16 pm

Question

We are looking at a map raid in Australia.

I would like to scan the assigned area with rules to create an errors file

Is it possible to export this file to a CSV file or similar to google docs from validator?

Thanks
ispyisail
Waze Local Champs
Waze Local Champs
 
Posts: 3367
Joined: Tue Feb 21, 2012 11:59 pm
Location: New Zealand
Has thanked: 573 times
Been thanked: 554 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby qwaletee » Mon Feb 23, 2015 10:06 pm

The "hard" part of the second one is that we are looking for two things, either a lowercase at the beginning, ro a space and a lowercase anywhere. We can easily fix that by looking for both separately, but a trick is to put a space in front of your template, so that it is as if every name starts with a space.

So, for your first one, all you need is ("template"="regexp"): "${street}"="[A-Z]{2}" which says street name contains any capital letter somewhere followed immediately by any capital letter. It doesn't matter where in the string it occurs, regexp by default looks throughout.

For your second: " ${street}"=" [a-z]" - there is an space after each opening quote. Again, looks anywhere for a space followed by a lowercase, and since in the template we start with a space, that will include if it is at the beginning - Waze doesn't have a space there, but due to the template, t is the same thing.

Now we can combine the two:

" ${street}"="( [a-z])|([A-Z]{2})"

The parentheses make each statement stand by itself without interfering with the other. The bar | says "check for for or the other, either matches." I'm not sure if the parentheses are needed, I don't recall offhand whether the {2} will try to apply itself to the whole thing or not. I think it doesn't, but I'm lazy.

I have not tried any of the above, so I might have messed up somewhere, but give it a whirl.

*Edit: Note that the second expression in the regexp should NOT have a space before it, unless you want to limit reporting to cases where the two caps are the beginning of a word. For example "MaIN St" only matches as a problem if you leave the space out.
qwaletee
US Waze Champs
US Waze Champs
 
Posts: 2911
Joined: Wed Feb 13, 2013 1:42 am
Location: NYC Metro - Active throughout NE^2 (Northeast & New England)
Has thanked: 231 times
Been thanked: 1120 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby ispyisail » Mon Feb 23, 2015 7:03 pm

Thanks guys

The first example seamed to work but after some thought how about this

I want to find any street name with 2 capital letters in a row

e.g.

SMith Rd
Smith RD
SmiTH Rd
sMIth RD
SMith-bob Rd
bob-bob RD

or even harder

Any street name that does not have a capital at the start and after any space

Smith Smith Smith Rd = Pass
Smith Smith Smith rd = Fail
Smith smith Smith Rd = Fail
etc

If the second example is possible don't worry about the first example
ispyisail
Waze Local Champs
Waze Local Champs
 
Posts: 3367
Joined: Tue Feb 21, 2012 11:59 pm
Location: New Zealand
Has thanked: 573 times
Been thanked: 554 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby SuperDave1426 » Mon Feb 23, 2015 5:56 pm

qwaletee wrote:The reason you get multiple segments types highlighted for /1/ is that it also matches /10/../19/ and /21/. You need to either use a matching separators before/after the template and expression, or use the explicit start/end codes in the expression.

I understand that. I simply included it for completeness, to show that it's working as expected for those types.

Oh, reading again - I didn't think about /1/ tripping a /21/ type as well. Ok, so then if I want type 1, I'll be sure to use /^1$/ instead to completely isolate it (I do *NIX, so I grok regexps :)). Thanks for that. However....

My concern is that using the rankType for Private Road, Dirt Road, and Parking Lot Road completely fail to highlight those types of road. That's really the bigger concern for me. :-)
SuperDave1426
Country Manager
Country Manager
 
Posts: 891
Joined: Wed Oct 16, 2013 5:27 pm
Location: Nevada, USA
Has thanked: 81 times
Been thanked: 260 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby PesachZ » Mon Feb 23, 2015 5:43 pm

qwaletee wrote:Note that [A-Z][A-Z]* is equivalent to [A-Z]+

* means 0 or more
+ means 1 or more

His code included a space in the second class [A-Z][A-Z ]* meaning starting with a capital, followed by any number of capitals or spaces.

Sent using Tapatalk for Android 4.4.2
PesachZ
Wiki Master
Wiki Master
 
Posts: 4431
Joined: Mon Jul 01, 2013 12:51 am
Location: NY, USA (also NJ sometimes) {GC} {ARC}
Has thanked: 1992 times
Been thanked: 2254 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby qwaletee » Mon Feb 23, 2015 5:38 pm

Note that [A-Z][A-Z]* is equivalent to [A-Z]+

* means 0 or more
+ means 1 or more
qwaletee
US Waze Champs
US Waze Champs
 
Posts: 2911
Joined: Wed Feb 13, 2013 1:42 am
Location: NYC Metro - Active throughout NE^2 (Northeast & New England)
Has thanked: 231 times
Been thanked: 1120 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby qwaletee » Mon Feb 23, 2015 5:37 pm

The reason you get multiple segments types highlighted for /1/ is that it also matches /10/../19/ and /21/. You need to either use a matching separators before/after the template and expression, or use the explicit start/end codes in the expression.
qwaletee
US Waze Champs
US Waze Champs
 
Posts: 2911
Joined: Wed Feb 13, 2013 1:42 am
Location: NYC Metro - Active throughout NE^2 (Northeast & New England)
Has thanked: 231 times
Been thanked: 1120 times

Re: [Script] WME Validator 1.1.6 / 06.01.2015

Postby ispyisail » Mon Feb 23, 2015 8:33 am

Thanks
ispyisail
Waze Local Champs
Waze Local Champs
 
Posts: 3367
Joined: Tue Feb 21, 2012 11:59 pm
Location: New Zealand
Has thanked: 573 times
Been thanked: 554 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: delawaredork, Google [Bot], MapOMatic, mudge42, ramblinwreck_81, RodeNinja, Yahoo [Bot]