# R 3.3 compatibility:
importFrom("grDevices", "rgb", "convertColor", 'col2rgb')

importFrom("graphics", "axis", "legend", "mtext", "rect", "segments",
             "text", "plot")

importFrom("stats", "aggregate", "complete.cases", "na.omit", "as.formula", "splinefun", "weighted.mean")

importFrom("utils", "URLencode", "download.file", "object.size",
             "read.csv", "read.table", "setTxtProgressBar",
             "txtProgressBar", "write.table", "type.convert")

importFrom("methods", "slot<-", "as", "is")

importFrom(data.table,
           rbindlist,
           data.table,
           as.data.table,
           merge.data.table
           )

importFrom(DBI,
  dbGetQuery,
  dbConnect,
  dbSendQuery,
  dbFetch
)

importFrom(raster,
  readAll,
  raster,
  extent,
  ratify,
  "NAvalue<-",
  "dataType<-",
  levels
)

importFrom(sp,
  spTransform,
  CRS,
  proj4string,
  "coordinates<-",
  "proj4string<-",
  SpatialPolygonsDataFrame,
  SpatialPointsDataFrame,
  SpatialPoints,
  spChFIDs
)

importFrom(curl,
  curl,
  new_handle
)

importFrom(xml2,
  read_html,
  xml_text
)


importFrom(aqp,
  "depths<-",
  "site<-",
  site,
  idname,
  parseMunsell,
  diagnostic_hz,
  horizonDepths,
  "diagnostic_hz<-",
  restrictions,
  "restrictions<-",
  SoilTextureLevels,
  checkHzDepthLogic,
  munsell2rgb,
  rgb2munsell,
  horizons,
  "horizons<-",
  metadata,
  "metadata<-",
  hzidname,
  "hzidname<-",
  hzdesgnname,
  'hzdesgnname<-',
  hztexclname,
  'hztexclname<-',
  profile_id,
  aqp_df_class,
  'aqp_df_class<-',
  pbindlist
)

importMethodsFrom(aqp, "plot")
importMethodsFrom(aqp, "length")
importMethodsFrom(aqp, "nrow")
importClassesFrom(aqp, "SoilProfileCollection")

exportPattern("^[^\\.]")
