which plots a comma separated list of GPS locations on a world map 2D projection. I've been searching for a method to plot these points while only showing the continental U.S. I've read through Ben Fry's methodology on the subject and tried to rebuild what he had and I screwed up along the way. I'm very new to programming in general. I think I will be able to do this if I change this part of the code somehow:
x = int(((180+mapY)/360)*width);
y = int(height - ((90+mapX)/180)*height);
I'm really running out of ideas though. I've tried many different things. If anyone has any solution to this problem, it would be wonderful.
// Map coordinate (start and end points) float w_start; // Longtitude start (largest longitude value) float w_end; // Longtitude end (smallest longitude value) float h_start; // Latitude start (largest latitude value) float h_end; // Latitude end (smallest latitude value)
Hello - sorry for the late reply, I ran the code using the gps coordinates you gave earlier. You got the right idea - you read the text file and map the coordinates to certain bounds and display it on the screen and got the below output:
Here's an example I made for my students that reads GPS points from a map of cities in Switzerland that shows you how to do this in an object oriented way, I'll be very happy to answer any questions you have on this thread. I've commented the code so hope it helps you.
My best advice for you right now is to learn more about processing by buying Daniel Shiffman's book. He talks about reading from a text file and using the map() function in there.