GPS and Google API in Processing

edited May 2015 in Library Questions

How can I read gps coordinates and show this in a map ? I have a map using the GoogleMapper library. Does anyone has an example or something ????

Answers

  • "How can I read gps coordinates"
    Depends where you want to get them. Device? Text file? Internet API?

    Perhaps search (from the main site) the GPX keyword...

  • Hi Philho, I will use an GPS MODULE( FOR ARDUINO). My idea is to get the coordinates with gps module and transfer the coordinates for an Google API and show in the map.

  • Hi, for example send from arduino to processing:

                float lat = 49.1234567;
                float lon =2.123456789;
                void setup() { 
                Serial.begin(9600);
                }
                void loop() {
                  Serial.print(lat,6); //,number of decimal
                  Serial.print(",");
                  Serial.println(lon,6); 
                delay (5000);
                }
    

    for receiving data in the processing googlemapper, it is similar to:

    void setup(){
    ....
       myPort.bufferUntil('\n');  
    }
    void draw()...
    
    
    void serialEvent(Serial port) { 
        String fromArduino = port.readStringUntil('\n');
        if (fromArduino != null) {
         float[] arduCoords = float(split(fromArduino, ","));
         println( arduCoords[0]);
        println( arduCoords[1]);
    
        lat =arduCoords[0];
        lon =arduCoords[1];
        mapCenterLat=lat;
        mapCenterLon=lon;
         }
        }
    
Sign In or Register to comment.