private static Float floatFromJson(final Float currentFloat, final JSONObject json, final String key) {
        if (json != null && json.has(key)) {
            final double value = json.optDouble(key, Double.NaN);
            if (!Double.isNaN(value)) {
                return (float) value;
            }
        }
        return currentFloat;
    }
Utility class to work with GeoJson
main/src/main/java/cgeo/geocaching/utils/GeoJsonUtils.java