How to Create a Timelapse of Satellite Imagery With Google ...

文章推薦指數: 80 %
投票人數:10人

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:[username]/[reponame]/[branchname]/[apppath]Forexample,hereisthelongappURL: https://share.streamlit.io/giswqs/streamlit-geospatial/app.py.AndhereistheshortappURL: https://streamlit.gishub.orgWrappingupCongratulations!👏Youdidit!Youhavebuiltaninteractivewebappforcreatingasatellitetimelapse.You’rewelcometocontributeyourcomments,questions,resources,andappsas issues or pullrequeststothe streamlit-geospatialrepo.WanttolearnmoreaboutGEEandgeemap?Checkout https://geemap.org ,my article,andmy YouTubechannel forvideotutorials.Orgetintouchwithmeon Twitter or LinkedIn.Thanksforreading,andhappycoding! AbouttheAuthorQiushengWuisanAssistantProfessorintheDepartmentofGeographyattheUniversityofTennessee,Knoxville.HisresearchinterestsincludeGeographicInformationScience(GIS),remotesensing,andenvironmentalmodeling.Morespecifically,heisinterestedinapplyinggeospatialbigdata,machinelearning,andcloudcomputing(e.g.,GoogleEarthEngine)tostudyenvironmentalchange,especiallysurfacewaterandwetlandinundationdynamics.QiushengWuisastrongadvocateofopenscienceandreproducibleresearch.Hehasdevelopedandpublishedvariousopen-sourcepackagesforadvancedgeospatialanalysis,suchasgeemap,leafmap,lidar,whitebox-python,whiteboxR,andWhiteboxTools-ArcGIS.RelatedALookatGoogleEarthEngineTimelapseSatelliteImagery–ViewChangesonEarthoverTimeSharethisarticleFacebookTwitterPinterestLinkedInEmailPrintEnteryouremailtoreceivetheweeklyGISLoungenewsletter:ExploreMoreGISArticlesSubscribeFilloutyoure-mailaddresstoreceiveournewsletterEmail: Searchfor:RecentPostsHowtouseArcGISProandLandsat8ImagerytoCalculateChlorophyllIndexandGlobalEnvironmentalMonitoringIndexFindingGISDataandUsingQGIStoMapCavesGISinLandUsePlanningandSurveyingUsingGIStoMapFlyFishingDestinationsRemoteSensingforCarbonOffsettingQGISfromaGraduateStudent’sPerspectiveMappingHeatVulnerabilityfromSatelliteDataMappingtheEarth’sFreshwaterBodiesWhatisGIS?MapsUsingGISJobsEventsSubscribeContactClose



請為這篇文章評分?