Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 2025 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@javieritis
javieritis / GeoLocationFilterByDistance.java
Last active December 19, 2019 16:17
Find points in radius distance.
/**
* https://clickherelabs.com/development-2/distance-searching-and-mysql/
* http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates
*/
static int distance = 10;
static double origLatitude = 0; //your latitude in degrees
static double origLongitude = 0; //your longitude in degrees
public static void main(String[] args) {
List<LatLng> result = filterLocations(origLatitude, origLongitude, distance, getList());
new MyCustomAsyncTask().executeOnExecutor(ExecutorManager.getInstance().getExecutor())