Raster to Points
Sample raster values to a point grid
What Is Raster to Points?
Raster to Points is the operation of converting raster cells into vector point features, where each output point inherits the value (or values) of the underlying raster cell. The result is a point layer in which every point sits at the centre of a cell and carries the cell's value as an attribute. It is the inverse of point-to-raster rasterisation, and it is one of the standard tools in any GIS for moving from a continuous gridded surface back into a tabular point dataset that can be queried, joined and visualised as discrete features.
The Raster to Points tool on gis.tools loads a GeoTIFF and produces a GeoJSON point layer in the browser. People search for "raster to points", "raster to point qgis", "convert raster to points gdal", "extract raster values to points" and "sample raster grid" because converting a raster into vector points unlocks a whole range of operations that only work on vector data: attribute joins, statistical aggregation, time-series analysis, tabular export, machine-learning training sets and more.
The tool also supports two adjacent operations: sampling a raster at a user-supplied point layer (extract values at points) and generating a regular point grid over a polygon and reading raster values at each grid node. All three are conceptually similar β they convert raster cells or sample locations into a feature collection.
How Raster to Points Works
The basic algorithm is straightforward but the details matter for performance and correctness.
Cell-to-Point Conversion
For each cell in the input raster, the tool computes the geographic coordinate of the cell centre using the affine transform, reads the cell value (one per band), and emits a Point feature with the value as an attribute. A 1000x1000 raster produces one million points; cells with nodata are usually skipped.
Sampling at User Points
If you provide a point layer instead of asking for every cell, the tool inverts the affine transform for each point, looks up the row/column index, and reads the value. The output is your original point layer enriched with one new attribute per band.
Grid Sampling
A regular point grid is generated over a bounding box or clip polygon at a user-specified spacing. Each grid point inherits the raster value at its location. This is a downsampled version of the cell-to-point conversion that gives you control over the output density.
Multi-Band Output
For multi-band rasters, each output point carries one attribute per band. NDVI, RGB and multispectral inputs all work.
Nodata Skipping
Cells where the raster value matches the nodata sentinel are excluded from the output by default.
Key Parameters and Options
Conversion Mode
Choose between:
- All cells: every non-nodata raster cell becomes a point. Heavy on point count.
- Regular grid: generate points at a specified spacing over the raster extent.
- At input points: sample the raster at user-provided point locations.
- Within polygon: restrict the output to cells inside a clip polygon.
Sampling Method
Nearest neighbour returns the cell value at the cursor location β correct for categorical data. Bilinear returns a weighted average of four neighbouring cells β appropriate for continuous data when sampling at sub-pixel positions.
Grid Spacing
For grid mode, specify the spacing in raster units (typically metres). A coarser grid produces fewer points but loses spatial resolution.
Skip Nodata
By default, nodata cells are skipped. Toggle off to retain them as null-attribute points.
Output Format
GeoJSON, Shapefile, GeoPackage or CSV with lon/lat columns.
Practical Applications
Environmental Sampling Design
A field ecologist needs to plan vegetation transects in a study area covered by a continuous canopy-height raster. They generate a 100 m regular grid of points within the study polygon and read the canopy height at each. The resulting point layer is used to stratify random sample selection by canopy class.
Machine Learning Training Data
A remote sensing analyst is training a random forest classifier to predict crop type from Sentinel-2 bands. They have known crop labels at a few hundred field points. They use raster-to-points sampling on each Sentinel-2 band raster, joining the band values to the training points. The resulting tabular dataset feeds directly into scikit-learn or TensorFlow.
Time Series Extraction
A climate scientist wants the daily temperature time series at 1000 weather station locations across Europe. For each daily temperature raster, they sample at the station points and export to CSV. Stitching the CSVs together produces a tidy time-series dataset for downstream analysis.
NDVI Profile Across a Field
A precision-agriculture analyst wants the NDVI profile along a single transect line through a maize field. They generate equally spaced points along the transect and sample the NDVI raster, producing a 1D profile they can plot in Excel or Python.
DEM Cross-Section Profile
A civil engineer needs an elevation profile along a planned road alignment. They sample the DEM at points spaced 5 m along the centreline and use the result as input to cut-and-fill calculations.
Point Cloud Stratification
A Lidar analyst converts a CHM (canopy height model) raster to points within a forest plot to compare against a manual stem map.
Bathymetry Grid Export
A hydrographer converts a bathymetric raster into a sounding-style point layer for delivery to a chart producer who consumes points rather than rasters.
Step-by-Step Workflow in gis.tools
- Open the Raster to Points page on gis.tools.
- Drag a GeoTIFF into the page. The file is decoded with
geotiff.js. - Choose the conversion mode: all cells, regular grid, at input points, or within polygon.
- If using "at input points", drag in a point GeoJSON/Shapefile. If using "within polygon", drag in a polygon clip layer.
- For grid mode, set the spacing.
- Choose nearest neighbour (categorical) or bilinear (continuous) sampling.
- Click Convert. The tool iterates over the cells or sample locations and builds a GeoJSON FeatureCollection.
- Preview the points on the map, optionally styled by the sampled attribute with Graduated Styling.
- Export as GeoJSON, Shapefile, GeoPackage or CSV.
Worked Example: Sampling NDVI at Field Survey Points
You have a Sentinel-2 NDVI raster covering an agricultural region in Spain and a CSV of 200 field survey points where ground-truth crop type was recorded. You drop the NDVI raster into the Raster to Points tool, switch to "at input points" mode, and drag in the survey CSV (latitude/longitude columns). The tool reprojects the points to the NDVI CRS (UTM 30N), reads the NDVI value at each location using bilinear sampling, and produces a 200-feature GeoJSON with a new ndvi attribute. You preview the result on the map and notice that all 30 sunflower fields cluster around NDVI 0.7 while the bare-soil fallow fields cluster near 0.2 β sanity checks that confirm the labels and the sampling are correct. You export the enriched dataset as CSV for downstream classification work.
Common Pitfalls and Gotchas
- Generating one point per cell for a large raster produces millions of features that crash most viewers. Always grid-sample or clip first for large inputs.
- Bilinear sampling on categorical data produces meaningless intermediate values. Use nearest for class rasters.
- CRS mismatch between raster and input points produces wrong values. Reproject one of them with the EPSG Reprojector & Coordinate Converter first.
- Forgetting to skip nodata pollutes the output with null-attribute points.
- Sampling at points exactly on a cell edge can pick the "wrong" cell due to rounding; bilinear avoids this.
- Sampling outside the raster extent returns null β the tool flags these but does not skip them by default.
- Grid spacing smaller than the raster cell size oversamples and produces correlated duplicates.
- Multi-band rasters can produce wide output schemas; ensure your downstream tools support them.
Tips for Best Results
- For statistical sampling, use a regular grid with a spacing larger than the cell size to avoid spatial autocorrelation between adjacent samples.
- Always reproject points to the raster CRS before sampling.
- Use nearest sampling for class rasters and bilinear for continuous rasters.
- Skip nodata by default and only retain it when null cells are meaningful for your downstream analysis.
- Clip the raster to your AOI with Clip Raster by Polygon before converting to points to keep the output manageable.
- Store the sampled attributes with self-explanatory names (
elevation_m,ndvi,landcover_code) so consumers know what they mean. - For machine learning workflows, validate the sample distribution against the population distribution before training.
- Combine raster-to-points with Spatial Join to enrich points with adjacent vector attributes.
Comparison with Other GIS Approaches
QGIS provides "Raster pixels to points" and "Sample raster values" tools. ArcGIS Spatial Analyst has "Raster to Point" and "Extract Values to Points". GDAL's gdal_translate -of XYZ produces an XYZ table; for sampling at points use gdallocationinfo. The Raster to Points tool on gis.tools matches these in a browser environment. The trade-off is that very large rasters (multi-gigabyte) overwhelm browser memory; clip or downsample first.
Performance Considerations
Cell-to-point conversion is O(n) in pixel count but produces an output that grows linearly with n. A 1000x1000 raster generates one million features β about 250 MB of GeoJSON. Grid sampling at 100 m on a 100 km tile produces only 10000 points and runs in milliseconds. For very large rasters, prefer grid sampling or clip first with Clip Raster by Polygon.
Data Privacy and Browser-Based Processing
The raster and any input point layer stay on your device. The File API reads the bytes, the GeoTIFF and vector parsers run locally, and the output GeoJSON is created entirely in memory before being saved as a download. Nothing is uploaded; nothing is logged. This matters for proprietary survey data, classified terrain models and any workflow that cannot send data to third-party servers.
Related GIS Concepts
Vectorisation: The general term for converting raster cells to vector features. Raster-to-points produces points; raster-to-polygon (polygonisation) produces filled polygons per class.
Sampling Density: The spacing between sample points relative to the underlying cell size β controls statistical independence between samples.
Bilinear vs Nearest Sampling: Two strategies for reading a sub-pixel value, with very different appropriate use cases.
Spatial Autocorrelation: Adjacent samples share similar values; sample spacing must respect this for unbiased statistics.
Extract Values to Points: ArcGIS terminology for the same operation.
Frequently Asked Questions
Will every cell become a point?
Only if you choose "all cells" mode. For large rasters use grid sampling instead.
Does the tool handle multi-band rasters?
Yes β each output point carries one attribute per band.
Can I sample at user-provided points?
Yes β drag in a GeoJSON/Shapefile/CSV of points and the tool will read the raster value at each location.
Should I use nearest or bilinear sampling?
Nearest for class/categorical rasters, bilinear for continuous rasters.
Why are some points missing from the output?
Cells with the nodata value are skipped by default. Toggle the option if you want them included as null-attribute points.
Can I export to CSV?
Yes β CSV with longitude and latitude columns is one of the supported formats.
Related Tools on gis.tools
Related Tools
View All ToolsSlope/Aspect Calculator
Calculate slope and aspect from elevation data
Raster ToolsRaster Reclass Tool
Reclassify raster values based on custom rules
Raster ToolsRaster Resampler
Resample raster with nearest neighbor or bilinear interpolation
Raster ToolsClip Raster by Polygon
Clip raster data to a polygon boundary
Raster ToolsHillshade Generator
Generate shaded relief from a DEM GeoTIFF
Raster ToolsZonal Statistics
Calculate raster statistics within polygon zones
Raster Tools100% client-side processing - your data stays private and never leaves your device