CONCEPT
After the data visualization lecture, I had a lot of ideas about what data I would like to project on the map. I thought about oil dwellers in the GCC region, corn fields in Europe, and so on. But it turned out that finding a CSV file with data can be harder than writing the actual code for data visualization. After hours of searching, I decided to find something more obvious and chose to project the world’s airports on the map.
SKETCH
The sketch illustrates where the airports are located in the world. Through observations, we can see which parts of the world are more developed and which are not. This data can later be used in scientific research.
CODE
function draw() { for (let csvRowNumber = 1; csvRowNumber < strings.length; csvRowNumber++) { let singleRow = split(strings[csvRowNumber], ","); let longitude = float(singleRow[6]); let latitude = float(singleRow[7]); // Making sure that longitude and latitude coordinates exist if (!isNaN(longitude) && !isNaN(latitude)) { //Map function is used for calculating the coodinates x and y let x = map(longitude, minLong, maxLong, width, 0); // Invert y-axis to match typical map orientation let y = map(latitude, minLat, maxLat, height, 0); stroke(0); point(x, y); } }
A lot of used functions were covered during the lecture, but while writing a code for a sketch, I was facing different problems. For example, some .csv files with numeric values didn’t work with the float function. And this project helped me a lot with building confidence around doing data visualization code.
REFLECTIONS
Personally, this project was more technical for me than creative because the scope of my work was limited to the data I was able to find on the Internet. But I believe that technical skills are no less important than doing creative work; therefore, I’m glad I had an opportunity to get familiar with the new functions and opportunities P5 has, which I will use in my future works and projects.