I spent this Spring playing with data from the City of Austin. Specifically I wanted to see if I could come up with a better pet locator than the one the Austin Animal Center currently had. I also thought it would be nice to visualize the data. So I setup a Django project and used the sodapy Python package for the Socrata Open Data API that the City of Austin uses, to grab the FY 2015 data from the Austin Animal Center.
I put my code up on github, so if you’d like to take a look and modify it to your city, please feel free.
I ran into a couple of issues. One was that if the location was input incorrectly, the City of Austin feed would break and I’d get no data. I emailed the data owner the first time it happened and it was fixed pretty quickly. I haven’t had to email them since around April, so hopefully this has been fixed. The other issue is that the location is pretty haphazardly input. I wanted a search that would do location based searches. So you could look for a lost pet that was found perhaps 5 miles from where you lost it. I had to find a solution to get location coordinates. Google has a fantastic geocode api, but it’s also limited to 2500 requests a day. I looked into other geocoding apis, but they had issues parsing the addresses. The Google API was much better at deciphering addresses. So in the end I did manual batches daily for a few days to get all the entries for the Fiscal year geocoded. If you aren’t concerned with older data, you can just start fresh and not deal with this piece. With the lat and lon figured out, I used Great Circle math instead of a GIS library. That took some tinkering, but I’m glad I got it to work. Something I can look back at and reference. It was a nice learning experience.
The site is now live at petfinder.irmakramer.com I’ll have to update the feed to the current FY every year since that’s how the hourly data is delivered from the data source, but other than that, it should be an easy site to maintain. I hope you find the code and site useful!