Remote Sensing Foundations Module 2 Q&A: Sensors on the ground and in the sky

This page features troubleshooting questions students have asked for Remote Sensing Foundations Module 2 Q&A: Sensors on the ground and in the sky.

Question – Selecting multiple lines for comments with ctrl + /: I’m having trouble learning the shortcut on page 14. When I select several lines and hit ctrl + /, nothing happens. Maybe it’s my computer? Or I could be interpreting the instructions wrong. I don’t mind typing double / on each line, however I see how this shortcut could save time when debugging. Anyone have ideas?

Answer: This may be a Mac/PC thing. I am on a Mac and I highlight the block of code/text that I want to comment out and press ‘command’ + ‘/’. If I press it once it is commented out, if I press it again, it is uncommented. Basically ‘command’ + ‘/’ is a way to turn on and off code lines in your script.

Question- Java Syntax, Q & A: I’ve worked through the textbook tutorials and the option reading on Java code in the course materials. I’m still a bit confused about how to put things together. For example, I tried out the assignment on p. 18 since I’ve never coded in Java before. The doc tab shows two arguments for cat(string2), but I’m not sure where those arguments go. To me, it looks like cat(string2) only has one argument. In the explainer notes for cat, it names one of the arguments “this: string1”. What is “this”?

I got it to work with this code:

var mission = ee.String(‘Sentinel’)
var satellite = ee.String(‘2A’)
var missionName = mission.cat(satellite)
print (missionName)

To do this, I was kind of just modeling off of other things I saw. And I’d like to understand it better than that.

I think that maybe ee.String is the ee object (?) here, And then you add something to it by putting a period after something (what kind of thing?) and then it seems to work.

So, are the functions those things listed under Docs at the first level (e.g., ee.String with a drop down arrow by it)? And then the things you put after the period (not sure what to call them) are the things listed under the drop-down arrow? But ee.String is listed there, too? How do you use this period stuff to string things together? Do you always start with an ee.thing and then add the other stuff to it after periods?

Answer:

There are some great online resources that can do a far better job of explaining what these different java script code components are. Strings are one way of storing objects, typically information in text (with single or double quotes depending on their use/meaning) or number form (no quotes).

I think your code looks good and you made the assignment work! In it you were basically telling it that you had two pieces of information that you wanted to join together, and you used concatenate to join them. You could get the same result by using print(‘Sentinel2A’), but since that is just a string of text to print, it would not be stored or useable in another way, as it is if you create a variable to store it. Variables are also containers or information. They can be strings, text, numbers, equations, images, collections, and more. The ‘ee’ signafier just stands for Earth Engine…Google’s just putting it’s stamp on the javascript resources.

Here is a good resource that should help your understanding javascript in the context of GEE,

Question Bands to Colors: In the second chapter of the textbook, it says that bands 3, 2, and 1 and corresponded to red, green, and blue, respectively (I’m assuming), for Landsat 5. As well as NIR being band 4 and SWIR, band 5. Is this the case for all Landsat missions as well as multi- and hyperspectral sensors? Or does it differ from sensor to sensor?

Answer: Here (below) is a figure that might help. And an article. Essentially, band designations can and do vary between sensors, it is always a good idea to go into the EarthEngine data catalogue and read about which bands are which when you are looking at a new dataset. In the case of Landsat, for the most part the wavelength ranges that are common across sensors are the same but the band numbers can be different, depending on what is included in the two Landsat missions that you are comparing (i.e. Landsats 1-3 MSS are same but different from Landsats 4-5 MSS). In the figure I pasted (it’s also on the lecture slides) you can see that there are alot of similarities in band ranges of the different Landsat missions. The figure gives wavelength ranges for each of the

Finally, here is a fun band combination graph that highlights band differences between Landsat sensors.

Question Region of Interest: I’m curious whether you can import shapefiles to GEE, because I have used shapefile polygons for Lake Champlain sub-basins before in ArcGIS Pro.

Answer: Yes! You can definitely import shapefiles directly into GEE. Here is a link showing how. And you can definitely use remote sensing to track algal blooms! Here is a case study from 2012.

Question Share GEE Code: How do I share my GEE code link?

Answer: The way to produce a hyperlink of your script in GEE is to click “Get Link” at the top of your script (blue box). It is next to the “Save” button. Make sure you ‘get link’ AFTER you save your code because it will produce a link from the last code save. It’s basically sending bits of code that are a snapshot in time…So for instance, you might produce a code that can do one thing and then send a link to that. If you keep working on that script though, I won’t see updates unless you send a new link. I hope that makes sense!

Skip to toolbar