For this project, I became interested in the different terms that hotels use to describe themselves. There’s something very different about staying somewhere advertised as a “Hotel” or a “Hostel” or a “Motel”, obviously, but there’s also some difference in terms like “Villa”, “Retreat”, “Castle”, “Chalet”. So I wanted to explore something very simple: a map where you could filter points by the terminology in the hotel name.
I used ofxCSV to parse the Hotelsbase file, after first manually cleaning up the data (removing empty rows). This addon didn’t have great documentation, and the example provided with the addon didn’t immediately work for me. It also took some time to figure out that it worked better if the file was renamed to a
.csv instead of a
I briefly experimented with trying to create an adjacency data structure so I could plot lines between vertices near each other (and hopefully explicitly define the shape of countries, since many have hotels dotting their borders). It ended up being really computationally expensive to do so, and my early attempts resulted in the charming but undesirable graphics you see above, so I abandoned this idea.
I only use 4 fields when visualizing the hotels: latitude, longitude, hotel name, and stars. The number of stars is used as the z-position of the points, so “better” hotels float above the mediocre or even bad hotels. The other hotel fields were less immediately interesting/useful, or were indecipherable, or had incomplete information across all data points. I was interested in the
facilities field, but couldn’t find a reliable source for what the data meant. The fields were cryptically formatted like:
For my final version, I used ofxUI to provide an interface to toggle different kinds of hotel terms and see. The addon has an incredible set of examples, so it was fairly easy to get it working.
At the bottom of the screen is printed a percentage and count for the number of hotels that have the selected term in their name. I also ended up utilizing ofEasyCam to allow users to scroll in and out, but the camera controls are a little wonky (especially with a touchpad), so I’m still fiddling with that a bit.
It’s actually very interesting to see the countries where particular terms are prevalent. “Suites” is exclusively a US phenomenon, “Castle” is the domain of the UK. “Casa” can be found in Spanish-speaking areas, and also a good amount of Italy.
I also learned an important lesson about Git in the making of this project. The Hotelsbase file is 132mb long, and Github’s maximum file size is 100mb. It turns out that when you push a file to Github, it also attempts to upload the history of files in previous commits. This is generally sensible and convenient unless you have a file you want to ignore entirely from the version control standpoint (or exclude so Github will accept your repo’s push). I forgot to add
hotelsbase.csv to my
.gitignore early on, so the history of my commits had this enormous file that was trying to push to the Github servers. There are a few wonky ways to clear a file from your commit history, but I honestly ended up going with the “nuke-everything” option and just recreating my Git repo in order to get the code online.
You can see the repository here.