Announcement: Tool To Validate Your Latitude / Longitude

When I start a project with a new client, I request the locations of their facilities and, if applicable, their customers. Usually, the data I receive includes street address, ZIP code, and latitude and longitude. 

Unfortunately, the latitude & longitude are not always correct.  I take a “trust but verify” approach, mapping the locations using provided lat/long, and making a visual judgment.  (e.g., Antarctica is unlikely, as is Eastern Europe or central Asia for US-centric companies – all issues I’ve found with provided geocodes.  And don’t forget Null Island, at lat 0 / long 0.)

The trouble with the visual approach is that it is also quite error-prone; a location may be incorrectly geocoded but not immediately obvious.  For example, if your business has a lot of customers in Ohio, a pin that’s in northern Ohio but should be in southern Ohio, does not throw up red flags.  Even worse, if your business has a lot of customers throughout the Midwestern United States, a Minnesota address may have a Michigan pin – quite a distance away, yet also not immediately obvious.  These mistakes can be particularly troublesome if they involve higher-volume customers or facilities.

To help reduce some of this error, and speed up data validation, I have created a tool that takes as its input latitude and longitude, and returns the U.S. state or territory it is in, and what ZIP Code it is in (actually, ZIP Code Tabulation Area – ZCTA – similar to, but not exactly the same as, the ZIP code). If the lat/long is not in the U.S., or the tool cannot find the results in a short time, the tool returns “unknown”.

The tool is available as both a Shiny app and an API.  My hope is that the supply chain analyst community can use this tool to quickly validate geocoded latitude & longitude, comparing the lat/long’s state and ZCTA to the state and ZIP in a dataset, and flagging obvious problems for further investigation.

For a week or two, I’m opening the Shiny app and API for free, for initial use and feedback. After that, I will require a small usage fee, but for now my only request is your feedback!

How to use them:

Shiny app:  (redirects to

Instructions are in the app.  You can either upload a CSV, or directly copy/paste your latitude & longitude into a table. You can download results to CSV.

API endpoints (GET).  Replace (latitude 42, longitude -93) with your coordinates in the API call.

State (returns postal code abbreviation):

Thanks and hope this helps!  Please provide your feedback either in the comments or email

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s