Crop and Mask function in R studio

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
papita
Posts: 1
Joined: Thu Sep 30, 2021 11:29 am America/New_York

Crop and Mask function in R studio

by papita » Thu Sep 30, 2021 11:40 am America/New_York

Hi I was following the steps given in "Webinar: Introduction to Geospatial Analysis in R" for crop and mask function using the same data that was recommended for example "GrossEmissions_v101_USA_Fire.tif".
While i was performing crop and mask function none of the functions were able to remove the extraneous cell like it does when we use clip function in ArcGIS(the output image appeared in both cases as zoom out and zoom in version of each other). I'm attaching the outputs of both cases for reference.
Please let me know how could i remove the extra cell values outside vector boundary and get the result in same extent.
Attachments
This plot is masked.
This plot is masked.
Masked image.png (9.34 KiB) Not viewed yet
This plot is cropped.
This plot is cropped.
Cropped image.png (18.97 KiB) Not viewed yet

Tags:

ASDC - ingridgs
User Services
User Services
Posts: 59
Joined: Fri Apr 23, 2021 9:14 am America/New_York
Answers: 1

Re: Crop and Mask function in R studio

by ASDC - ingridgs » Thu Sep 30, 2021 1:09 pm America/New_York

Thank you for your question. A Subject Matter Expert has been notified and will answer your question shortly. Please stand by!

ORNL - jessnicwelch
Subject Matter Expert
Subject Matter Expert
Posts: 2
Joined: Mon Sep 13, 2021 11:55 am America/New_York
Location: Oak Ridge National Laboratory
Contact:

Re: Crop and Mask function in R studio

by ORNL - jessnicwelch » Fri Oct 01, 2021 2:36 pm America/New_York

Hi there, papita. I am looking into your issue and I hope to respond early next week.
Jessica Nicole Welch, PhD
ORNL DAAC | Remote Sensing and Environmental Informatics Group
Earth System Informatics and Data Discovery Section | Environmental Sciences Division
Climate Change Science Institute
Oak Ridge National Laboratory

ORNL - jessnicwelch
Subject Matter Expert
Subject Matter Expert
Posts: 2
Joined: Mon Sep 13, 2021 11:55 am America/New_York
Location: Oak Ridge National Laboratory
Contact:

Re: Crop and Mask function in R studio

by ORNL - jessnicwelch » Tue Oct 05, 2021 11:14 am America/New_York

Hello again,

Please use the following commands at the beginning of the tutorial and then run through the code again. I am updating the tutorial to reflect these changes. Let me know if this does not fix your issue.

Code: Select all

install.packages("sf", dependencies = TRUE)
library(sf)
Thanks,
Jess
Jessica Nicole Welch, PhD
ORNL DAAC | Remote Sensing and Environmental Informatics Group
Earth System Informatics and Data Discovery Section | Environmental Sciences Division
Climate Change Science Institute
Oak Ridge National Laboratory

Post Reply