não..
você faz um quadrante, com 2 coordenadas max. e 2 minima. limita ela na distancia que você quiser, aí depois faz o select.
Em 15 de julho de 2014 08:43, Diogo Henrique <diogjp10@gmail.com> escreveu:
Olá Jeordane,Você pode usar esse método aqui para saber a distancia de um ponto ao outro....ai e só melhorar e adaptar a sua necessidade.public static String GetDistance(LatLng src, LatLng dest) throws IOException {/** URL original***/StringBuilder urlString = new StringBuilder();urlString.append("http://maps.googleapis.com/maps/api/distancematrix/json?");urlString.append("origins=");//fromurlString.append(src.latitude);urlString.append(",");urlString.append(src.longitude);urlString.append("&destinations=");//tourlString.append(dest.latitude);urlString.append(",");urlString.append(dest.longitude);urlString.append("&mode=driving&language=pt-BR&sensor=true");HttpURLConnection urlConnection= null;URL url = null;url = new URL(urlString.toString());urlConnection=(HttpURLConnection)url.openConnection();urlConnection.setRequestMethod("GET");urlConnection.setDoOutput(true);urlConnection.setDoInput(true);urlConnection.connect();InputStream inStream = urlConnection.getInputStream();BufferedReader bReader = new BufferedReader(new InputStreamReader(inStream));String temp, response = "";while((temp = bReader.readLine()) != null){//Parse dataresponse += temp;}//Close the reader, stream & connectionbReader.close();inStream.close();urlConnection.disconnect();//Sortout JSONresponseJSONObject object;try {object = (JSONObject) new JSONTokener(response).nextValue();JSONArray array = object.getJSONArray("rows");JSONObject routes = array.getJSONObject(0);JSONArray legs = routes.getJSONArray("elements");JSONObject duration = legs.getJSONObject(0);JSONObject distance = duration.getJSONObject("distance");String sDuration = distance.getString("text");return sDuration;} catch (JSONException e) {e.printStackTrace();return null;}}
Em 14 de julho de 2014 20:21, Jeordane Batista <jeordane10@gmail.com> escreveu:--
Tenho registros armazenados em uma tabela com a latitude / longitude armazenadas em um campo de geometria. Eu quero encontrar todos os registros nas proximidades de um usuário fornecido ponto de referência. Nota "nas proximidades" provavelmente significa menos de 100 quilômetros (possivelmente ainda menor).
A tabela é composta pelas seguintes informaçõesTabela: estabelecimento
selecionar os estabelecimentos que esteja em um raio de até 1km (por exemplo), de um determinado Ponto.id type = serial|nome type = varchar(80)|localizacao = type point| 01 |Estabelecimento 01 |(-20.02269481,-45.54468155) 02 |Estabelecimento 02 |(-20.020777,-45.54372) 03 |Estabelecimento 03 |(-20.039084,-45.528041) ...
Vale lembrar que estou utilizando base de dados PostGIS
Alguém que possa me ajudar? Obrigado
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Rebert Tomaz
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.






0 comentários:
Postar um comentário