@NonNull
    private static ContentValues createWaypointValues(final String geocode, final Waypoint waypoint) {
        final ContentValues values = new ContentValues();
        values.put("geocode", geocode);
        values.put("updated", System.currentTimeMillis());
        values.put("type", waypoint.getWaypointType() != null ? waypoint.getWaypointType().id : null);
        values.put("prefix", waypoint.getPrefix());
        values.put("lookup", waypoint.getLookup());
        values.put("name", waypoint.getName());
        putCoords(values, "", waypoint.getCoords());
        values.put("note", waypoint.getNote());
        values.put("user_note", waypoint.getUserNote());
        values.put("own", waypoint.isUserDefined() ? 1 : 0);
        values.put("visited", waypoint.isVisited() ? 1 : 0);
        values.put("org_coords_empty", waypoint.isOriginalCoordsEmpty() ? 1 : 0);
        values.put("calc_state", waypoint.getCalcStateConfig());
        values.put("projection_type", waypoint.getProjectionType().getId());
        values.put("projection_unit", waypoint.getProjectionDistanceUnit().getId());
        values.put("projection_formula_1", waypoint.getProjectionFormula1() == null ? null : waypoint.getProjectionFormula1());
        values.put("projection_formula_2", waypoint.getProjectionFormula2() == null ? null : waypoint.getProjectionFormula2());
        putCoords(values, "preprojected_", waypoint.getPreprojectedCoords());
        values.put("geofence", waypoint.getGeofence());
        return values;
    }
Retrieve coordinates from a Cursor

@param cursor   a Cursor representing a row in the database
@param indexLat index of the latitude column
@param indexLon index of the longitude column
@return the coordinates, or null if latitude or longitude is null or the coordinates are invalid
main/src/main/java/cgeo/geocaching/storage/DataStore.java