How to Upload Personal Data Tables in Gee

Overview

Educational activity: five min
Exercises: ten min

Questions

  • What are the fundamental features of the online code editor?

  • Where can I go for assistance while learning GEE?

  • How do I search for and import datasets?

  • How do I create, share and save scripts?

Objectives

  • Go oriented to the tools available in the code editor

  • Load an image drove and filter it to a relevant epitome

  • Create a study area using Geometry tools

Code Editor Overview

GEE has an integrated development environs (IDE) chosen the Code Editor. The Code Editor has number of features to help brand programming in this environment easier that we will explore in this tutorial. For an exhaustive clarification see the Earth Engine Lawmaking Editor help page in the GEE User Guides.

Link to the full lawmaking we used in this lesson: https://code.earthengine.google.com/926160c96272a205b91b5ed7b68981ab

Exercise: Exploring the Code Editor

1. Getting Started

To access the Code Editor, blazon the post-obit url into your browser: https://code.earthengine.google.com A webpage programming interface like the i below should appear. The diagram below has annotations pointing to many of the functionalities we volition cover today.

The JavaScript Lawmaking Editor window

Javascript code is typed in this window. The Editor also has a few helper functions, including autocomplete for Earth Engine functions, autocompletion for brackets, etc and some basic underlining and syntax hints.

For example, you can write comments by using a double slash. Type the following into your Editor and click the "Run" push.

                          // This is just a comment.                      

The Console tab

You can also employ print() to display things to the panel. Type this and click "Run":

                          // Print something to the console              print              (              "              Hola Mundo!              "              );                      

Autosuggestions

The Editor will marker statements equally incomplete i if you write them without a semicolon at the end. You can control these autosuggestions by going to the picayune grey wheel in the top right of the page and turning them on or off.

                          print              (              "              Hola Mundo!              "              );                      

two. Saving & Sharing Scripts

Saving Scripts

Relieve scripts by clicking the Save button. To include a commit bulletin, utilise the dropdown pointer and select "Save with a description." Messages are stored in the revision history of each saved script.

Note: If you didn't make any changes to the script, the Save button will be greyed out.

If you look at the top left panel, you tin see the script is now saved in your Scripts manager. You have three categories of scripts: individual, shared and examples. Each script is backed upward on Git. If you move your mouse over the name of the script, 3 icons will pop up that permit you to revert to older versions, rename or delete the script. Y'all can also make folders and click and drags scripts into those directories.

Note/Warning: If you rename a script, information technology's revision history disappears.

Sharing Scripts

You tin can share a static version of scripts by clicking Go Link. A url will appear in your browser address field. Share this link to give other people access to your code as it is. If you go on to make edits on this code, they will not update in the linked version. This option is useful to share examples and code snapshots with others.

            **Hot Tip: When posted on the help forum, Always include a link to your code so people can assist troubleshoot. Be sure all personal avails you employ are publicly shared so the script volition run for others.**                      

Joining the shared repository

To collaborate interactively on shared scripts with other users, yous tin can create a shared folder, invite your collaborators and place scripts in that folder. Nosotros accept created a shared binder for geohackweek2019.

You should have already accessed the shared code repository in the Code Editor with the following steps:

  • Bring together our Google grouping to access the shared code repository past clicking this link https://goo.gl/maZwVa. Don't worry nearly posting permissions; we won't be posting annihilation.
  • Accept the shared repository by clicking this link: https://code.earthengine.google.com/?accept_repo=users/victorialy/geohackweek2019

  • In the code editor, go to the Scripts tab in the top left console, whorl down and aggrandize the "Shared" department. A directory called geohackweek2019 should announced with read-only versions of the full scripts from each episode.

Any updates will exist reflected in these versions of the code. Like all GEE scripts, these are version controlled. Read or write permissions for individuals or groups tin can exist set in the Code Editor using the little grayness share icon that appears to the correct if you move your mouse over the directory name in the Scripts tab. You should take read-only access to this repo.

three. Accessing Datasets from Google'south Cloud

Search toolbar: Finding datasets and loading them as ImageCollections

To query the GEE data catalog, you can enter key words into the search toolbar at the top of the code editor.

