Google search with processing

edited December 2014 in How To...

Hey, How can I use Google search to find the longitude and latitude of a place. Say I fill in the location as a search query and then I use the web to find the geo location of that place. Is there any API existing which can do this? Or is there any way I can use the data at google maps in my application?

Any kind of help would be great :)


  • This is a good start:

    Be aware off:

    This service is generally designed for geocoding static (known in advance) addresses for placement of application content on a map; this service is not designed to respond in real time to user input, for example. For dynamic geocoding (for example, within a user interface element), consult the documentation for the JavaScript API V3 Client Geocoder and/or the Google Play services Location APIs.

    You might also like this for later. It gives the google street view image from a lat/lon: (If you request to much google will probably block you for a certain time, also making use of a API is better then this if many people are going to use it).

    void setup() {
      size(640, 640);
      PImage img = getStreetViewImage(40.720032, -73.988354);
      image(img, 0, 0);
    PImage getStreetViewImage(float lat, float lon) {
      int w = 640;
      int h = 640;
      int fov = 90;
      int heading = 235;
      int pitch = 10;
      boolean sensor = false;
      return loadImage(""+w+"x"+h+"&location="+lat+",%20"+lon+"&fov="+fov+"&heading="+heading+"&pitch="+pitch+"&sensor="+sensor, "jpg");
  • edited December 2014

    Thanks for the prompt reply.

    Another problem that I faced was to access the gps data on an android application which is being built on processing. Any ideas on how to do that?

  • The second question is relatively distinct enough of the first to be worth of another thread, in the Android category (at least if you want to have a chance to get an answer...).

  • If I try the code from clankill3er I get the error

    expecting RPAREN, found 'http'

    .. can you give a working example?

  • The code formatter of the forum messes up with URLs, just replace the HTML link with the raw URL.

  • I always use: "http://" + ""; =))

Sign In or Register to comment.