[Script] FC Highlights

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.

[Script] FC Highlights

Postby bz2012 » Fri Jun 06, 2014 11:07 am

As I fight to convert areas from old mapping standard roads to FC mapping standards,
I was wondering how difficult it would be to 'recolor' the roads on the map so that
1) the colors 'match' the US FC maps colors for the equivalent types of WAZE map types.
objective: make the WAZE map, if properly configured, MATCH the FC map. That way, a quick glance at an area should show which segments need to be fixed.

2) optionally add 'grey scale density variations' to the 'white types' so that they are easy to distinguish from each other 'at a glance'.

Not sure if this would be best done as options in Color Highlights or a separate extension.
State Manager, Louisiana
bz2012
Map Raider
Map Raider
 
Posts: 1460
Joined: Wed Nov 23, 2011 4:32 pm
Location: Baton Rouge, La
Has thanked: 1109 times
Been thanked: 268 times

Re: [Script] WME Color Highlights - 1.81 Mar 2014

Postby sketch » Fri Jun 06, 2014 3:41 pm

bz2012 wrote:As I fight to convert areas from old mapping standard roads to FC mapping standards,
I was wondering how difficult it would be to 'recolor' the roads on the map so that
1) the colors 'match' the US FC maps colors for the equivalent types of WAZE map types.
objective: make the WAZE map, if properly configured, MATCH the FC map. That way, a quick glance at an area should show which segments need to be fixed.

There are 2 hurdles here:
  1. Each state uses its own color scheme.
  2. It would not account for US and state highways, although this could be programmed in for each state too.
Believe, though, that if I knew how to write one of these things, I would be all over this. :D
ALL US EDITORS READ: New USA road type guidance
new orleans based • detroit enthusiast • usa country manager
2017 chevrolet ss sedan 6mt • slipstream blue metallic
Image Image
sketch
Waze Global Champs
Waze Global Champs
 
Posts: 5782
Joined: Sat Aug 08, 2009 6:13 pm
Location: New Orleans, LA
Has thanked: 1351 times
Been thanked: 1846 times

Re: [Script] WME Color Highlights - 1.81 Mar 2014

Postby doctorkb » Sun Jun 08, 2014 10:13 pm

sketch wrote:
bz2012 wrote:As I fight to convert areas from old mapping standard roads to FC mapping standards,
I was wondering how difficult it would be to 'recolor' the roads on the map so that
1) the colors 'match' the US FC maps colors for the equivalent types of WAZE map types.
objective: make the WAZE map, if properly configured, MATCH the FC map. That way, a quick glance at an area should show which segments need to be fixed.

There are 2 hurdles here:
  1. Each state uses its own color scheme.
  2. It would not account for US and state highways, although this could be programmed in for each state too.
Believe, though, that if I knew how to write one of these things, I would be all over this. :D



Given sketch's comments, I'm not sure I'm ready to entirely take this on, but there are a couple caveats I'd mention before going further with it.

Highlights merely overlays a colour, with a degree of transparency. I don't believe we can recolour the roads -- though we might be able to put some colour overtop to get it close to the FC map colours. Alternatively, we don't set transparency, and it blocks out street names...

I'm also assuming you mean that it basically colours the Waze map to match the colour scheme on the FC map, let's start with one state -- if you get me the colours (in HTML #xxxxxx format), I can look at making something simple (it would be a separate script) that adds that overlay. Once we have it working for one state, we could look at expanding it out.
Waze Global Champ, Country Coordinator
Country Manager: Canada
Area Manager: Edmonton, AB; Prince George, BC; Maui, HI; Georgetown, KY and various places in between
doctorkb
Coordinators
Coordinators
 
Posts: 3993
Joined: Wed Nov 04, 2009 9:17 am
Location: Edmonton, Alberta, Canada
Has thanked: 615 times
Been thanked: 1599 times

Re: [Script] WME Color Highlights - 1.81 Mar 2014

Postby sketch » Mon Jun 09, 2014 4:02 pm

doctorkb wrote:Given sketch's comments, I'm not sure I'm ready to entirely take this on, but there are a couple caveats I'd mention before going further with it.

Highlights merely overlays a colour, with a degree of transparency. I don't believe we can recolour the roads -- though we might be able to put some colour overtop to get it close to the FC map colours. Alternatively, we don't set transparency, and it blocks out street names...

I'm also assuming you mean that it basically colours the Waze map to match the colour scheme on the FC map, let's start with one state -- if you get me the colours (in HTML #xxxxxx format), I can look at making something simple (it would be a separate script) that adds that overlay. Once we have it working for one state, we could look at expanding it out.

Oh, some other hurdles: it's not a 1:1 match from type to class; a Waze Freeway can be in FC either Interstate or Other Freeway, for example. Also, some states color rural classes differently than urban (others use the same colors, but dashed lines, which is no big deal).

Without further ado, here are the colors for two sample states – Louisiana and Michigan

Louisiana
Freeway: #007aff (Interstate) and #ffba00 (Fwy/Exp)
Major Highway: #ff3511 (Principal Arterial)
Minor Highway: #39ad00 (Minor Arterial)
Primary Street: #be3eec (Major Collector) and #ffff3e (Minor Collector)

Michigan
Freeway: #1474fb (Interstate) and #a821e3 (Other Freeway)
Major Highway: #f73723 (Other Principal Arterial)
Minor Highway: #885a46 (Minor Arterial)
Primary Street: #fda929 (Major Collector) and #3da61c (Minor Collector)

Not sure what to do about FW and PS; maybe two alternating colors?
ALL US EDITORS READ: New USA road type guidance
new orleans based • detroit enthusiast • usa country manager
2017 chevrolet ss sedan 6mt • slipstream blue metallic
Image Image
sketch
Waze Global Champs
Waze Global Champs
 
Posts: 5782
Joined: Sat Aug 08, 2009 6:13 pm
Location: New Orleans, LA
Has thanked: 1351 times
Been thanked: 1846 times

Re: [Script] FC Highlights

Postby doctorkb » Wed Jul 02, 2014 6:52 pm

I've not got anything productive to show for it, but I'm working on it. :)
Waze Global Champ, Country Coordinator
Country Manager: Canada
Area Manager: Edmonton, AB; Prince George, BC; Maui, HI; Georgetown, KY and various places in between
doctorkb
Coordinators
Coordinators
 
Posts: 3993
Joined: Wed Nov 04, 2009 9:17 am
Location: Edmonton, Alberta, Canada
Has thanked: 615 times
Been thanked: 1599 times

Re: [Script] FC Highlights

Postby tonestertm » Sun Aug 03, 2014 9:26 am

AdreNalinGuY wrote:How is the work going folks? Anything ready for beta testing or not? :D
There's a (mostly) unwritten rule in Developer forums that the best way to ask about progress is to not. :)

Sometimes it is considered acceptable to post something like, "Really looking forward to this" or some such. Remember, this is all volunteer labor. ;)
tonestertm
US Waze Champs
US Waze Champs
 
