My time in this mortal plane is short.
It is common knowledge that frustration is a big issue when programming, and I think this concerns beginners and veterans alike even if you’re as awesome as me. Knowing how to manage that frustration is paramount not only in order to perform well, but more importantly for one’s well-being. That being said, instead of elaborating on this, I will proceed to whine thoroughly about a problem which has recently delayed me in my work.
Without delving into the details, they are making drawing maps and displaying data very accessible. While some of its features are very elaborate… doing such a simple thing as highlighting a country is not possible, and this was exactly what I needed. How come, is the data not available? A quick search reveals that it is available via their website, but not their API.
Time to look for workarounds. One possibility is to look up their Geocoding API, which maps locations (countries, cities, points of interests…) to coordinates on a map. Unfortunately, it only returns one set of coordinates (longitude and latitude) and the bounding box (literally the coordinates of a square containing the location) associated to it, but not its entire geometry.
Secondly, in a world where loading time is of the essence, limiting the amount of data uploaded to the client (you) is capital. This means that I want to have a rough, low resolution version of each country’s geometry that I can show when unzoomed, and more detailed ones that are suitable even when zoomed in. Let me remind you that all of this work has already been done by Google (and probably even better), and is necessary for us to do because they haven’t made this easily accessible via their API.
I saved the best for last. You may think that I missed something in the API, or that adding this feature is not possible for technical reason. It turns out that this is in the list of possible enhancements to the project, and has been classified by Google staff as a “neat idea”: a possible good addition to the API, but not planned yet for implementation… This thread was opened in 2008.
For those interested, you might want to check out this small article about Google’s business model regarding this API, and alternatives to it.
I will finish up by saying that one way to deal with one’s frustration is to remind oneself of the objective, and to think of the satisfaction we will get from reaching it! As silly as it sounds, it can be easy to get carried away and forget this over the course of a PhD.