package com.bcxin.Infrastructures.utils;

public class GeoLocationValueType {
    public static boolean isValidLocation(Double lat,Double lon) {
        if (lat == null || lon == null) {
            return false;
        }

        try {
            String latString = lat.toString();
            String lonString = lon.toString();

            if (!latString.contains(".") || !lonString.contains(".")) {
                return false;
            }

            return (latString.length() - latString.indexOf(".")) >= 4 &&
                    (lonString.length() - lonString.indexOf(".")) >= 4;
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        return true;
    }
}
