mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Add script function to easily add GIBS image layers to Earth
This commit is contained in:
@@ -48,6 +48,16 @@ openspace.globebrowsing.documentation = {
|
||||
"}" ..
|
||||
")"
|
||||
},
|
||||
{
|
||||
Name = "addGibsLayer",
|
||||
Arguments = "string, string, string, string, string",
|
||||
Documentation = "Adds a new layer from NASA GIBS to the Earth globe. Arguments " ..
|
||||
"are: imagery layer name, imagery resolution, start date, end date, format. " ..
|
||||
"For all specifications, see " ..
|
||||
"https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+Available+Imagery+Products" ..
|
||||
"Usage:" ..
|
||||
"openspace.globebrowsing.addGibsLayer('AIRS_Temperature_850hPa_Night', '2km', '2013-07-15', 'Present', 'png')"
|
||||
},
|
||||
{
|
||||
Name = "parseInfoFile",
|
||||
Arguments = "string",
|
||||
@@ -97,6 +107,14 @@ openspace.globebrowsing.documentation = {
|
||||
}
|
||||
}
|
||||
|
||||
openspace.globebrowsing.addGibsLayer = function(layer, resolution, format, startDate, endDate)
|
||||
if endDate == 'Present' then
|
||||
endDate = ''
|
||||
end
|
||||
local xml = openspace.globebrowsing.createTemporalGibsGdalXml(layer, startDate, endDate, '1d', resolution, format)
|
||||
openspace.globebrowsing.addLayer('Earth', 'ColorLayers', { Identifier = layer, Type = "TemporalTileLayer", FilePath = xml })
|
||||
end
|
||||
|
||||
openspace.globebrowsing.createTemporalGibsGdalXml = function (layerName, startDate, endDate, timeResolution, resolution, format)
|
||||
temporalTemplate =
|
||||
"<OpenSpaceTemporalGDALDataset>" ..
|
||||
@@ -332,5 +350,4 @@ openspace.globebrowsing.loadWMSServersFromFile = function (file_path)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user