Concept
The inspiration for the homeowrk came easily as the Spring Festival is around the corner. In China everyone heads back home before the Sprign Festival and the whole country is on the move, we call this Chunyun (literately meaning Spring travel). Also being inspired by the world population map that we made in class I wanted to make a map that showed the great migration of people that happen every New Year.
The most difficult part was actually looking for the data. Because this was a very Chinese thing and is not really recorded on databases in other countries, I first tried a government site in China but it requested a lot of filling out forms and emails and getting back to me in a few working days so I gave up. Eventually, I asked Gemini to dig through the internet to see if there is any Chunyun data, and Gemini turned up with some data and crawling codes on github. I decided to use the data Gemini found but it was recorded in a way that completely didn’t suit my needs and I was unable to transform it in to a easy understandable format. So I gave up and picked the top 50 most traveled intercity routes and put them on the map.
Code that I am proud of
//decide the real limits of the Chinese map so the cities are mapped to the shape of the country
//West
let mapLeft = 71.0;
//East
let mapRight = 136.0;
//North
let mapTop = 57.0;
//South
let mapBottom = 18.0;
//for loop to draw all the dots
for (i = 0; i < numRows; i++) {
//map the coordinated acourding to the outer rims of the country defined earilier
let x1 = map(float(originLon[i]), mapLeft, mapRight, 0, width);
//y coordinates are upside down because origin is in top left, reverse height and 0 to reverse the map
let y1 = map(float(originLat[i]), mapBottom, mapTop, height, 0);
let x2 = map(float(destLon[i]), mapLeft, mapRight, 0, width);
let y2 = map(float(destLat[i]), mapBottom, mapTop, height, 0);
This is how I mapped the locations of the cities to the actual shape of China instead of just mapping them to the canvas. I identified the four outer rims of China and kept the dots of cities within the limits so they would be proportional to their real location.
Sketch
The cities are either at their actual location or close. I was unable to be very exact because the margins and stretch of the background map was manually adjusted.
Reflection and improvements
The result of the map is not very good because only 50 routes were chosen and becaue of how people populate china they are mostly on the east side of the country. This makes the map look unbalances. Secondly, 50 is way too far from enough to create something like a flightmap that would outline the country with arcs. This was difficult to do because I had to process the data manually and even 50 took a huge amount of time. I will see if there are futher ways to used exel functiond or formulas to easily transform the data into something that can be processed easily. That would also deal with the problem of dots not fitting on maps properly because the dots and lines would create the map itself.