Performing geospatial analysis in R? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to stack rasters for ecological analysis?R - Crop a pixel image produced by spatstat with a boundary shapeExtract Raster from Raster using Polygon shapefile in RRead a table from an ESRI file geodatabase (.gdb) using RR will not read shapefile / file.exists returns trueCalculating average monthly rainfall from raster using shapefileDoes the inputs extent have to be identical for raster::intersect to crop a RGB GEOTiff?Extracting a polygon from slanted Sentinel satellite image using RCropping in a shape of catchment area (not rectangular) in RgIntersection error: linearRing not created
Example of compact Riemannian manifold with only one geodesic.
What is the role of 'For' here?
How do you keep chess fun when your opponent constantly beats you?
Can withdrawing asylum be illegal?
Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time?
Why not take a picture of a closer black hole?
Do warforged have souls?
Can I visit the Trinity College (Cambridge) library and see some of their rare books
ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?
Can each chord in a progression create its own key?
Using dividends to reduce short term capital gains?
How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?
Match Roman Numerals
Identify 80s or 90s comics with ripped creatures (not dwarves)
Windows 10: How to Lock (not sleep) laptop on lid close?
Do I have Disadvantage attacking with an off-hand weapon?
Do working physicists consider Newtonian mechanics to be "falsified"?
Button changing its text & action. Good or terrible?
Did the new image of black hole confirm the general theory of relativity?
What was the last x86 CPU that did not have the x87 floating-point unit built in?
Simulating Exploding Dice
should truth entail possible truth
Homework question about an engine pulling a train
Is this wall load bearing? Blueprints and photos attached
Performing geospatial analysis in R?
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to stack rasters for ecological analysis?R - Crop a pixel image produced by spatstat with a boundary shapeExtract Raster from Raster using Polygon shapefile in RRead a table from an ESRI file geodatabase (.gdb) using RR will not read shapefile / file.exists returns trueCalculating average monthly rainfall from raster using shapefileDoes the inputs extent have to be identical for raster::intersect to crop a RGB GEOTiff?Extracting a polygon from slanted Sentinel satellite image using RCropping in a shape of catchment area (not rectangular) in RgIntersection error: linearRing not created
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I obtained a rectangular sort of image when I subset shapefile on the raster image. I want to get exact irregular shaped image so that I can proceed my classification to that particular area (B is my raster image):
boundryfile<-readOGR(dsn="E:\FYP guide\SUPARCO 2013\Jamal Garhi",layer="Jamal Garhi")
B_crop<-crop(x=B,y=boundryfile)
r
New contributor
add a comment |
I obtained a rectangular sort of image when I subset shapefile on the raster image. I want to get exact irregular shaped image so that I can proceed my classification to that particular area (B is my raster image):
boundryfile<-readOGR(dsn="E:\FYP guide\SUPARCO 2013\Jamal Garhi",layer="Jamal Garhi")
B_crop<-crop(x=B,y=boundryfile)
r
New contributor
add a comment |
I obtained a rectangular sort of image when I subset shapefile on the raster image. I want to get exact irregular shaped image so that I can proceed my classification to that particular area (B is my raster image):
boundryfile<-readOGR(dsn="E:\FYP guide\SUPARCO 2013\Jamal Garhi",layer="Jamal Garhi")
B_crop<-crop(x=B,y=boundryfile)
r
New contributor
I obtained a rectangular sort of image when I subset shapefile on the raster image. I want to get exact irregular shaped image so that I can proceed my classification to that particular area (B is my raster image):
boundryfile<-readOGR(dsn="E:\FYP guide\SUPARCO 2013\Jamal Garhi",layer="Jamal Garhi")
B_crop<-crop(x=B,y=boundryfile)
r
r
New contributor
New contributor
edited Apr 7 at 11:05
PolyGeo♦
53.9k1782246
53.9k1782246
New contributor
asked Apr 7 at 6:00
user140064user140064
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
R and raster crops to a bounding box so you will need to also mask to only retain the area of interest. Mask works by setting values inside or outside of a shape to a value usually NA in this context.
See raster::mask command
New contributor
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
user140064 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318015%2fperforming-geospatial-analysis-in-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
R and raster crops to a bounding box so you will need to also mask to only retain the area of interest. Mask works by setting values inside or outside of a shape to a value usually NA in this context.
See raster::mask command
New contributor
add a comment |
R and raster crops to a bounding box so you will need to also mask to only retain the area of interest. Mask works by setting values inside or outside of a shape to a value usually NA in this context.
See raster::mask command
New contributor
add a comment |
R and raster crops to a bounding box so you will need to also mask to only retain the area of interest. Mask works by setting values inside or outside of a shape to a value usually NA in this context.
See raster::mask command
New contributor
R and raster crops to a bounding box so you will need to also mask to only retain the area of interest. Mask works by setting values inside or outside of a shape to a value usually NA in this context.
See raster::mask command
New contributor
New contributor
answered Apr 7 at 7:40
user140066user140066
1
1
New contributor
New contributor
add a comment |
add a comment |
user140064 is a new contributor. Be nice, and check out our Code of Conduct.
user140064 is a new contributor. Be nice, and check out our Code of Conduct.
user140064 is a new contributor. Be nice, and check out our Code of Conduct.
user140064 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318015%2fperforming-geospatial-analysis-in-r%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown