Thursday, February 16, 2012

Starting the Texas Ed Vis

So an early exercise in the Processing book is to display a map of the US, then draw a circle at the center of each state, reading the position data from a file. This aligns very much with my visualization project, which will involve drawing circles at the location of each TX school district.

Downloaded a TEA data file containing info on every school in the state. Extracted from it a list of every district in the state. Contained addresses (sometimes a PO box) for each district. Went looking for a way to convert addresses into longitude and latitude.

Found and tried a couple of things, but ultimately landed (surprise, surprise) at Google Code and the Google Maps API. One of the Web Services that they offer is a Geocoding API. Geocoding is the process of converting an address to latitude and longitude. Now I'm in WELL over my head, but I learn that you can send a request to the API in the form of an http (statement?). The statement that I ultimately sent looked like this:

http://maps.googleapis.com/maps/api/geocode/json?address=2211+Lawnmont+Ave,+Austin,+TX&sensor=false

and it delivered a result that included something like this:

"formatted_address" : "2211 Lawnmont Ave, Austin, TX 78756, USA",
"geometry" : {
"location" : {
"lat" : 30.3268790,
"lng" : -97.74253999999999
}

So I'd managed to execute the task for one address. Now the question is how to do it for the 1250 addresses I have for Texas school districts. Time to consult w/ David Kim...

FYI - info on Google Geocoding API is here:

http://code.google.com/apis/maps/documentation/geocoding/

No comments:

Post a Comment