Take latitude and longitude as input.
<p>

@return the spatial key
343884
@Override
    public final long encode(double lat, double lon) {
        // PERFORMANCE: int operations would be faster than double (for further comparison etc)
        // but we would need 'long' because 'int factorForPrecision' is not enough (problem: coord!=decode(encode(coord)) see testBijection)
        // and 'long'-ops are more expensive than double (at least on 32bit systems)
        long hash = 0;
        double minLatTmp = bbox.minLat;
        double maxLatTmp = bbox.maxLat;
        double minLonTmp = bbox.minLon;
        double maxLonTmp = bbox.maxLon;
        int i = 0;
        while (true) {
            if (minLatTmp < maxLatTmp) {
                double midLat = (minLatTmp + maxLatTmp) / 2;
                if (lat < midLat) {
                    maxLatTmp = midLat;
                } else {
                    hash |= 1;
                    minLatTmp = midLat;
                }
            }
            i++;

            if (i < allBits)
                hash <<= 1;
            else
                // if allBits is an odd number
                break;

            if (minLonTmp < maxLonTmp) {
                double midLon = (minLonTmp + maxLonTmp) / 2;
                if (lon < midLon) {
                    maxLonTmp = midLon;
                } else {
                    hash |= 1;
                    minLonTmp = midLon;
                }
            }
            i++;
            if (i < allBits)
                hash <<= 1;
            else
                break;
        }
        return hash;
    }
939454
@Override
	@Pure
	public GeoLocation getGeoLocation() {
		final Rectangle2d b = getBoundingBox();
		if (b == null) {
			return new GeoLocationNowhere(getUUID());
		}
		return new GeoLocationPoint(b.getCenterX(), b.getCenterY());
	}
1161568
public EntryPosition getPosition(Object key, byte[] serializedKey) throws IOException {
      int segment = (key.hashCode() & Integer.MAX_VALUE) % segments.length;
      lock.readLock().lock();
      try {
         return IndexNode.applyOnLeaf(segments[segment], serializedKey, segments[segment].rootReadLock(), IndexNode.ReadOperation.GET_POSITION);
      } finally {
         lock.readLock().unlock();
      }
   }
556969
public LatLng toLatLng(Point point) {
        point = toWgs84(point);
        LatLng latLng = new LatLng(point.getY(), point.getX());
        return latLng;
    }
637051
public java.util.List<Mapping> getMapping() {  
		if (myMapping == null) {
			myMapping = new java.util.ArrayList<Mapping>();
		}
		return myMapping;
	}
784055
private static Point getCursorLocation()
    {
        try
        {
            final PointerInfo a = MouseInfo.getPointerInfo();
            final java.awt.Point b = a.getLocation();
            return new Point((int) b.getX(), (int) b.getY());
        }
        catch (final HeadlessException exception)
        {
            Verbose.exception(exception);
            return new Point();
        }
    }
1070921
private GeoPoint getLocation() {

        //sample data
        //{"timestamp": 1483742439, "iss_position": {"latitude": "-50.8416", "longitude": "-41.2701"}, "message": "success"}

        NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
        boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();

        GeoPoint pt = null;
        if (isConnected) {
            try {
                JSONObject jsonObject = json.makeHttpRequest(url_select);
                JSONObject iss_position = (JSONObject) jsonObject.get("iss_position");
                double lat = iss_position.getDouble("latitude");
                double lon = iss_position.getDouble("longitude");
                //valid the data
                if (lat <= 90d && lat >= -90d && lon >= -180d && lon <= 180d) {
                    pt = new GeoPoint(lat, lon);
                } else
                    Log.e(TAG, "invalid lat,lon received");
            } catch (Throwable e) {
                Log.e(TAG, "error fetching json", e);
            }
        }
        return pt;
    }
172493
public static LocationModel getLocationByCoordinates(Double latitude, Double longitude ){
        try {
            Geocoder geocoder;
            List<Address> addresses;
            geocoder = new Geocoder(QuickUtils.getContext());
            addresses = geocoder.getFromLocation(latitude, longitude, 1);

            LocationModel locationModel = new LocationModel();
            locationModel.latitude = latitude;
            locationModel.longitude = longitude;
            try{
                locationModel.address = addresses.get(0).getAddressLine(0);
            }catch(Exception ex){
                QuickUtils.log.e("empty address");
            }
            try{
                locationModel.city = addresses.get(0).getAddressLine(1);
            }catch(Exception ex){
                QuickUtils.log.e("empty city");
            }
            try{
                locationModel.country = addresses.get(0).getAddressLine(2);
            }catch(Exception ex){
                QuickUtils.log.e("empty country");
            }

            return locationModel;
        } catch (IOException e) {
            QuickUtils.log.e("empty location");
            return new LocationModel();
        }
    }
1085366
public Position.LineMap getLineMap() {
        return Position.makeLineMap(reader.getRawCharacters(), reader.buflen, false);
    }
842709
public MapKey<OneToMany<T>> getOrCreateMapKey()
   {
      Node node = childNode.getOrCreate("map-key");
      MapKey<OneToMany<T>> mapKey = new MapKeyImpl<OneToMany<T>>(this, "map-key", childNode, node);
      return mapKey;
   }
92989
@Override
    public Address getAddress(final double longitude, final double latitude) throws IOException {

        final NominatimReverseRequest q = new NominatimReverseRequest();
        q.setQuery(longitude, latitude);
        return this.getAddress(q);
    }
487202
@Override
    public byte[] getKey() {
        StringBuilder sb = new StringBuilder(64);
        sb.append(clusterName).append(MetricUtils.AT).append(topologyId).append(MetricUtils.AT)
                .append(metaType).append(MetricUtils.AT).append(id);
        return sb.toString().getBytes();
    }
493573
public LatLong getLocation() {
        if (location == null) {
            location = new LatLong((JSObject) (getJSObject().getMember("location")));
        }
        return location;
    }
912780
public Point getLocation() {
    JSONObject result =
        (JSONObject) driver.executeAtom(AndroidAtoms.GET_TOP_LEFT_COORDINATES, null, this);

    try {
      return new Point(result.getInt("x"), result.getInt("y"));
    } catch (JSONException e) {
      throw new SelendroidException(e);
    }
  }
1260060
public String toKey() {
        return (tag == null ? EMPTY_STRING : tag) + KEY_DELIMITER + (indicator == null ? EMPTY_STRING : indicator) +
                KEY_DELIMITER + subfieldIds;
    }
1046418
public MethodKey createCopy() {
        int size = getParameterCount();
        Class[] paramTypes = new Class[size];
        for (int i = 0; i < size; i++) {
            paramTypes[i] = getParameterType(i);
        }
        return new DefaultMethodKey(sender, name, paramTypes, isCallToSuper);
    }
150039
public String getResultKey() {
        Field singleField = getSingleField();
        if (singleField.getAlias() != null) {
            return singleField.getAlias();
        }
        return singleField.getName();
    }