For practice, let's load some imagery into the code editor. We are going to search for and import the Landsat Elevation of the Atmosphere (TOA) Reflectance Collection 1 Tier 1 product.

  • To do this, go to the Search toolbar and type in Landsat viii tier ane TOA.
  • Select the dataset - USGS Landsat 8 Collection 1 Tier 1 TOA Reflectance - by clicking on the name. This will bring up the metadata for this data collection. You can confirm you got the correct 1 because the ImageCollection ID should say LANDSAT/LC08/C01/T1_TOA
  • Now, click Import in this pop out. A new variable (ImageCollection) volition load into your Code Editor in the "Imports" pane at the superlative of the code editor.
  • Rename this object "L8_TOA". This object is an ImageCollection, which ways it is a stack of images. Notice we have to declare this object using var. If yous click the little blue square icon to a higher place the collection, a pop-out will appear showing the lawmaking yous merely created.
                          var              landsat8Collection              =              ee              .              ImageCollection              (              "              LANDSAT/LC08/C01/T1_TOA              "              )                      

In order to look at the collection, effort to print it simply like you did the string.

                          print              (              landsat8Collection              );                      

What happens?

Earth Engine times out - this means your request is too big, which makes sense equally there are thousands of images in the Landsat eight collection. To get around this, endeavour the following:

                          print              (              landsat8Collection              .              limit              (              five              ))                      

This will testify you lot just the get-go v images and so you tin can preview the collection. Yous can see the collection ID, the bands, the features, which are the images in the collection and the backdrop, which is the metadata.

Note: The developers are always adding not bad new functionalities to the GUI so we don't take to code. As a result, sometimes there volition be a point-and-click method to do something that tin can also be accomplished by writing a line or two of code. The 'import' office is a cracking example of this considering you lot can import a collection using either the "Import" button on the metadata or the 'ImageCollection' command written in JavaScript. Aforementioned thing, two ways.

Selecting a study area using Geometry Tools

The geometry drawing tools located on the upper left side of the map viewer tin can be used to manually create points, line or polygons. We are at present going to define a study area using a point we select on the map. We volition utilize the Geometry Tools to create that point.

  1. Type "Lake Powell, AZ" into the search toolbar and hit enter. This volition zoom you to Lake Powell in Arizona, Usa.
  2. On the left side of the map, click the little marker icon. Your cursor should then plough into crosshairs.
  3. Toggle around the map and drop the pin in the center of the lake, which is right adjacent to Lee Vining.
  4. Now, go to the Geometry Imports window that has now appeared. In that window, proper name the point "roi" and change the dropdown from Geometry to FeatureCollection.

You lot take now created a new point object and cast it as a FeatureCollection. You can now utilize this FeatureCollection equally a way to geographically filter datasets for but your region.

Having fun? You lot tin can further explore how to configure geometries in the Classifying Imagery department of this tutorial.

Filtering the Paradigm Collection

I of the major benefits of the JavaScript versus Python API is the ability to quickly render on-the-fly geovisualizations of your imagery and outputs. We are now going to visualize ane prototype from the Landsat 8 collection.

We are going to filter the drove down to one image by:

  • filtering it to our written report surface area nosotros defined with a point
  • filtering it down to just 1 twelvemonth of images (2018)
  • sorting the images past the overall cloud cover (least cloudy to most cloudy)
  • picking the top image (least cloudy)

Essentially, this allows us to sort through the full Landsat eight collection and load the best prototype available for our region of interest for 2018.

                          // Load Landsat 8 input imagery              var              image              =              ee              .              Image              ((              landsat8Collection              )              // Filter to get merely images under the region of involvement.              .              filterBounds              (              lakePowell              )              // Filter to get simply 1 year of images.              .              filterDate              (              '              2018-01-01              '              ,              '              2018-12-31              '              )              // Select but the optical bands              .              select              ([              '              B[1-7]              '              ])              // Sort by scene cloudiness, ascending.              .              sort              (              '              CLOUD_COVER              '              )              // Get the get-go (least cloudy) scene.              .              first              ());                      

Use a print statement to check out what nosotros just made:

                          print              (              paradigm              ,              '              Lake Powell L8 prototype              '              )                      

We have now filtered the Entire Landsat 8 annal down to the least cloudy image for our written report area in 2018. However, we nonetheless need to visualize it, which we will exercise using the Map.addLayer part.

Notation: Not sure what this role does? Search for it in the Docs tab to acquire the arguments.

                          Map              .              addLayer              (              prototype              ,{},              '              L8 Image              '              );                      

Layer Manager

That doesn't wait so swell. Permit'due south really define what bands to use and fill in some other visualization parameters using the layer manager. We volition use reflectance in the visible range from the red (Band iv), the green (Band iii) and the blue (Band 2) to make a true color image. We can use prior knowledge to make a dainty image:

                          Map              .              addLayer              (              image              ,              {              bands              :              [              '              B4              '              ,              '              B3              '              ,              '              B2              '              ],              max              :              0.v              ,              gamma              :              2              },              '              Amend L8 Epitome              '              );                      

