Yingri Guan

11 Feb 2014

Hotel Plot

Screen Shot 2014-02-11 at 4.44.06 AM

Nighttime lights visible on earth by NASA

earth_lights_f-1

After plotting these coordinates of the hotels, I started thinking about the specifics about the reason of their locations and wondering about the relationship with human economic activities. After further research, I found this stunning image of lights at night shot from the space. Interestingly, the greater the light intensity, the denser of hotel locations. The two maps almost look identical.  A much more intensive research “G-Econ” used 35 measures to compare the geographical and economic data sets across the globe. I think the locations of the hotels along says a lot about the geographical, economic and social aspects of the world.

Code from openFrameworks:

#include "testApp.h"

//--------------------------------------------------------------
void testApp::setup(){
    
    // Load a CSV File.
//	csv.loadFile(ofToDataPath("hoteltest.txt"), "~");
	
//	cout < < "Print out a specific CSV value" << endl;
//	cout << csv.data[0][1] << endl;
//	// also you can write...
//	//cout << csv.data[0].at(1) << endl;
//	
//	cout << "Print out the first value" << endl;
//	cout << csv.data[0].front() << endl;
//	
//	cout << "Maximum Size:";
//	cout << csv.data[0].max_size() << endl;
    
   // csv.loadFile(ofToDataPath("hotel_latlong.txt"));

    ofBuffer file = ofBufferFromFile("hotel_modified.txt");
    while (!file.isLastLine()) {
    vector  values = ofSplitString(file.getNextLine(), "~");
       if(values.size()>=6) {
            float lon = ofToFloat(values[5]);
            float lat = ofToFloat(values[4]);
//            string name = ofToString(values[1]);
           
           coordinates.push_back(ofPoint(lon, lat));
        }
    }
    
      mapImage.loadImage("earth_lights_2011x600.jpg");
    merMap.setup(mapImage.getWidth(), mapImage.getHeight(), -180.0000, -70.0000, 180.0000, 70.0000);
 
      ofSetWindowShape(mapImage.getWidth(), mapImage.getHeight());
}

//--------------------------------------------------------------
void testApp::update(){

}

//--------------------------------------------------------------
void testApp::draw() {

    ofEnableAlphaBlending();
    ofSetColor(0,255,255);
    mapImage.draw(0, 0);
    
    for(int i=0; i