This function searches the USGS website for low-resolution Landsat 8 images of specified path and row number and plots the most recent image in georeferenced coordinates.
[I,ImageDate,R,h] = landsat(...)
landsat(WRS2path,WRS2row) plots the most recent available Landsat 8 image for World Reference System 2 (WRS2) path/row combination given by WRS2path, WRS2row.
landsat(...,ImageDate) specifies a search date to start from. By default, ImageDate is the current date, and the landsat function searches each day going back in time until a valid image is found. If you know an exact image date, enter that date instead as a string (e.g., 'January 5, 2014' or in Matlab's datenum format. If you enter an ImageDate as 'January 5, 2014', landsat will look for an image on that date, if no images exist on Jan. 5, it will look on Jan. 4, then Jan. 3, and so on until a valid image is found. Alternatively, if ImageDate is a negative scalar integer N, searching will begin with today, and skip or ignore the most recent N valid images.
I = landsat(...,'nomap') returns the Landsat 8 image I and the 'nomap' command specifies that no map will be created. If you do not have a license for Matlab's Mapping Toolbox, specify 'nomap'. You won't be able to make maps or get georeferencing information, but at least you'll get an image.
[I,ImageDate,R,h] = landsat(...) also returns a georeferencing matrix R, a handle h of plotted image, and the ImageDate in datenum format.
How this function works
This function requires an internet connection. Starting with any specified date, or the current date if no date is specified, landsat searches back through time, attempting to access Landsat 8 images on the USGS website. When an image is found, landsat will attempt to georeference and plot it.
Georeferencing by this function may not always be perfect, and images plotted by this function are of rather low resolution, so if accuracy or precision are important for your work, consider using Level 1 GeoTiff data instead.
Currently, this function only attempts to access Landsat 8 data. Functionality may be extended to other Landsat missions in the future. May not.
Chad Greene (2021). landsat (https://www.mathworks.com/matlabcentral/fileexchange/48726-landsat), MATLAB Central File Exchange. Retrieved .
I haven't used this, although it looks very nice. I'm using historical Landsat imagery (7 and 5) so it would be supremely useful if I could retrieve scenes from those datasets...
Yes, examples should be in HTML format. The markup syntax for publishing is the same as the syntax used on the Answers forum. More on publishing here: http://www.mathworks.com/help/matlab/ref/publish.html
By the way, my apologies for misspelling your name. I caught my mistake just after posting my December 12th comment.
great. Thank you. So the docs should be in HTML format. Thanks
Thanks for the feedback. Uploading documentation alongside functions is a three-step process:
1. Write an example-style script and use the publish command to create the html.
2. Compress the function, the example script, and the html folder into one zipped file.
3. Upload the zipped file to File Exchange. The File Exchange site automatically creates the little light bulb icon and links to the documentation.
Nice, One question though! How did you uploaded the documentation to File Exchange? I don't know how to do it.
Inspired by: zoharby/plot_google_map, LANDSAT ETM+ MTL parser, LANDSAT MSS/TM/ETM+ metadata (.MTL) Parser, scalebar for maps, geoimread, MODIS Mosaic of Antarctica, Antarctic Mapping Tools, geotiffinterp, parseLandSat8MetaData(filename), loadLandSat8(metaFileName,bandList)
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!