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.

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

Post by MapOMatic
WME US Government Boundaries
Plots US boundaries (federal / state / local) as a layer on the map.
(not compatible with Firefox / Greasemonkey)

Currently supports:
  • ZIP Codes (actually, ZIP Code Tabulation Areas)
  • Counties
  • Time Zones
https://greasyfork.org/en/scripts/25631 ... boundaries

If ZIP Codes are enabled, it displays the ZIP Code and USPS "recommended city" for the center point of the map view (displayed in the black header bar at the top of the map). Click the ZIP Code there to open the USPS's "ZIP Code to city" conversion web page.

IMPORTANT NOTE: ZIP Code Tabulation Areas (ZCTA) are only approximate representations of USPS Zip Codes.  Actual USPS ZIP Codes can be a single point or a single street.  See this article for more information: Zip Code Tabulation Areas
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times

POSTER_ID:2647925

1

Send a message
Last edited by MapOMatic on Tue Aug 09, 2022 6:51 pm, edited 2 times in total.


Post by MapOMatic
Hi all,
I've gotten a couple reports of antivirus apps blocking the following site (used in this script), and at least one person even being flagged at work for suspicious network activity.

mapomatic.000webhostapp.com

I set this up on a free web hosting service so we could use a USPS service to lookup city names from the zip code. It couldn't be done directly from each person's PC, so this site acts as the middle man, receiving a zip code from us, looking it up at USPS, and returning the city name.

Apparently (unknown to me at the time) the domain 000webhostapp.com has been reported as suspicious by some antivirus services and is either completely blocked, or treated as a potential threat. I believe my site is *not* a threat, but that these services are being cautious because of the domain name itself.

In response, I've removed the section of code that performs the zip -> city name lookup in v0.4.5. I'll look for a more reputable free web hosting service so we can get it going again.

I apologize if this has caused trouble for anyone else.
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message
Last edited by MapOMatic on Sat Apr 08, 2017 9:32 pm, edited 2 times in total.

Post by MapOMatic
... 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).
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message

Post by MapOMatic
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.
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message

Post by MapOMatic
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 812 times
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message

Post by MapOMatic
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.
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message

Post by MapOMatic
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?
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message

Post by MapOMatic
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 :?
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message

Post by MapOMatic
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.
MapOMatic
Country Manager
Country Manager
Posts: 495
Has thanked: 250 times
Been thanked: 871 times
Send a message