# Geolocation and Osc Message

**URL:** <https://discourse.processing.org/t/geolocation-and-osc-message/1117>\
**Category:** Coding Questions\
**Created:** [June 20, 2018, 10:27am UTC](https://discourse.processing.org/t/geolocation-and-osc-message/1117 "2018-06-20T10:27:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![netphysicist](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@netphysicist](https://discourse.processing.org/u/netphysicist)\
**Post date:** [June 21, 2018, 7:59am UTC](https://discourse.processing.org/t/geolocation-and-osc-message/1117/3 "2018-06-21T07:59:45Z")

</div>

This is the code in Java mode that i run in the PC…I 've got the outpout in the console but not in the interface window that appears after i run the code…

```auto
import ketai.net.*;
import ketai.sensors.*;
import ketai.ui.*;

import oscP5.*;
import netP5.*;
  

OscP5 oscP5;
NetAddress remoteLocation;

double longitude, latitude, altitude;
KetaiLocation location;

void setup() {
 size(1000,600);
orientation(LANDSCAPE);
textAlign(CENTER, CENTER);
textSize(50);

oscP5 = new OscP5(this,12000);
remoteLocation = new NetAddress("192.168.1.2",12000);
}

void draw() {
  background(155);  
    text("Latitude: " + latitude + "\n" + 
      "Longitude: " + longitude + "\n" + 
      "Altitude: " + altitude, -300, -100, width, height);  

  }

void oscEvent(OscMessage theOscMessage) {
 
 
  if (theOscMessage.checkTypetag("fff")) // 6
  {
    latitude = theOscMessage.get(0).floatValue(); // 7
    longitude = theOscMessage.get(1).floatValue();
    altitude = theOscMessage.get(2).floatValue();
  }
  
}
void onLocationEvent(float _latitude, float _longitude, float _altitude)
{
  longitude = _longitude;
  latitude = _latitude;
  altitude = _altitude;
 println("lat/lon/alt: " + latitude + "/" + longitude + "/" + altitude);
}

```

---

_[View the full topic](https://discourse.processing.org/t/geolocation-and-osc-message/1117)._
