Это работает для меня:
...
query = "SELECT * FROM weather.forecast " +
"WHERE woeid in (" +
"SELECT woeid " +
"FROM geo.places(1) " +
"WHERE text=\"(%1$s, %2$s)\") " +
"AND u='c'";
... а затем:
query = String.format(query, location.getLatitude(), location.getLongitude());