Geocoding With US Census Bureau

Google dropped a bombshell on most maps users, including many of the people using the Store Locator Plus WordPress plugin — they now require ALL SITES to register for an API key.    The bigger part of the announcement was that ALL registered API keys must now be attached to a Google Billing Account.  That’s right, Google now wants your credit card information on file and ready-to-bill at a moments notice if you garner any traffic on your displayed maps.

You will see a lot of map plugins and services changing over the coming months because of this.    The WordPress plugin version of Store Locator Plus is one of them.   Thankfully those clients that opted to use the fully-managed My Store Locator Plus service won’t need to deal with Google — but there will be “in the background” changes made to that service as well.

One of the changes will be to leverage of many new local marketing and directory services that is slated to come online later this year.    A key element of that new service?   Leveraging public-domain (read, no cost to American companies) US Census Bureau geolocation data.    Any data collected by the Federal Government is free to use — you just need to know where and how to get it.    Thankfully open data and connectivity initiatives started in the past decade have made this easier than ever.

Getting Location Data For A US Address

You can find the latitude and longitude for nearly any address in the United States by using the US Census Bureau’s Geocoder service.  A simple REST service allows you to send in a street address and zip code or street + city + state and get data back in a readily-parsed JSON format for your web apps.

For example:
https://geocoding.geo.census.gov/geocoder/locations/address?format=json&benchmark=Public_AR_Current&street=633+King+Street&city=Charleston&state=SC 

Will yield this JSON response:

{
    "result": {
        "addressMatches": [
            {
                "matchedAddress": "633 KING ST, CHARLESTON, SC, 29403",
                "coordinates": {
                    "x": -79.94234,
                    "y": 32.794437
                },
                "tigerLine": {
                    "side": "L",
                    "tigerLineId": "108806876"
                },
                "addressComponents": {
                    "state": "SC",
                    "zip": "29403",
                    "city": "CHARLESTON",
                    "fromAddress": "617",
                    "toAddress": "649",
                    "preQualifier": "",
                    "preDirection": "",
                    "preType": "",
                    "streetName": "KING",
                    "suffixType": "ST",
                    "suffixDirection": "",
                    "suffixQualifier": ""
                }
            }
        ],
        "input": {
            "address": {
                "state": "SC",
                "street": "633 King Street",
                "city": "Charleston"
            },
            "benchmark": {
                "id": "4",
                "isDefault": false,
                "benchmarkDescription": "Public Address Ranges - Current Benchmark",
                "benchmarkName": "Public_AR_Current"
            }
        }
    }
}

From here you can populate your local cache service and significantly reduce your Google Maps Geocoding API calls.   Something our new Geotek venture will be providing as a low-cost service that will soon be integrated into the Store Locator Plus managed services.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.