Lately I’ve been working on projects that require quick geocoding in the browser based on a user search. Here I want to share two specific geocoding services that have worked well for me, have been cost effective (free), and return seemingly solid results: Census and Mapbox. Both services allow for one to structure an HTTP query with an address and the response comes in JSON format with the appropriate latitude and longitude information.
The Census Geocoder
The Census Geocoder has a pretty simple REST API that is accessible without the need of a special API key or token, which is awesome. There are two valid ways to structure the query:
- One Line Address: allows you to send a single string into the query
- Address parameters: build the parameters for each part of the address
We’ll focus on the One Line Address for simplicity’s sake. The HTTP endpoint is as follows:
The necessary parameters are as follows:
address – the address string you are looking for
benchmark – A numerical ID or name that references what version of the locator should be searched. Here’s a list of benchmarks.
format – format of the response. Typically used with
An example call for the location of The Old Fashioned bar in Madison, WI with the address 23 North Pinkney St. Madison WI:
Mapbox offers a great geocoding service that is very much like the Census, allowing for HTTP requests. They require an API key but beyond that you can make many calls to their API without going over the limit. One thing that draws me to the Mapbox version is the ability to make multiple queries for different addresses in the same request using their batch geocoding service (allowing up to 50 per request). Here’s an example searching for three different zip codes:
The response is an array of objects with the geometry information for the respective features.
The second volume of the Atlas of Design is now available! You can order the book at the new NACIS website. The volume consists of 32 maps created by some of the world’s most distinguished cartographers (there is a list of all of the contributors). Congratulations to the contributors and the editors for another great edition and continuing this great tradition of compiling these great maps. You can take a look at some of the maps at their blog.
Today I uploaded Part 2 of the Leaflet Video Tutorial series for the GISC. This tutorial introduces the basics for adding markers to maps, and using GeoJSON datasets with Leaflet. Be sure to watch Part 1 if you need a refresher on Basemap Initialization with Leaflet.
The Atlas of Design has opened its doors once again for those wanting to be a part of the beautiful world of cartography. Volume I was a great success that produced a hard cover publication showcasing some of the finest maps recently made.
You can submit on their website and all you need is your name, map title, email, map description, and a small file of your map to upload.
Submissions are open until February 28th so make sure to polish up your projects before then!
Mike from SoCalGIS.org just posted an excellent tutorial showing how one could use Python within the field calculator to break apart string values and add them to a new field.
For example, say you have a field with values such as “Census Tract 12345″ and you want to have a field that only contains the tract number (e.g., 12345). You can use python within the field calculator to extract that third word from the field, pretty sweet!
Check it out: