Questions tagged [raster]
Raster is a data format consisting of regular grids of values, usually stored in an image-like format.
9,147
questions
0
votes
0
answers
9
views
Masking a raster twice using a shapefiles in rasterio
I want to mask my raster using two different shapefiles using rasterio.mask.mask and providing the output of the first mask into the second mask like this:
cut_out = rasterio.mask.mask(...
5
votes
1
answer
864
views
Merging many rasters with Python script within QGIS using GDAL?
I have many rasters that im trying to combine in order to produce contours. They are in the .bil format so I understand that i need to translate them using gdal first but none of my attempts have ...
0
votes
0
answers
14
views
Extracting part of raster with smaller raster using GDAL
I have a raster file with the extent of
[-169.04000663757324, 42.95999826798774, -54.3399982452392, 9.76000022888184]
I want to extract part of this raster by bounding box of
(-148.966066831209, 64....
0
votes
1
answer
21
views
Stacking Landsat images of different directories using Python
I have different folders containing Landsat 8 bands. I want to stack them into a single raster file. ArcPy can not be downloaded. Is there any other way to do that?
I have this snippet for the code
...
1
vote
0
answers
25
views
Unable to import raster into geopackage in QGIS
Whenever I try to import a raster layer in the form of a geotiff into a geopackage in QGIS I just end up getting a black area with no values. Am I not importing the raster properly or do geopackages ...
1
vote
0
answers
17
views
Save scipy interpolations as a raster (GeoTIFF) format using Python
I am using scipy.interpolate (Python 3.9) to interpolate some data. However, after using a nearest neighbor interpolator, I need to save it as a raster (GeoTIFF) image, preserving the resolution of 0....
0
votes
0
answers
3
views
How to set number of columns with stack or brick or spatraster in rasterVis::levelplot?
If I have a spatraster with 6 layers, rasterVis::levelplot will give a 2 rows and 3 columns plot.
How can I change it to 3 rows and 2columns?
library(rasterVis)
library(terra)
f <- system.file(&...
8
votes
5
answers
10k
views
How to get hypsometric curve from elevation data?
I have my elevation data but cannot make an attribute table from it and so I'm not sure how to get any of that data into a table in order to make a hypsometric curve.
0
votes
2
answers
110
views
How to create custom tool via Python that selects by attribute, then outputs new feature classes
I am trying to create a custom tool via python script that selects features in multiple fc's within a feature dataset that are missing values, then from the selected features, creates two outputs: one ...
2
votes
2
answers
671
views
PostGIS: Change raster values depending on values from other raster
I have two rasters and I want to change all the values from "raster1" to 4, where they are larger than the values from "raster2" and to 0, where they are smaller.
So raster2 has only one value, which ...
1
vote
1
answer
92
views
Using mouse-over on raster surface to stream values to text file using ArcGIS Desktop?
This is a weird one. I have a user who wants to add a statistical surface to ArcMap and then mouse-over the raster surface and stream those values (z) to a text file. MouseTips can show underlying ...
1
vote
1
answer
252
views
Updating min and max values with ArcPy on stretched raster symbology in ArcGIS Pro?
I have a map I am making where all I want to do is change the source layer for a raster to a new layer. I would then like to apply the same symbology as the original layer, but change the min and max ...
0
votes
0
answers
108
views
PRISM gridded (.bil) file to county(.csv) conversion
I want to convert PRISM gridded temperature data from .bil to US county-level in CSV format. All together I need to do this for all daily files from 1981-2019. I am writing the following Python code ...
1
vote
1
answer
510
views
Horizontal Raster Stretch Legend
Using a blog page on Raster enhancement: The horizontal legend I have displayed my legend of a raster legend horizontally. However I have not been able to format the labels to align directly beneath ...
0
votes
0
answers
12
views
ETOPO1 ice sheet GeoTIFF not reprojecting (or appearing for that matter) in Albers conic equal area north Asia [closed]
I am new to and using QGIS for my own amusement.
I downloaded the grid ice sheet GeoTIFF from ETOPO1 and want to reproject the file to Albers north Asia conic. But every time I do that the image ...
2
votes
1
answer
697
views
Using raster image fill and simple fill together in QGIS symbol selector
In ArcMap I have USGS BMP files for geological lithology patterns to fill a polygon. When I choose Picture fill symbol and add one of this BMP files then as a second fill layer I choose simple fill ...
0
votes
1
answer
57
views
R terra: [crop] SpatRaster has no values
I am attempting to use terra::crop() to crop 30 meter NLCD raster data to a bounding box. The final error that R returns is:
Error: [crop] SpatRaster has no values
despite the raster data containing ...
15
votes
5
answers
20k
views
Looking for QGIS equivalent of ArcGIS "Shift" tool
I'm looking for a tool or a plug-in for QGIS that would allow me to shift rasters to new coordinates. An equivalent of "Shift" tool in ArcGIS would be the best option.
I know I can edit the ...
3
votes
3
answers
4k
views
How to translate (reposition) a raster in Python?
I tried to use QGIS GeoReferencer to translate a raster layer, but somehow failed. It just goes to somewhere unexpected.
Now I decide to do it myself, with python. I think some libraries like GDAL ...
6
votes
2
answers
2k
views
How to shift a raster using QGIS?
I would like to shift a raster by a specified distance in x and y.
I tried to create a world file, as is suggested here, but neither Raster: Conversion: Translate in QGIS nor GDAL Conversion ...
0
votes
0
answers
15
views
Merging .asc without conversion to GeoTIFF
I have a lot of LiDAR data in the format of .asc, however not all of the data is needed for my study area. To get just the data I want, I have merged the .asc files before clipping them with a mask ...
0
votes
1
answer
34
views
Raster function with condtional function
I have two raster layers and a function sand.tif, clay.tif and def soiltexturalclass(sand,clay):. The function is a conditional function which can be viewed here.
The goal is to create an output ...
0
votes
1
answer
21
views
How to export(writeRaster) single raster from multi-band stack/brick/spatraster one by one using R?
library(terra)
a=rast(nrows=10,ncols=10,vals=1:100)
b=rast(nrows=10,ncols=10,vals=1:100)
c=rast(nrows=10,ncols=10,vals=1:100)
test <- c(a,b,c)
for (i in 1:3)
{
r=test[[i]]
writeRaster(r,...
0
votes
0
answers
9
views
How to mask raster based on multiple band values using GDAL?
Let's say I have a 3-band raster and I want to mask it based on the band combination of all three bands.
For example I want to mask all pixels in all bands (set to NA) where Band1=0 AND Band2=1 AND ...
0
votes
1
answer
199
views
Combining .tif files into multidimensional mosaic raster for analyzing change using ArcGIS Pro
I have a bunch of .tiff files with lichen cover data, one for each three year period from 1986 to 2021, and I want to use either (or both) the Analyze change using LandTrendr/CCDC tools in ArcGIS Pro ...
3
votes
1
answer
1k
views
Why does Save as "Rendered Image" change the raster styling?
Rasters exported from QGIS (via Save As > Rendered Image) do not retain original styling. See attached. Any thought on how to prevent this error? The top image is exported from QGIS as a .bmp, the ...
0
votes
1
answer
7
views
What raster format can be recognized by time slider in ArcGIS Online?
I'm trying to build a time slider on ArcGIS Online with raster datasets. I learned that I need to convert raster to tile package to upload to ArcGIS Online. However, after I upload it, the files ...
0
votes
0
answers
12
views
How to download rasters from an ArcGIS image service when "Download Rasters" is grayed out?
I am trying to download individual rasters from an ArcGIS image service. The data is offered by ArcGIS Online as a .pitem or .pitemx file to be opened in ArcMap or ArcPro (respectively). The rasters ...
0
votes
0
answers
12
views
"Error 4" when trying to convert vector data to raster data: QGIS 3.22.7
I am using QGIS 3.22.7, and I am trying to convert this WKT csv file (download size: 2.67 KB) into a raster file using the "Rasterize (Vector to Raster). The projection is EPSG:3721. However, I ...
0
votes
1
answer
253
views
xarray NetCDF with groups to GeoTIFF
I am trying to convert NetCDF files, available from this link, to raster or geotiff files using Python 3. After reading the a NetCDF file using the package netcdf4, it appears to have groups: CO2, ...
3
votes
1
answer
238
views
Creating ArcGIS Raster Catalog with date/time fields from directory of NITF images?
I have a directory of NITF files, each with the idatim (timestamp) field set. In the ArcMap properties, it shows up as "acquisition date" in the Key-Metadata table. I would like to be able ...
2
votes
1
answer
184
views
QGIS Raster layer query elevation at point
In QGIS 3.14 I try to get elevation data from denmarks elevation model using "kortforsyrningen" plugin. The elevation model (layer name = 'DHM/Terræn') is added as a raster layer (...
1
vote
1
answer
426
views
Rasterio creating composite/stack much larger than the individual bands
I am using rasterio to create a stack of eight bands and each individual band is about 1GB, but when it's stacking them the output (with a lzw compression) is a tif that's over 53GB! This seems huge ...
0
votes
1
answer
26
views
Yearly Temperature using WorldClim in R [closed]
I have around 150 types of seeds that I am analyzing climate data for. Each seed has GPS coordinates of where it was collected and the year collected. I am trying to use WorldClim in R to figure out ...
2
votes
1
answer
38
views
How can I convert a continuous raster into a discrete (categorical) raster using QGIS?
I am using QGIS 3.22.7, and I wish to classify a continuous raster with one band into 5 discrete categories based on raster values. The raster I am working with can be found here (file size: 874 KB). (...
1
vote
0
answers
26
views
How to ensure that two rasters are using the same FID or that they are the same pixel?
I am doing a Dasymetric analysis for my study area. It is through a toolbox for ArcMap.
It needs a base raster that has Landcover classification based on urban form and redistributes the population ...
0
votes
1
answer
24
views
Trouble overlaying plots in R
I've produced a raster using IDW to make predictions across California, and now I'm trying to overlay the raster image with the border/shapefile of California.
I've ensured the CRS projections are the ...
1
vote
3
answers
35
views
Calculating the edge pixels within a fishnet
I have a raster with three land cover classes.
For a fishnet grid cell, I want to calculate how many pixels (in %) are "edge pixels" (pixels from different land classes that touch). E.g., if ...
0
votes
0
answers
23
views
Besides the rasterVis package, is there any other way to make plots with marginal graphics?
Besides the rasterVis package, is there any other package to make plots with marginal graphics?
The rasterVis package is based on the lattice package, but I know nothing about the lattice package. So ...
1
vote
0
answers
23
views
Recursively mosaic rasters by directory (year) in R
I have hundreds of rasters spanning 10 years, files are stored by year (e.g., 2020, 2019, 2018, etc.). I would like to mosaic all the raster files within a directory, move to the next directory and ...
0
votes
1
answer
24
views
QGIS - How to check if a raster has same resolution as another raster with a different CRS?
I have an original raster file called SAM. This has a resolution of 0.0025 pixels, it was obtained using 100m resolution satellite. I have another raster called Global fire. This has a pixel ...
1
vote
0
answers
26
views
QGIS - Resolution issue
I have 2 images. One of them was using a custom CRS that had pixel of 463m. I used warp(reprojection) on this and used the epsg4326 CRS. This then converted the image from 463m pixel to 0.00205 pixels....
2
votes
1
answer
449
views
Zonal Statistics on discrete values in raster using ArcGIS for Desktop?
I am using ArcGIS 10.3 for Desktop.
I am using Corine Land Cover raster data for Southern European Countries, this data gives discrete values to particular land uses (e.g. 1 = agricultural land, 2= ...
0
votes
1
answer
170
views
Raster into PolyLine with Python [closed]
I have got a binary raster and I want to create a shapefile with PolyLines based on this raster. The only success I achieved is a shapefile with Polygon geometry (below). I did it with rasterio and ...
0
votes
1
answer
26
views
gdal2tiles.py Differs from Original Raster
When comparing in QGIS the output of gdal2tiles.py to the raster from which the tiles were generated there is a clear difference.
In this image Pink is the gdal2tiles.py output, green is the original ...
0
votes
1
answer
118
views
Error saving .asc bias file in R
I used the following code to create a bias file in R for MaxEnt. I am able to create the bias file, but I am not able to save it as ascii (see error message). My lat/lon csv file contains only points ...
0
votes
0
answers
10
views
QGIS2Web for MapBox output - png file displays upside down
I am using QGIS2Web to generate web maps from data in Ireland. I have gone through this process with leaflets, but now I am trying Mapbox output. The 'background' is a raster file of hillshading. I ...
1
vote
3
answers
76
views
How to subset a raster stack by year with a loop in R?
So I have a folder with loads of .tif files showing NDVI. What I want to do is read them into a rasterStack, then subset that stack by year. I've been able to do this manually, but I'd really like to ...
1
vote
2
answers
2k
views
reading rasters in r using terra package
Using the R terra package for the first time after many years using the raster package. Stuck on the basics.
Trying to read DEM raster into r and reproject it. The raster is in ESRI grid format and ...
0
votes
1
answer
826
views
Projecting rasters in r terra package
I would like to project a raster using a shapefile read in via the "vect" command. I have made the following work:
r <- rast(xmin=-110, xmax=-90, ymin=40, ymax=60, ncols=40, nrows=40)
r3&...