Questions tagged [raster]

A rectangular array of pixels. A Raster defines values for pixels occupying a particular rectangular area of the plane, not necessarily including (0, 0).

A rectangular array of pixels. A Raster defines values for pixels occupying a particular rectangular area of the plane, not necessarily including (0, 0).

3658 questions
12
votes
1 answer

Why the values of my raster map change when I project it to a new CRS (projectRaster function in R)?

I need to project a map in latlong to an azimuthal equidistant projection. map_proj<-projectRaster(map, crs="+proj=aeqd +lon_0=48+lat_0=18") In my original map I have these values class : RasterLayer dimensions : 1713, 2185, 3742905 …
Oritteropus
  • 531
  • 2
  • 6
  • 18
12
votes
8 answers

Video equivalent of PNG?

For raster images there is: JPG is for natural scenes PNG or GIF for geometric scenes that are characterized by smooth colors, straight lines and gradients. For vector animation there is SVG And for raster video there are various MPEG codecs which…
shoosh
  • 76,898
  • 55
  • 205
  • 325
11
votes
1 answer

How do I use rasterio/python to mask a raster using a shapefile, to set the raster pixels inside the polygons to zero?

I am trying to create a land mask to apply to satellite imagery, that will set the pixels in a raster intersecting with a land mass to 0. After experimenting with gdal, skimage, pyplot etc. I've found the method given in the rasterio cookbook to be…
Cate
  • 431
  • 1
  • 7
  • 22
11
votes
1 answer

Rotation of facets in ggplot2

I think I have a tricky case. I'm plotting the evolution plant disease levels in time, using geom_raster: x and y are arbitrary field coordinates, and z is the disease level measured at several time points, and I want to have each date plotted in a…
11
votes
4 answers

Efficiently finding the largest surrounding square in 2D grid

In a game with a 2D grid map I'm facing the following situation: I need to find the largest bounding square that surrounds the player position (the red dot). Or at least a bounding square of maximum size, as there could be more. Note: square, not…
RocketNuts
  • 9,958
  • 11
  • 47
  • 88
11
votes
2 answers

Saving rgl 3D scene to u3d (for .pdf integration)

I have a 3D scene generated with the R rgl package. I can save it in RTL and OBJ format via the rgl functions, but these functions don't support colors. I can save it in WebGL, but then I can't find a WebGL to .u3d converter, nor any way to insert…
AF7
  • 3,160
  • 28
  • 63
11
votes
1 answer

R crop raster data and set axis limits

With your help in another thread I have managed to plot some global maps. First I convert meteorological GRIB2 data to Netcdf and then plot the global maps. Now I want to plot just a subregion of the map. I have tried crop command and succesfully…
pacomet
  • 5,011
  • 12
  • 59
  • 111
11
votes
2 answers

convert matrix to raster in R

I have a matrix data with spatial coordinates and one variable. The spatial resolution is 1000 meters. > str(dat1) > List of 3 > $ x: num [1:710] 302340 303340 304340 305340 306340 ... > $ y: num [1:1241] 5431470 5432470 5433470 5434470 5435470…
Jian Zhang
  • 1,173
  • 5
  • 15
  • 20
10
votes
2 answers

How to optimize Raster (Rasterizer Thread) as seen in the Chrome Dev Tools Performance tab?

I'm trying to understand why these Raster processes have such a long duration, but I'm finding the documentation to be sparse. From other people's questions, I thought it might be related to the images being painted, or javascript listeners, or…
Tom Hartman
  • 1,183
  • 2
  • 11
  • 18
10
votes
1 answer

Importing raster data into NetLogo results in a column with all patch variables = 0

When I use this code to import a raster layer into NetLogo and resize the world, all patch variables of the last column is zero when it should contain data. This happens only for a few rasters from the same landscape. set rasterLayer…
10
votes
1 answer

Pairwise correlation between raster layers in R

I need accomplish a pairwise Pearson correlation between 19 raster layers for Africa Continent extracted from WordClim database. I want to checking what are variables layers more correlated/significant to my model. For this i tried use the …
Ricardo Adelino
  • 165
  • 1
  • 1
  • 12
10
votes
3 answers

how to convert longitude from 0 - 360 to -180 - 180

The longitude in CMIP5 future climate data is in 0 - 360 degree. How can I convert it to -180 - 180 degree using the raster package? I tried with shift(r0,-180) and shift(r0,-360). It does not work. Any help will be appreciated. r0 here is a raster.
user1617676
  • 361
  • 1
  • 3
  • 12
10
votes
3 answers

Manipulate shapefile attribute table using R

I've posted this question on the GIS stack exchange, but it's not seeing much traffic. I'm a GIS user who's been using R for stats for a few years, and I'm excited to see a lot of new GIS capabilities being released (raster, shapefiles, rgdal,…
RichT
  • 304
  • 1
  • 3
  • 13
10
votes
3 answers

How to lighten picture in C# without actually iterating through all picture's pixels?

I'm having problem with lightening picture. I know I could do this by increasing/decreasing pixel's values, however it's not what I'm looking for. I've been told that there's a way that do not require to iterate through all pixels and that it is…
Patryk
  • 3,042
  • 11
  • 41
  • 83
10
votes
1 answer

How can I create raster mosaic using list of rasters?

I need to create several raster mosaics. I'm using Package raster version 2.0-31 on a 64bits windows computer. I believe I did my homework checking through all possible blogs and asking this question to some colleagues, but still can't find a…
LuluPor
  • 165
  • 1
  • 11