Q:

Mapping GPS points on processing layer

I am new to processing tool and using Java to implement my algorithms. I want to visualize GPS points of a trajectory on a map (both of them should be in the same coordinate- I want it to be a projected coordinate in order to perform various spatial analysis). I searched a lot on processing home page and some tutorials. But I didn't get any clue how to map GPS points on a map in processing canvas? Any suggestions or good tutorial for this?

A:

What you're trying to do is convert coordinates from latitude/longitude to the screen. For that, you'll want to use map(), which scales values from one range to another.
For example, latitude goes from +90º at the north pole, 0º at the equator, and -90º at the south pole. If your sketch is 600 pixels high, you would use:
float y = map(latitude, 90,-90, 0,height);

Of course, different map projections will make this much more difficult. The "equirectangular" projection is made up of equally-sized squares. It distorts the landforms, but makes writing code very easy.
I have some mapping demos for Processing – I think this one will be most helpful.

