Eclecticos
03-25-2008, 08:21 AM
From: Kiwitobes.Com (http://blog.kiwitobes.com/?p=51)
It actually is built entirely from data that’s in Freebase, including the map itself.
http://i190.photobucket.com/albums/z217/Eclectico5/wallyworld.jpg
You can download a high-resolution AVI version HERE (http://dev.mqlx.com/~toby/walmart.avi) <=-
Here’s how it works:
Freebase has a topic for every zip code, along with it’s longitude and latitude. Here’s one example. One query pulls out all the ZIP codes along with their longitudes and latitudes. You can turn longitudes and latitudes into graphical coordinates with some simple transformations (which will vary based on the region you’re plotting and how big your image is) — here are the ones I used:
x=(longitude+127)*16
y=(50-latitude)*20
If you plot all the ZIP codes using a library like PIL, you get a nice map with dots that roughly match population density, which has the advantage of looking a little bit like a night-time satellite photo of the United States.
Freebase also contains a list of Wal-mart locations, along with their addresses and the year that they opened. One query pulls all of these out of Freebase.
To create the animation, I generated 30 images for each year starting with 1962. I spread all the Wal-marts that opened that year over the 30 frames. To show the appearance of a Wal-mart, all I had to do was plot a large white dot over the small yellow dot for the appropriate ZIP code. I turned the 1380 images into an animation using MEncoder.
It actually is built entirely from data that’s in Freebase, including the map itself.
http://i190.photobucket.com/albums/z217/Eclectico5/wallyworld.jpg
You can download a high-resolution AVI version HERE (http://dev.mqlx.com/~toby/walmart.avi) <=-
Here’s how it works:
Freebase has a topic for every zip code, along with it’s longitude and latitude. Here’s one example. One query pulls out all the ZIP codes along with their longitudes and latitudes. You can turn longitudes and latitudes into graphical coordinates with some simple transformations (which will vary based on the region you’re plotting and how big your image is) — here are the ones I used:
x=(longitude+127)*16
y=(50-latitude)*20
If you plot all the ZIP codes using a library like PIL, you get a nice map with dots that roughly match population density, which has the advantage of looking a little bit like a night-time satellite photo of the United States.
Freebase also contains a list of Wal-mart locations, along with their addresses and the year that they opened. One query pulls all of these out of Freebase.
To create the animation, I generated 30 images for each year starting with 1962. I spread all the Wal-marts that opened that year over the 30 frames. To show the appearance of a Wal-mart, all I had to do was plot a large white dot over the small yellow dot for the appropriate ZIP code. I turned the 1380 images into an animation using MEncoder.