Category: Python

Extract Chicago Crime Data from the Open Data Portal Using Python

As part of the investigation in crime around the 606 trail, we pulled the crime data from Chicago’s open data portal. The following is a straight forward sample Python script for pulling a daily extract. Note that the available crime data on

A Divvy tour using a Space Filling Curve

In a couple of previous posts, I reviewed the concept of using space filling curves as a heuristic for producing decent solutions for the traveling salesman problem (TSP). The attraction of this approach to me was the simplicity of implementation.

Generating a space filling curve in Python

As mentioned in a previous post, I had taken an interest in space filling curves as a method for approaching the traveling salesman problem. Bartholdi (link) presented an algorithm (p. 20) for generating such curves written in Modula-2.  In this

Creating a GEOJSON Linestring from a polyline

In a previous post, we had set out to take a pair of latitudes and longitudes and eventually create a map of directions between the two points. We had discussed the process of geocoding the locations and using APIs to

Converting two locations into a turn by turn mapping

I have done a number of professional projects where I had the same fairly well defined problem in different domains. The problem boiled down to one of starting with two destinations and programmatically mapping them as part of a larger

Looking up IP locations via API

OR….. WHERE ARE THESE PEOPLE WHO ARE PLANNING A BASEBALL ROAD TRIP ? I was doing some homegrown analytics for my baseball road trip planner at I have the IP address of any visit to the site, so I

Jittering a map location for privacy

As I mentioning in a previous post , I had a project that required mapping locations, but I wanted to slightly perturb the locations on the map so as to not reveal any of the actual locations on the map,

A golf road trip visiting a top course in each state

Or how to hit 48 top public golf courses in 48 states in 14,003 miles. My recently released tool Golf Trip Router allows you to build a (near)  optimal route between top public courses in the U.S. for your golfing road

Building the National Park road trip route

UPDATE: As mentioned in the previous post, after posting this I found that the folks at Isle Box  had this idea before me and beat me to the punch on doing it. I’ll leave this up since I think this post

A road trip route to all the National Parks in the lower 48 states

UPDATE: Ooops ! I found after posting this that the folks at Isle Box  had this idea before me and beat me to the punch on doing it. I’ll leave it up for now since I think the following post on