% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/estimate_griddap_size.R
\name{estimate_griddap_split_size}
\alias{estimate_griddap_split_size}
\title{Estimate the size of a single split in a rerddap::griddap() request}
\usage{
estimate_griddap_split_size(size_est, splits, verbose = TRUE)
}
\arguments{
\item{size_est}{The list returned invisibly by estimate_griddap_size().}

\item{splits}{Named list of split counts per dimension.  Dimensions not
listed are assumed to have a split count of 1 (no split).}

\item{verbose}{Logical; print a summary (default TRUE).}
}
\value{
Invisibly, a named list with the total split count, per-split cell
count, per-variable byte estimates, total per-split bytes, and a
formatted size string.
}
\description{
Takes the result of estimate_griddap_size() together with a named list of
split counts per dimension and reports the estimated uncompressed size of
one split.  The total number of splits is the product of all split counts
(e.g. splits = list(time = 5, latitude = 2, longitude = 2) means 20 total
splits).  Per-split point counts use ceiling(n_pts / split_count) so
uneven divisions are handled correctly and estimates are conservative.
}
\examples{
\dontrun{
  library(rerddap)

  myURL = 'https://coastwatch.pfeg.noaa.gov/erddap/'
  response <- try(httr::HEAD(myURL, httr::timeout(10)), silent = TRUE)
  if (inherits(response, "try-error")) {
     stop("The ERDDAP\u2122 server is not responding")
  }
  wind_info <- info("erdQMekm14day", url = myURL)
  sz <- estimate_griddap_size(wind_info,
    latitude  = c(20, 40),
    longitude = c(-140, -110),
    time      = c("2015-01-01", "2016-01-01"),
    fields    = "mod_current")

  estimate_griddap_split_size(sz,
    splits = list(time = 5, altitude = 1, latitude = 2, longitude = 2))
}
}
