local globe = asset.require("../../earth")



local Name = "Dams and Reservoirs: Mississippi River - 1800 - 2010"
local Identifier = "noaa-sos-land-dams-mississippi"
local Description = [[This dataset illustrates the construction of dams in the
Mississippi River Basin from 1800 to the present. We display all dams listed in the
Global Reservoir and Dam Database (GRanD). All dams that have a reservoir with a storage
capacity of more than 0.1 cubic kilometers are included, and many smaller dams were added
where data were available]]
local URL = "https://sos.noaa.gov/catalog/datasets/dams-and-reservoirs-mississippi-river-1800-2010/"


local syncedDirectory = asset.syncedResource({
  Name = Name,
  Type = "HttpSynchronization",
  Identifier = Identifier,
  Version = 1,
  UnzipFiles = true
})


local Layer = {
  Identifier = Identifier,
  Name = Name,
  Enabled = asset.enabled,
  Type = "ImageSequenceTileLayer",
  FolderPath = syncedDirectory .. "4096",
  Description = Description
}


asset.onInitialize(function()
  openspace.globebrowsing.addLayer(globe.Earth.Identifier, "ColorLayers", Layer)
end)

asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globe.Earth.Identifier, "ColorLayers", Layer)
end)

asset.export(Layer)



asset.meta = {
  Name = Name,
  Version = "1.0",
  Description = Description .. "Data provided by the National Oceanic and Atmospheric Administration",
  Author = "National Oceanic and Atmospheric Administration",
  URL = URL,
  License = "https://sos.noaa.gov/copyright/"
}
