Here you can find the source of inRange(double lat, double lon)
private static boolean inRange(double lat, double lon)
//package com.java2s; //License from project: Apache License public class Main { private static boolean inRange(double lat, double lon) { if (Double.compare(lat, 90) <= 0 && Double.compare(lat, -90) >= 0 && Double.compare(lon, 180) <= 0 && Double.compare(lon, -180) >= 0) { return true; }//from www . jav a2s . co m return false; } }