0

I'm trying to extract some part of a satellite Landsat-8 image. using another image.

I have the following satellite image:

satellite image-landsat8

and I want to keep only the areas from the satellite image which are highlighted as green in the other image in below. (white and green image is the crop data layer for the same location as my satellite image):

Crop Data Layer

Basically saying I want to keep the corresponding green areas in my original satellite image and delete the corresponding white areas from the original satellite image which is shown at top.

How can I do that?

3

The tool you're looking for is called 'Extract by Mask' in ArcMap, but other packages have equivalents

use Raster Calculator and enter this command:

Con("raster" == green_value, 1)

if you want to keep the original value:

Con("raster" == green_value, "raster")

you can replace == with other conditionals (e.g., >, <, >=, <=, !=)

**Replace green_value with the value that represents green, then use extract by mask with the new raster. Replace "raster" with the name of your raster layer -- keep the quotes.

  • Thank you , I tried it, but 'Extract by Mask' considers both green and white parts together as one image. – Mohammad Aug 4 '16 at 22:31
  • use Raster calculator and enter this command: Con("raster" == green_value, 1) -- replace "green_value" with the value that represents green, then use extract by mask with the new raster. updated answer with specifics – cartoscience Aug 4 '16 at 22:34
  • Thank you, it worked, it has all the digital numbers I wanted in it, but the final image turned out to be black and white!, any idea about that? – Mohammad Aug 6 '16 at 8:30
  • Check the file extension of your original file - when you use extract by mask give the output the same file extension instead of saving to a geodatabase by default. Then go to layer properties / symbology and import symbology from the original layer - you can try this before redoing the extract by mask. – cartoscience Aug 6 '16 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.