docs: @Override
      public final long encode(double lat, double lon) {
          lat = Math.min(Math.max(lat, bounds.minLat), bounds.maxLat);
          lon = Math.min(Math.max(lon, bounds.minLon), bounds.maxLon);
          // introduce a minor correction to round to lower grid entry!
          long latIndex = (long) ((lat - bounds.minLat) / latDelta * C);
          long lonIndex = (long) ((lon - bounds.minLon) / lonDelta * C);
          return latIndex * lonUnits + lonIndex;
      }