This map displays the locations of all the subway entrances, gardens, theaters and wifi hotspots within the New York area. Each colored dot displays the location of each each specific category. When the dots start to overlap and therefore, become brighter, the map alludes to a high quantity of subway entrances, gardens, theaters and/or wifi hotspots. This allows the user to see which parts of new york are more populated.
PDF: map3
Code:
import processing.pdf.*;
void setup (){
size (800, 800);
noLoop();
}
float highestValue = -123.118095;
//float lastHighestLong = 0;
int size = 5;
int op = 50;
//////////////////////////////////////////////////draw/////////
void draw () {
beginRecord(PDF, “output3.pdf”);
//////////////////////////////////////////////////////////////subway////
Table subwaycsv = loadTable ( “subway2.csv”, “header”);
String latLong;
int count = 0;
for (TableRow row : subwaycsv.rows() ){
count++;
latLong = row.getString(“hello”);
String[] latList = split(latLong, ” “);
// float latitude = float(latList[0]);
String latitudeString = latList[0].substring( 0, latList[0].length()-1 );
float latitude = float(latitudeString);
// println(latitude);
float longitude = float(latList[1]);
if(latitude>highestValue && latitude<0){
highestValue = latitude;
println(highestValue);
}
// println(“lat: ” + latitude + ” long: ” + longitude);
// if(latitude > -73.910196 && latitude < -74.014959 && longitude > 40.703436 && longitude < 40.877644){
float xPos = map(latitude, -74.5, -73.5, 0, 800);
float yPos = map(longitude, 41, 40.5, 0, 800);
// println(count + ” lat: ” + latitude + ” long: ” + longitude);
fill(255, 0, 0, op);
noStroke();
ellipse(xPos, yPos, size, size);
// }else{
// println(count + ” nope.”);
// }
// println(xPos);
}
///////////////////////////////////////////////////// GARDENS///////////
Table gardenscsv = loadTable ( “gardens1.csv”, “header”);
String latLong1;
int count1 = 0;
for (TableRow row : gardenscsv.rows() ){
count++;
latLong1 = row.getString(“hello”);
String[] latList1 = split(latLong1, ” “);
// float latitude = float(latList[0]);
String latitudeString1 = latList1[0].substring( 0, latList1[0].length()-1 );
float latitude1 = float(latitudeString1);
// println(latitude);
float longitude1 = float(latList1[1]);
if(latitude1>highestValue && latitude1<0){
highestValue = latitude1;
println(highestValue);
}
// println(“lat: ” + latitude + ” long: ” + longitude);
// if(latitude > -73.910196 && latitude < -74.014959 && longitude > 40.703436 && longitude < 40.877644){
float xPos = map(latitude1, -74.5, -73.5, 0, 800);
float yPos = map(longitude1, 41, 40.5, 0, 800);
// println(count + ” lat: ” + latitude + ” long: ” + longitude);
fill(5, 250, 15, op);
noStroke();
ellipse(xPos, yPos, size, size);
// }else{
// println(count + ” nope.”);
// }
// println(xPos);
}
/////////////////////////////////////////////////////////WIFI///////////
Table wificsv = loadTable ( “wifi1.csv”, “header”);
String latLong2;
int count2 = 0;
for (TableRow row : wificsv.rows() ){
count++;
latLong2 = row.getString(“hello”);
String[] latList2 = split(latLong2, ” “);
// float latitude = float(latList[0]);
String latitudeString2 = latList2[0].substring( 0, latList2[0].length()-1 );
float latitude2 = float(latitudeString2);
// println(latitude);
float longitude2 = float(latList2[1]);
if(latitude2>highestValue && latitude2<0){
highestValue = latitude2;
println(highestValue);
}
// println(“lat: ” + latitude + ” long: ” + longitude);
// if(latitude > -73.910196 && latitude < -74.014959 && longitude > 40.703436 && longitude < 40.877644){
float xPos = map(latitude2, -74.5, -73.5, 0, 800);
float yPos = map(longitude2, 41, 40.5, 0, 800);
// println(count + ” lat: ” + latitude + ” long: ” + longitude);
fill(208, 5, 252, op);
noStroke();
ellipse(xPos, yPos, size, size);
// }else{
// println(count + ” nope.”);
// }
// println(xPos);
}
/////////////////////////////////////////////////////////////THEATERS////////
Table theaterscsv = loadTable ( “theaters1.csv”, “header”);
String latLong3;
int count3 = 0;
for (TableRow row : theaterscsv.rows() ){
count++;
latLong3 = row.getString(“hello”);
String[] latList3 = split(latLong3, ” “);
// float latitude = float(latList[0]);
String latitudeString3 = latList3[0].substring( 0, latList3[0].length()-1 );
float latitude3 = float(latitudeString3);
// println(latitude);
float longitude3 = float(latList3[1]);
if(latitude3>highestValue && latitude3<0){
highestValue = latitude3;
println(highestValue);
}
// println(“lat: ” + latitude + ” long: ” + longitude);
// if(latitude > -73.910196 && latitude < -74.014959 && longitude > 40.703436 && longitude < 40.877644){
float xPos = map(latitude3, -74.5, -73.5, 0, 800);
float yPos = map(longitude3, 41, 40.5, 0, 800);
// println(count + ” lat: ” + latitude + ” long: ” + longitude);
fill(249, 250, 5, op);
noStroke();
ellipse(xPos, yPos, size, size);
// }else{
// println(count + ” nope.”);
// }
// println(xPos);
//println(“Finished”);
//exit();
}
endRecord();
}