Posts: 1158
Joined: Wed Nov 14, 2012 12:02 pm
Location: City of...um, Angels, CA, USA
Has thanked: 479 times
Been thanked: 757 times

Re: [Script] FC Highlights

Postby taco909 » Sun Aug 03, 2014 9:12 pm

And time spent explaining the progress is time not spent coding ;)
-- Rich
ImageImageImage
taco909
Map Editor - Level 4
Map Editor - Level 4
 
Posts: 2230
Joined: Sun Jun 01, 2014 4:05 am
Location: Los Angeles Area
Has thanked: 720 times
Been thanked: 640 times

Re: [Script] FC Highlights

Postby Timbones » Tue Aug 05, 2014 12:56 am

The ideal solution would be to turn off the road layer, and draw your own using the FC colors. All the streets. And add street labels.

I don't know why Waze don't do this already...
Timbones(6) • UK Coordinator • Forum Moderator • Global Wiki Moderator • Routing Expert
Extensions: WME Colour HighlightsWME Route TesterWME Geometries
Timbones
Coordinators
Coordinators
 
Posts: 6647
Joined: Wed Feb 09, 2011 10:33 am
Location: York, UK
Has thanked: 957 times
Been thanked: 2584 times

Re: [Script] FC Highlights

Postby sketch » Tue Aug 05, 2014 4:20 am

Timbones wrote:The ideal solution would be to turn off the road layer, and draw your own using the FC colors. All the streets. And add street labels.

I don't know why Waze don't do this already...

Is WMECH open-source? I imagine it shouldn't be terribly difficult to modify it for this purpose. Not saying you should, of course, as it would be useless to you ;) But I wouldn't mind at least taking a look at it. I have very little idea what I'm doing, but I adapt quickly :D
ALL US EDITORS READ: New USA road type guidance
new orleans based • detroit enthusiast • usa country manager
2017 chevrolet ss sedan 6mt • slipstream blue metallic
Image Image
sketch
Waze Global Champs
Waze Global Champs
 
Posts: 5782
Joined: Sat Aug 08, 2009 6:13 pm
Location: New Orleans, LA
Has thanked: 1351 times
Been thanked: 1846 times

Re: [Script] FC Highlights

Postby Timbones » Tue Aug 05, 2014 11:02 am

There's no licence on my code, so you're free make a copy of it if you wish (as many other people have).

However, the way my script adds the colour is rather hacky and out-dated, as it modifies existing invisible line objects that WME created for hovering and selecting. The better (proper) method would be to create a completely new layer (which appears in the layer selection panel), and draw new line objects for all of your roads. This is how Validator highlights roads, which is much neater than my hacky method. (I looked at changing WMECH to use it's own layer, but it was too much work).

Have a look at my Route Checker script for some simple code that adds line objects to a layer.
There's a lot to do to make this script work for FC though:

  • Create a new OL.Layer.Vector during initialisation
  • Iterate through Waze.segments.objects and extract the geometry.components from each
  • Figure out the appropriate segment colour for the segment by reading attributes.roadType
  • Create a new OL.Geometry.LineString and add it to the layer
  • Add listeners for mergeend and zoomend events and add new segments to the layer
  • Add labels to some of the segments, but not all of them. Maybe based on length and zoom
Tip: explore the properties of an object by selecting something in the editor, and typing this line into the developer console. You'll want to look at the attributes and the geometry:

Code: Select all
Waze.selectionManager.selectedItems[0]

Hope that helps, somehow... :geek:
Timbones(6) • UK Coordinator • Forum Moderator • Global Wiki Moderator • Routing Expert
Extensions: WME Colour HighlightsWME Route TesterWME Geometries
Timbones
Coordinators
Coordinators
 
Posts: 6647
Joined: Wed Feb 09, 2011 10:33 am
Location: York, UK
Has thanked: 957 times
Been thanked: 2584 times

Next

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: abusimbel16, steveinark