我自己还无法找到答案,但是有没有办法以编程方式访问Landsat 8卫星图像?
我知道我可以去USGS EarthExplorer搜索和浏览场景,甚至下载它们。但是由于两个原因,我不想将它们下载到自己的计算机上:我的互联网速度慢,我的笔记本电脑有散热问题。
因此,我认为我想将图像直接传输到“云”实例以进行数据处理。如果我可以下载并处理这些图像(也可以从USGS获得),我也很好。
我自己还无法找到答案,但是有没有办法以编程方式访问Landsat 8卫星图像?
我知道我可以去USGS EarthExplorer搜索和浏览场景,甚至下载它们。但是由于两个原因,我不想将它们下载到自己的计算机上:我的互联网速度慢,我的笔记本电脑有散热问题。
因此,我认为我想将图像直接传输到“云”实例以进行数据处理。如果我可以下载并处理这些图像(也可以从USGS获得),我也很好。
Answers:
我看到了来自developmentseed的博客文章,介绍了他们的命令行实用程序landsat-util。
在陆地卫星UTIL可以从GitHub被分叉并从源代码编译,除非您的操作系统提供它在一个二进制蓄势待发。
该博客将其简单描述为:
命令行实用程序,可轻松搜索,下载和处理Landsat图像。
您可以根据日期,云覆盖率百分比等进行搜索,立即下载或在下载后进行处理,例如pansharpen或将图像拼接在一起。
您可以在下载前预览图像。搜索命令为每个图像提供了指向缩略图的链接。
landsat search --cloud 4 --start "August 1 2013" --end "August 25 2014" country 'Vatican'
使用--pansharpen标志将花费更长的时间处理,但会产生更清晰的图像。
landsat search --download --imageprocess --pansharpen --cloud 4 --start "august 11 2013" --end "august 13 2013" pr 191 031
您还可以对先前下载的图像执行所有处理。
landsat download LC81050682014217LGN00
landsat process --pansharpen /your/path/LC81050682014217LGN00.tar.bz
这是具有更多信息的自述文件。
如何启动EC2或机架空间实例并安装EarthExplorer批量下载应用程序:
http://earthexplorer.usgs.gov/bulk/
您可以通过POST请求访问EarthExplorer服务,以编程方式提交作业:
http://earthexplorer.usgs.gov/subscription/submit/
您将需要提供standingRequestName,频率,subscription_start,subscription_end,search_start,search_end参数。这可以帮助您入门,但是感觉就像是后门,在EC2实例上运行的大量下载器应用程序将是一个更好而耗时的选择。
我打算这样做,因此我启动了一个Amazon EC-2实例并在其上安装了批量下载。但是据我所知,它是一个图形应用程序,而在文档《批量下载教程》中没有任何内容希望您可以在终端上使用它。
我在这里阅读了有关使用Curl的可能性,但它返回了403访问被拒绝
向USGS发送电子邮件后,官方答复是批量下载是进行大规模下载的唯一途径。
但是Mapbox的Charlie Loyd给我写了另一种可能性:
Google存储空间还镜像了许多Landsat存档。您可以安装其“ gsutil”(免费),然后列出该目录,该目录由传感器(例如L8为Landsat 8)和路径/行索引:gsutil ls gs:// earthengine-public / landsat /
我必须补充一点,当浏览路径和行时,请记住这是一个基于3的数字。例如,如果您需要路径210第40行,则必须浏览文件夹210,然后浏览文件夹040。
我写了一个bash脚本来做到这一点。请注意,您可以使用xdotool命令自定义代码段中的url和鼠标位置以及按钮单击。这是源代码:
通过:bash播放列表中的Everything Awesome YTC
#!/bin/bash
echo " "
sudo apt-get install xdotool -y
sleep 2
echo " "
echo "# NASA/NOAA/NHC Hurricane Satellite Imagery Bot [H.S.I.B]"
echo "# Coded by Scott Hermann "
echo "[ YouTube: https://www.youtube.com/user/postulatedstate/videos/ ]"
echo " "
# * * Instructions * *
# 1] Click on map to select area to monitor.
# 2] Set delay variable ( time between saves )
# The script will now refresh and save the images-
# -every X seconds, and save using the filenames
# filename-X.jpg; filename-X.jpg; etc..
export PS1="\e[0;30m[\u@\h \W]\$ \e[m "
# make black prompt - color code=[0;30]
chromsat_loop()
{
chromium -new-tab https://weather.msfc.nasa.gov
sleep 2
notify-send "Your browser will now open the NASA website. Select the section of earth to monitor via Satallite by clicking on it, and then enter Y or N (caps) into the terminal, or press the [Begin] button on the GUI."
echo " "
}
get_settings()
{
echo -n "Enter storm name: "; read stormname
echo -n "Season? [ Ex: 2017 ] "; read season
echo -n "Month "; read month
# echo -n "data"; <- remember ;
sleep 2
echo " "
echo "Checking to see if a database for hurricane $stormname of the $season season exist in the month of $month"
sleep 2
echo " "
# if dir $season = true then confirm
if [ -d /root/Desktop/$season ]; then
notify-send "The hurricane season exist in the database."
echo "The hurricane season exist in the database."
echo " "
else
echo "It doesn't appear that this season is in the database. I will create it for you."
mkdir /root/Desktop/$season
fi
# if dir $season/$month = true then confirm
if [ -d /root/Desktop/$season/$month ]; then
notify-send "The month entered has data in the database."
echo "The month entered has data in the database."
echo " "
else
mkdir /root/Desktop/$season/$month
fi
# if dir $season/$month/$stormname = true then confirm
if [ -d /root/Desktop/$season/$month/$stormname ]; then
notify-send "This storm is in the database."
echo "This storm is in the database."
else
echo "Adding the storm to the database."
notify-send "Adding the storm to the database."
echo " "
sleep 1
mkdir /root/Desktop/$season/$month/$stormname
fi
echo " "
sleep 2
echo -n "Enter data retrieval delay variable: ( 1200 = 20 minutes ) "; read delay
echo " "
sleep 2
echo " "
echo "1] Chromium"
echo "2] Firefox"
echo "3] Qupzilla"
echo "4] Modori"
echo " "
echo -n "Which Web-Browser are you using? "; read browser
if [ "$browser" = "1" ]; then
echo "Initializing NASA Data Transfer..."
chromsat_loop
fi
if [ "$browser" = "2" ]; then
echo "$browser set to Firefox"
fi
# End Of Function
}
get_settings
# Note: Calling functions in bash -> fun_ction
# Create 4 functions for the 4 browsers it will support..
ready_ornot()
{
notify-send "In 45 seconds, the script will begin data retrieval.. Go ahead and select the portion of the storm on the map that you wish to monitor. Save the first image to the directory on your desktop. It's listed under the year, the month, and the storm. From there, the bot will save the images to that folder."
echo "In 45 seconds, the script will begin data retrieval.. Go ahead and select the portion of the storm on the map that you wish to monitor. It's listed under the year, the month, and the storm. From there, the bot will save the images to that folder."
newloop=0
until [ "$newloop" = "45" ]
do
sleep 1
echo "Initializing data retrieval process in 45 seconds. @ $newloop second(s)...."
newloop=`expr $newloop + 1`
done
notify-send "Initializing data retrieval process.. "
echo "Initializing data retrieval process.."
echo " "
}
ready_ornot
begin_dataretr()
{
sleep 2
notify-send "@ Data Retrieval Function."
# url opened in new tab waiting
# variables=value; = NO space [x]-> var = 1<-(wrong)
forever=1
looper=1
while [ "$forever" == "1" ];
do
# refresh chromium page
sleep $delay && echo $delay # 60 for test; 1800=30 mins
# Save images after refresh;
# plug\/ looper \/ variable in filenames
# file1.jpg file2.jpg file3.jpg etc.
# <!--#!/bin/bash-> to be modified and completed * * * * * * * * * #!/bin/bash -!>
# CD to folder
# /root/Desktop/season/month/stornname
# ( that should make the save as file dialog box open in our folder )
echo " "
echo "Done sleeping.."
echo " "
# xdotool getmouselocation --shell
xdotool mousemove 765 438
# mouse positioned to click on save file box
# for loop through var to save file name as
sleep 1
xdotool click 1
# text box clicked and waiting.
sleep 1
xdotool key F5
sleep 7
xdotool mousemove 953 229
sleep 1
xdotool click 1
sleep 5
xdotool click 3
sleep 3
xdotool key Down
xdotool key Down
sleep 2
xdotool mousemove 983 261
sleep 1
xdotool click 1
sleep 1
# xdotool key Enter
sleep 1
xdotool mousemove 1146 763
sleep 1
xdotool click 1
notify-send "New data retrieval has been saved to database.."
# <!--#!/bin/bash-> to be modified and completed * * * * * * * * * #!/bin/bash -!>
done
}
begin_dataretr
# no () when calling functions.
# - - - - - - - only when def them.
https://github.com/olivierhagolle/LANDSAT-下载
对该脚本进行了一些调整(缩进问题和一些注释/变量为法文)对我非常有帮助。但是,它只能下载存档中已经存在的数据。因此,对于尚未处理的数据,您必须对其进行订购。我正在努力实现自动化,但起步很慢(因为我30分钟前才开始)。最终,我希望将数据下载到我的云服务器,但是现在我只是在桌面上对其进行测试(您只需指定一个输出目录,文件就会自动放置在该目录中)。
我也有兴趣下载可用的数据-特别是在丢弃之前将表面反射率数据(我告诉USGS,在丢弃之前将原始数据临时处理为表面反射率,尽管有些已存储在存档中)。如果您取得任何进展,请告诉我们。
Esta plataformaé简单!façadownload do KMl e abra-o no Google Earth。Pesquise um lugar e achara o路径/行(lugar central de possiveis图像)ponha o path / row que achou para lugar e ponha na plataforma。
Todas拍摄了对位aacale本地无主角的图像
谷歌翻译:
这个平台很简单!下载KML并在Google Earth中将其打开。搜索位置,然后找到路径/行(可能图像的中心位置),将找到的位置的路径/行放置在平台上。该位置的所有图像都会出现