More often then not, though, you may not know the optimal min, max and stretch. This is why they added the Layer Manager tool which can exist found in the upper right paw corner of the map. This toolbar will allow you to click layers on and off as well every bit adjust their transparency and interactively configure each layer's visualization parameters. You can use this tool to effigy out what parameters to pass to the Map.addLayer.

You tin besides toggle between the Map or Satellite buttons in the top right of the map panel to modify the baselayer.

For more on epitome visualization, run across the GEE Visualization Guide or the GEE Visualization tutorial

Inspector Tab

Some other manner you tin audit and explore your epitome is through the inspector tool. The Inspector panel allows you to interactively query the map. If you have imagery loaded, information technology will give yous information almost that imagery at the indicate you clicked as well.

In the upper right, switch to the Inspector tab and click on the map where there is land. Now click where in that location is water. Toggle the between the graph and the listing of values.

Cease & PLAY

On your own, play with the stretch parameters and use the Inspector to explore the map, clicking between state, bare world, wood and water.

If you already did that, y'all can play with dropping the point somewhere else and looking at a unlike image of your favorite place.

Y'all could also change the dates to look at a winter time image and see how the reflectance changes when there is snow on the ground.

iv. Getting Assistance

There are many entry points for getting help tucked into the Code Editor. Familiarizing yourself with these tools can aid soften the learning curve.

API reference (Docs tab)

Next to the Scripts tab is the Docs tab, which has the complete, searchable JavaScript API documentation for every function and call. The documentation is organized by GEE data blazon. Each data blazon has a specific set of functions that can be applied to it.

Help Button

The Assistance push is a gateway to many resource, including links to:

  • the Developers Guide for official GEE tutorials, reference and guides. This is the first place I go when I need to look up how to write some code.

  • the Help Forum where you can post questions and become answers. If I can't discover a guide for my specific question on the GEE Guides, I and then go search for key words from my trouble/question on the forum. Since people share links to their codes, y'all tin can often find dandy examples of solutions hither.

  • Existing tutorials and the Earth Engine for Higher Education resource written by the GEE team and others (fifty-fifty some in Japanese!)

  • A list of keyboard shortcuts

  • links to the Suggest a Dataset page

Examples in the Shared Scripts

A final place you can go help is by scrolling down and looking at the examples housed in the Shared Scripts in the Scripts tab.

5. Importing & Exporting Your Own Assets

Importing Images and Tables

As well using all of Google's amazing archives, users can also import their own data as either images (rasters) or tables (vectors). The Assets tab on the left is where you can import, share and manage these own assets. You tin can upload images or tables (vector information) here.

When posting on the forum, make sure you check the "Anyone Can Read" box on the sharing assets pop-out so folks on the forum tin all run your lawmaking. If you have a private asset and you don't make information technology public, other people will non be able to run your code. If yous don't want to share your private data, you can create a dummy case to share on the forums using manus drawn points or polygons.

For an instance script that uses imported data, see Episode 06 Time Series. For detailed instructions from Google on uploading, sharing and managing assets, run across the Avails Managing director page on the GEE website .

Exporting & the Tasks Tab

Instead of printing to the console, for larger tasks you may desire to simply consign the outputs to your Google Drive or Cloud Storage using the Consign functions in your code. When run, these generate a new task in the Task tab in the upper right console. You volition demand to then "Run" this chore in order to really get-go the export. In one case yous start an export job, you will exist prompted to enter details about the resolution, size, format and destination if you did not include this in your code. You can hover your mouse over the task and click the "?" icon to run into the status and as well to get the chore number. If your chore isn't executing, you lot tin can share this number as a reference on the developers forum.

We will do an instance tabular array export in Episode 3: Load Imagery of this tutorial.

For detailed instructions on exports, see the Exporting Information page on the GEE website. We volition likewise have small export examples in subsequent modules of this tutorial.

Enjoy!!!

Key Points

  • The Code Editor is a i finish shop for accessing GEE information itemize and conducting geospatial analysis.

  • You can use the lawmaking editor to develop, share and manage scripts.

  • You tin employ the code editor to import, consign, share and manage your own personal raster and vector datasets

  • Use the Docs tab, Example scripts and the HELP button to access the User Guides and Aid Forum


humphreydithemethen.blogspot.com

Source: https://geohackweek.github.io/GoogleEarthEngine/02-code-editor/

0 Response to "How to Upload Personal Data Tables in Gee"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel