# Tag Info

### On a map of the globe that is 1920x1080px, how big would each pixel be?

Assuming you are talking about a map of the world in Mercator Projection, Something like this: Then, You should know that not all pixels will represent the same area. There is a large amount of ...
• 3,346

### Counting number of unmasked pixels per image in collection using Google Earth Engine

To get to your end goal of filtering your clipped image collection by 10% or less cloud cover, I would write a function that: counts the number of unmasked pixels in the image counts the number of ...
• 1,058
Accepted

### How do I change the pixel size in GDAL without changing the extent?

Here's a quick script I put together to correct the cell size of a folder of GeoTiff rasters: import os, sys from osgeo import gdal from osgeo import gdalconst WorkingFolder = sys.argv[1] # first ...
• 25.6k
Accepted

### Calculate the average of neighbor pixels for raster edge

The easiest way is to combine numpy's NaN functions (in this case nanmean) and ndimage.generic_filter, like so: import numpy as np from scipy import ndimage m = np.array([[13, 21, 13, 8], ...
• 15.7k

### Shifting existing points (Shapefile) to the center of raster pixels

Pretty similar to @Erik's answer, but will also work with older versions of QGIS: Run Raster pixels to points on your raster: Run Snap geometries to layer: Choose your original points as input ...
• 34.5k

### Displaying row/column of point in raster using QGIS

You can use the "Value Tool" plugin for QGIS.
Accepted

### How big is a MODIS 250m pixel in reality?

Per https://lpdaac.usgs.gov/dataset_discovery/modis, the viewing swath width of MODIS is 2,330 km, thus a large portion of the image is off-nadir in some way. https://modis.gsfc.nasa.gov/about/...
• 3,706
Accepted

### Changing pixel's dimension (raster) on QGIS

You can use Raster - Projections - Warp and set output resolution to 10:
• 73.8k
Accepted

### Shifting existing points (Shapefile) to the center of raster pixels

If you would like to try a pyqgis solution in the Python console, you can use the script below. First, paste the code block into a blank editor in the Python console. Next you will need to edit 2 ...
• 21.7k

### Raster color is changed when clipped with a polygon in QGIS

I guess, it is an expected behaviour. QGIS changes the color scheme depending on min/max values of new raster. To keep the same scheme for the new raster: Right click on the former satellite image &...
• 77.1k

### Shifting existing points (shapefile) to the highest raster pixel value in 5m buffer

Here's an approach that will work, but whether it works for you is going to come down to the size of your raster dataset, which you haven't included in the question. First convert your raster data to ...
• 5,102
Accepted

### Setting pixel value from 0 to 10

Allow me to rephrase the question "change the pixel value from 0 to 10" as follows; if the pixel value equals 0, then change it to 10. if the pixel value is not 0, then keep the original ...
• 30.9k

### Shifting existing points (Shapefile) to the center of raster pixels

I suggest you run pixels to points, which will give you the point grid centered to you raster cells and should attach the raster values to the points. If you need some information attached to your ...
• 16.4k

### Calculating the number of points per raster pixel

you could try the function raster pixels to polygons. With the output of that, run count points in polygons where you end up with a poly dataset that has a field indicating the count of point that ...
• 1,176

### Raster color is changed when clipped with a polygon in QGIS

If this is something you do alot, you can also build a model to clip then apply a saved style: Export the style as a QGIS Layer style file Create a model which clip and then set the style using the ...
• 73.8k

### Finding maximum value on raster transect between two points using PyQGIS

You could do something like this: # get reference to project p = QgsProject.instance() # get raster layer raster = p.mapLayersByName('dem')[0] # using the linestring from your example linestring = ...
• 17.3k
Accepted

### Is it possible get pixel value with only PyQGIS and not GDAL?

Yes, it is possible to get pixel values without gdal; only PyQGIS. Easier way is with a QgsRasterBlock object. This is the code: layer = iface.activeLayer() #in my case, a 20x20 raster provider = ...
• 30k

### Creating direction raster in QGIS

In theory this should be possible using either GRASS r.mapcalc or SAGA raster calculator. I'll assume you have a single origin point for this. However I've not been able to get this to work, but I'll ...
• 20.4k
Accepted

### How import many raster in r?

Solution 1 Create a loop to iterate through files: library(raster) raster_files <- list.files(mypath,full.names = T) #use pattern = '.tif\$' or something else if you have multiple files in this ...
• 13.7k
Accepted

### AWS Sentinel 2 incorrect cloudy pixel percentage

This a known anomaly - see anomaly #29 in the Sentinel 2 data quality report. https://sentinels.copernicus.eu/web/sentinel/missions/sentinel-2/data-quality-report
Accepted

### Inverting values of raster file using QGIS

Thanks to Mr. Stimson I used the expression 1000-(raster layer) to get the inverted raster result. I chose 1000 because it didn't have to be an exact invert and I didn't want negative numbers. I ...
• 820

### What does Zero pixel value in NDBI mean?

NDBI (like NDVI) is an index that can be useful to highlight built up areas, but it is not possible to use a single threshold to determine with 100% certainty if the observed land cover is built up. ...
• 49.7k
Accepted

### Understanding raster units

You are specifying the raster width/eight in terms of pixel, not the pixel width/height in terms of meters, so if the raster width is 10, it means the pixel size will be vector extent width divided ...
• 42.1k

### How to count the number of pixels with a specific value of a .gif file in QGIS

Simpler and faster with gdalnumeric (gdal+numpy): import gdalnumeric raster_file = gdalnumeric.LoadFile("/path/to/file.tif") pixel_count = (raster_file == 1).sum() # for pixel value = 1 print(...
• 380

### Rounding pixel values of raster in QGIS

Use Menu Processing / Toolbox / Round Raster: This algorithm rounds the cell values of a raster dataset according to the specified number of decimals.
• 71.6k
Accepted

### Blurring raster using ArcGIS for Desktop?

I would generate a new raster by right-clicking on the image in the Table of Contents and Data > Export Data. Then change the cell size to something much less detailed, e.g. 10m or 100m etc. to ...
• 29.7k
Accepted

### Measuring distances from each pixel center (in raster) to each point (in vector) in PyQGIS?

According to this question, How to calculate distance in meter between QgsPoint objects in PyQgis?, it's easy. You just need to return a QgsPoint with your function pixel2coord() : def pixel2coord(x,...
• 2,895

### Inverting values of raster file using QGIS

Invert values with QGIS Raster Calculator: -1 * "yourRaster@1" + MAX("yourRaster@1") but MAX() is not working properly according to some QGIS Bugs Reports. Instead of MAX() put ...

### Counting number of pixels using ArcGIS Spatial Analyst?

You can try Zonal Statistics as Table: Summarizes the values of a raster within the zones of another dataset and reports the results to a table. I belive one of the outputs will be pixel Count (per ...
• 73.8k