How to Create a Timelapse of Satellite Imagery With Google ...
文章推薦指數: 80 %
How to Create a Timelapse of Satellite Imagery With Google Earth Engine and Streamlit · Draw a Region of Interest (ROI) on the map · Upload a ...
SkiptocontentGISLoungeMenuMenuHowtoCreateaTimelapseofSatelliteImageryWithGoogleEarthEngineandStreamlitQiushengWu|February2,2022December21,2021|GISLearningWanttocreateasatellitetimelapseforanylocationaroundtheglobetoseehowtheEarthhaschanged?You’vecometotherightplace.Ipresenttoyou…Aninteractivewebappforcreatingsatellitetimelapse withoutcoding!Inthispost,you’lllearnhowtocreateasatellitetimelapseforanylocationandtodeployanEarthEngineappto StreamlitCloud:Howtocreateasatellitetimelapsewithoutcoding:DrawaRegionofInterest(ROI)onthemapUploadaGeoJSONfiletothewebappSelectasatelliteimagecollectionSelectabandcombinationSelectanadministrativeboundaryCustomizetimelapseparametersAccessyourtimelapseinGIFandMP4formatsHowtodeployanEarthEngineapptoStreamlitCloud:Forkthestreamlit-geospatialrepoSignupforanEarthEngineaccountInstallGeoPandas,geemap,andStreamlitGetanEarthEnginetokenDeployyourapptoStreamlitCloudWanttojumprightin?Here’sthe webapp and repocode.Let’sgetstarted!Howtocreateasatellitetimelapsewithoutcoding1.DrawaRegionofInterest(ROI)onthemapFirst,navigatetoStreamlitforGeospatialApplications.Oncetheappopensinthewebbrowser,click“CreateTimelapse”ontheleftsidebarmenu.Youshouldseeamapontheleftandalistofoptionsontheright.PanandzoomthemaptofindyourRegionofInterest(ROI).Next,clicktherectangletooltodrawarectangleonthemap:DrawaRegionofInterest(ROI)onthemapandexporttheROIasaGeoJSON.Duetothelimitationofthe folium Pythonpackage,thereis nowaytoretrievethecoordinates ofdrawnshapesonthemap.Soyou’llneedtoexporttheROImanuallyanduploaditbacktothewebappforsubsequentsteps.Clickthe“Export”buttonintheupper-rightcornerofthemaptoexporttheROIasaGeoJSONfiletoyourcomputer.TheGeoJSONfileisaplaintextfilecontainingthecoordinatesofthegeometriesdrawnonthemap.UseanyTextEditortoopenandinspectthefile.2.UploadaGeoJSONfiletothewebappClick“Browserfiles”tolocatetheGeoJSONfileexportedinthepreviousstepanduploadittothewebapp.OryoucanuseotherexistingGeoJSON.Onceyouclickthe“Open”buttonontheopenfiledialog,theselectedGeoJSONfileshouldbeuploadedtotheappmomentarilywiththefilenamelistedunder“Browsersfiles”:UploadtheexportedGeoJSONbacktothewebapp.3.SelectasatelliteimagecollectionSelect“LandsatTM-ETM-OLI”fromthedropdownlist:Selectasatelliteimagecollectiontocreatetimelapse.Ichosethe Landsatprogram becauseit’sthelongest-runningenterpriseforacquiringsatelliteimageryoftheEarthsince1972.Themostrecentsatellite, Landsat9,wassuccessfullylaunchedon27September2021.The“LandsatTM-ETM-OLI”imagecollectioncontainsallavailableLandsatimageryacquiredsince1984.Ifyouwanttochooseadifferentimagecollectionfromthe EarthEngineDataCatalog,select“AnyEarthEngineImageCollection.”4.SelectabandcombinationLandsatimagerycomeswithmulti-spectralbands.HerearethecommonspectralbandsproducedbyLandsatTM,ETM+,andOLIsensors:SpectralbandsofLandsatsatelliteimagery.Todisplayandvisualizeanimageonacomputerscreen,decidewhichthreespectralbandsyouwanttousefortheRed,Green,andBlue(RGB)channels.SomeofthecommonlyusedbandcombinationsincludeNaturalColor(Red/Green/Blue),ColorInfrared(NIR/Red/Green),Short-WaveInfrared(SWIR2/SWIR1/Red),Agriculture(SWIR1/NIR/Blue),andGeology(SWIR2/SWIR1/Blue).ReadmoreaboutLandsatbandcombinations.Selectabandcombinationfromthedropdownlist.OrjustenterthetitleyouwanttoseeontheresultingLandsattimelapse:SelectaRGBbandcombination.5.SelectanadministrativeboundaryIfyourtimelapsecoversalargeregion,overlayitwithanadministrativeboundary.Selectitfromthebuilt-indatasets(e.g.,Continents,Countries,USStates)orselect“User-defined,”thenenteraHTTPURLfortheGeoJSONfile:Youcancustomizetheboundary’scolor,linewidth,andopacity.6.CustomizetimelapseparametersThe“Framespersecond”parametercontrolsthespeedofthetimelapse.Thesmallerthenumber,theslowerthetimelapse,andviceversa.Forexample,atimelapseofannualLandsatimagery(1984-2021)has38frames.At5framespersecond,thetimelapsewouldlast7.6seconds.Bydefault,theappusesallavailableimagerytocreatethecomposite.Youcanchangethestartyear,theendyear,thestartmonth,andtheendmonthifyouwantaspecifictimerange.SinceLandsatsatellitescarryopticalsensors,youmightseecloudsinLandsatimagery(especiallyinthetropics).Bydefault,theappappliesthe fmask algorithmtoremoveclouds,shadows,andsnow.Thiscancreateblackspots(nodata)inyourtimelapse.Youcanalsochangethefonttype,size,andcolortocustomizetheanimatedtimestamps.Whenfinishedwithallparameters,click“Submit”:7.AccessyourtimelapseinGIFandMP4formatsYoucannowaccessyourtimelapseasaGIForMP4animationin60seconds.Right-clicktheimage/videotosaveit,thenshareitwithyourfriends,family,oronsocialmedia!ExamplesofTimelapseSatelliteImageryThefollowingvideohighlightsafewtimelapseexamplesfeaturing:RiverdynamicsofUcayaliRiver,Peru–CreatedusingLandsatimagery(SWIR1/NIR/Red)VegetationdynamicsinAfrica–createdusingmonthly MODISNDVIdataNortheastPacificcycloneinOctober2021–Createdusing GOES-17CreekFireinCaliforniainSeptember2020–Createdusing GOES-17Temperaturedynamicsattheglobalscale–Createdusing MODISLandSurfaceTemperatureWantmoreexamples?Usehashtags #geemap and #streamlit tosearchonTwitterandLinkedIn.HowtodeployanEarthEngineapptoStreamlitCloud1.Forkthestreamlit-geospatialrepoForkthe streamlit-geospatial repotoyourGitHubaccount.Itcontainsthesourcecode(>1000lines)ofthemulti-pagewebappforvariousgeospatialapplications.Youcanfindit here.2.SignupforanEarthEngineaccountSignup fora GoogleEarthEngine account.Onceyougettheemail,logintothe EarthEngineCodeEditor toverifythatyouraccounthasbeenauthorizedtouseEarthEngine.3.InstallGeoPandas,geemap,andStreamlitInstallGeoPandas,geemap,andStreamlitPythonpackages.Ifyouhave Anaconda or Miniconda installedonyourcomputer,youcancreateafreshcondaenvironmenttoinstalltherequiredpackagesusingthefollowingcommands:condacreate-ngeepython=3.8
condaactivategee
condainstallgeopandas
pipinstallgeemap4.GetanEarthEnginetokenType python intotheterminalandpress“Enter”togetintothePythoninteractiveshell.Thentype importee and ee.Authenticate() andpress“Enter”:importee
ee.Authenticate()AuthenticateGoogleEarthEngine.LogintoyourGoogleaccounttoobtaintheauthorizationcodeandpasteitbackintotheterminal.Onceyoupress“Enter,”anEarthEngineauthorizationtokenwillbesavedtoyourcomputerunderthefollowingfilepath(dependingonyouroperatingsystem):Windows:C:\\Users\\USERNAME\\.config\\earthengine\\credentials
Linux:/home/USERNAME/.config/earthengine/credentials
MacOS:/Users/USERNAME/.config/earthengine/credentialsNavigatetotheabovefilepathandopenthe credentials fileusingaTextEditor.Copythetokenwrappedwithinthedoublequotestotheclipboard:TheEarthEnginetoken.5.DeployyourapptoStreamlitCloudTodeployyourapp,clickthe“Newapp”buttonintheupper-rightcornerofyourStreamlitworkspaceat https://share.streamlit.io,thenfillinyourrepopath(e.g.,USERNAME/streamlit-geospatial),branch(e.g.,master),andmainfilepath(e.g., app.py).Goto Appsettings-Secrets andset EARTHENGINE_TOKEN asanenvironmentvariableforyourwebapp.Click“Save”:Dependingonthenumberofdependenciesspecifiedin requirements.txt,theappmighttakeafewminutestoinstallanddeploy.Oncedeployed,you’llseeitsURLinyourStreamlitCloudworkspace.It’llfollowastandardstructurebasedonyourGitHubrepo,suchas:
延伸文章資訊
- 1Timelapse - Google Earth Engine
Earth Engine combines a multi-petabyte catalog of satellite imagery and geospatial datasets with ...
- 2Use Google Earth Timelapse to witness planetary change
Our Google Earth Timelapse highlights planetary changes. See how Google is taking climate change ...
- 3Google Earth Timelapse: Observing change
Observe how the earth has changed over the course of the last 35 years. Google Earth Timelapse: O...
- 4來趟時光旅行!Google Earth 新增「Timelapse」功能 - INSIDE
而現在,Google Earth 即將增加全新維度——時間,透過Google Earth 中的「Timelapse」功能,過去37 年來累積2400 萬幅衛星照片所編製而成的互動式4D ...
- 5How to Create a Timelapse of Satellite Imagery With Google ...
How to Create a Timelapse of Satellite Imagery With Google Earth Engine and Streamlit · Draw a Re...