[Script] WME US Government Boundaries

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, JustinS83, Glodenox

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 US Government Boundaries

Postby MapOMatic » Fri Apr 07, 2017 8:37 pm

... for now, you can still click on the zip code in the black header bar to be taken to the USPS website, which will show you the city name(s).
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Sun Apr 09, 2017 4:54 am

The USPS zip code city function has been restored in v0.4.6. You should see USPS city name next to the zip code in the black header bar again.

Thanks to XanderB for hosting the zip -> city lookup script on his site, and thanks to others for offering to do the same. Hopefully this time it won't get flagged as a suspicious site by antivirus services.
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Fri Dec 08, 2017 8:21 pm

Release v2017.12.08.001
- Adds a Counties layer
- Layers can be toggled on/off in the Layers menu.
- Adds a settings tab (USGB) where you can toggle dynamic positioning of labels (attempts to keep the labels centered on the visible portion of each boundary).
2017-12-08_15h20_21.png
(7.29 KiB) Downloaded 674 times
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Sat Jun 30, 2018 5:33 am

In version 2018.06.30.001, I've added an option to include the state abbreviation in county labels. You can disable it in the settings.
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Sat Nov 24, 2018 6:10 pm

SeveriorumPatrem wrote:This script has stopped working for me again. I have disabled all scripts except this one, deleted and reinstalled it (2018.08.18.001), disabled and re-enabled all of its options, bypassing the corporate network, and yet it is still not functioning and the error console is blank except for a recaptcha timeout.

What should I check next?

Apologies for the late reply. Did this fix itself or are you still having issues?
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Sat Dec 08, 2018 4:26 am

Some good discussion, and good finds. Honestly, the ZCTA thing is really just a guesstimate. Drawing ZIP code boundaries on a map will never be perfect since ZIP codes are defined by the routes driven, not polygons. The page russblau linked shows the routes (enter an address, and hover over the gray highlights on the roads), which is ideally what I'd like to draw on a map. If anyone has any suggestions on how to pull that data in...
https://eddm.usps.com/eddm/customer/routeSearch.action

Looking at that map, you can find scenarios all over the place where a section of road on a ZIP code route crosses over one of the ZIP code service area "boundaries", i.e. the boundaries aren't 100% accurate. You can also see where the boundaries line up on top of a road, there is really just one ZIP code route there.

It does appear that the ZCTA's defined by the 2010 census (and used by the script) could be outdated. I've overlaid the two maps here:
http://arcg.is/1LmfWm

It's interesting to note that a large % of the maps are identical, but there are definitely some differences, and even some zip codes that appear on the USPS map but not on the ZCTA map. My guess is that the USPS may have started with the ZCTA map, but has been modifying it over the years.

Unfortunately, I can't use the USPS map the same way I'm using the ZCTA map in the script. I could probably have it display the boundaries and labels exactly as they appear in the USPS map (overlaid images instead of drawing the geometry by the coordinate data), but it wouldn't be able to detect the ZIP code at the center of the screen and then display the city. One option might be to display the USPS map, and have a text box where you can enter the ZIP to get the "recommended" city. But it still won't be completely accurate because it's based on polygon boundaries. And to complicate things more, there are other city names that will work for some ZIP codes, not just the recommended one... yay!

So... yeah. It's not a simple problem. To answer the question: the USGB script isn't gospel, and it's likely no script that draws polygon boundaries will be. I might trust it to some degree in the middle of a ZCTA, but maybe not so much toward the edges. Though now that I've seen where the USPS map has new ZIP codes drawn... I'm less inclined to blindly trust USGB anywhere that I'm not already kinda familiar :?
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Sun Dec 09, 2018 3:36 pm

Just a quick update... I'm working on a script to pull the USPS routes from https://eddm.usps.com/eddm/customer/routeSearch.action and overlay them in WME. Hopefully that will serve as a double check for USGB's ZIP code areas, and when the ZIP code area borders lay directly on a road.
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Fri Dec 28, 2018 7:34 pm

Release v2018.12.28.001
Per the discussion below, you can now retrieve the actual USPS carrier routes and display them as highlights on the map. This should be more accurate for determining the mailing address city when compared to ZIP Code area boundaries (aka Zip Code Tabulation Areas, or ZCTA's) that are also displayed by this script.

NOTE: this script can only display the "recommended" USPS Zip Code city. There may be other cities for a given ZIP Code that locals are familiar with and could use when searching for an address. At a minimum, the recommended city should typically be used but if you have local knowledge you may want/need to add alternate cities. Also note that city guidance may vary from state to state or region to region, so please consult the Wazeopedia and/or your SM or RC if you are unsure, before updating the city (or alt city) on any road segments.

Instructions
The script adds a couple new buttons to the side panel:
2018-12-28_14h03_14.png
(46.37 KiB) Downloaded 293 times

Hover over the "Get USPS Routes" button and you'll see a yellow circle with a 1-mile diameter at the center of the screen.
2018-12-28_14h05_36.png
(136.99 KiB) Downloaded 276 times

Click the button to retrieve all USPS carrier routes that intersect that circle:
2018-12-28_14h10_15.png
(155.54 KiB) Downloaded 280 times

The ZIP Code and the "recommended city" for the ZIP Code will be displayed beneath the buttons, color-coded to match the carrier routes.

Note that some routes may cross ZCTA boundaries and/or end abruptly midway on a segment, often for no apparent reason. In these cases, you may want to do some more research to make sure the displayed route is correct. e.g. look up specific addresses on the USPS site, look up business addresses on their websites, etc. In most cases I've studied so far, the displayed routes have been correct. However, there have been a couple reported cases in beta testing of a route being incorrect at the end where it meets another. I've also run across at least one case where routes overlap (two cities may apply?), and the script doesn't currently make it easy to see that. So as with any external data, do your research if you have doubts.
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Mon Dec 31, 2018 5:08 am

Release v2018.12.30.002
Added a new time zones layer. Please note that the boundaries are very rough approximations. Also, they may not display properly (or at all) at zoom levels above 5. Something to do with a limitation of OpenLayers and how long the line segments are.
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

Re: [Script] WME US Government Boundaries

Postby MapOMatic » Tue Jan 01, 2019 9:56 pm

dfortney wrote:Thanks MapOMatic for the awesome ability to pull in USPS routes!

I'm seeing some instances where it is pulling in alternate cities rather than the default / recommended city. Here's an example in Menlo Park, CA - zip 94025. The script is pulling back West Menlo Park, which is evidently an allowed alternate name, but it is not the common name, and it's also not the recommended name using the USPS Zip Code locator searching for an address (I used 1185 Noel Dr, 94025 for my testing)

https://www.waze.com/en-US/editor/?env= ... ts=6008874

Hmmm, that's odd. Have you seen more instances of that? I'd like to see if there's any pattern. Unfortunately that's the only city name provided in the data so I'm not sure what I could do to fix it. I don't know why they'd list West Menlo Park, unless it has something to do with the facility being located in West Menlo Park (or it's just a mistake). Both Atherton and West Menlo Park routes list "MENLO PARK" as the facility name.
[ img ] [ img ]

AM Central KY | CM USA
MapOMatic
Country Manager
Country Manager
 
Posts: 340
Joined: Sat Jul 16, 2011 11:43 am
Location: Lexington, KY
Has thanked: 227 times
Been thanked: 642 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users