Hello guys , I am new to processing and I have a question about my program. I am planning to plot the Corona virus data in the map of Nepal. I have a SVG file for the map, and csv files for corona virus data and Latitude and longitude of each district of Nepal. I am not sure how to use the latitude and longitude to plot in the exact location. maybe I need to configure the map before plotting it. I could not find any good documentation on how to do it either. Could anybody guide me on how to do it ?
Thank you in advance
import java.util.HashMap;
Table table;
PShape baseMap;
String p[];
String[] Data;
Table location;
StringList strDistrict;
IntList intConfirmedCases;
IntList intTotalDeath;
IntList intTotalRecovered;
FloatList floatLat;
FloatList floatLong;
void setup() {
size(1000, 800);
background(255);
noLoop();
//loading the map and the csv file
baseMap=loadShape("nepalmap.svg");
table=loadTable("corona.csv", "header");
location=loadTable("location.csv", "header");
}
void draw() {
shape(baseMap, 0, 0, width, height); //display the map
strDistrict=new StringList();
intConfirmedCases=new IntList();
intTotalDeath=new IntList();
intTotalRecovered=new IntList();
floatLat=new FloatList();
floatLong=new FloatList();
for (TableRow row : table.rows()) {
String District=row.getString("District");
int Confirmed_Cases=row.getInt("Confirmed Cases");
int Total_Death=row.getInt("Total Death");
int Recovered_Cases=row.getInt("Total Recovered");
strDistrict.append(District);
intConfirmedCases.append(Confirmed_Cases); //appending the data of confirmed cases in a stringlist
intTotalDeath.append(Total_Death); //appending the data of confirmed cases in a stringlist
intTotalRecovered.append(Recovered_Cases);
}
for (TableRow row : location.rows()) {
Float Latitude=row.getFloat("Latitude");
Float Longitude=row.getFloat("Longitude");
floatLat.append(Latitude);
floatLong.append(Longitude);
}
for ( int i=1; i<floatLat.size(); i++) {
float graphLong=map(floatLong.get(i), 90, -90, 0, height);
float graphLat=map(floatLat.get(i), -180, 180, 0, width);
fill(255, 0, 0, 50);
ellipse(graphLat, graphLong, 5, 5);
}
text("Index", 30, height-130);
fill(#F21642);
ellipse(40, height-100, 30, 30);
fill(#0E0F0E);
text("--> Confirmed Corona Cases", 70, height-97);
}