local globeIdentifier = asset.require("../../earth").Earth.Identifier


local Name = "ETOPO2: Bathymetry"
local Identifier = "noaa-sos-land-etopo2-landsat"
local Description = [[Many datasets have been created by utilizing the ETOPO2 dataset, 
which was generated from digital data bases of seafloor and land elevations on a 2-minute 
latitude/longitude grid (1 minute of latitude = 1 nautical mile, or 1.15 statute mile). 
The ETOPO2 is a combination of satellite altimetry observations, shipboard echo-sounding 
measurements, data from the Digital Bathymetric Data Base Variable Resolution and data 
from the GLOBE project which has a global digital elevation model]]
local URL = "https://sos.noaa.gov/catalog/datasets/etopo2-bathymetry/"


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

local layer = {
  Identifier = Identifier,
  Name = Name,
  Enabled = asset.enabled,
  FilePath = syncedDirectory .. "4096.jpg",
  Description = Description
}

asset.onInitialize(function() 
  openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer)
end)

asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globeIdentifier, "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/"
}
