Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

fasterize

> 编程语言
Open source

High performance raster conversion for modern spatial data ▦

186 stars0 likes0 views
WebsiteGitHub

About

High performance raster conversion for modern spatial data ▦

fasterize

Fast polygon-to-raster conversion, burn polygon shapes and/or values into pixels. fasterize is a high-performance replacement for the rasterize() function in the raster package.

Functionality is currently limited to rasterizing polygons in sf-type data frames.

Installation

Install the current version of fasterize from CRAN:

r
install.packages('fasterize')

Install the development version of fasterize with devtools:

r
devtools::install_github("hypertidy/fasterize")

fasterize uses Rcpp and thus requires a compile toolchain to install from source. Testing (and for normal use of sf objects) requires sf, which requires GDAL, GEOS, and PROJ to be installed.

Usage

The main function, fasterize(), takes the same inputs as raster::rasterize() but currently has fewer options and is is limited to rasterizing polygons.

A raster() and plot() methods for rasters are re-exported from the raster package.

r
library(raster)
library(fasterize)
library(wk)
library(fasterize)
p123  dialect must be 'OGRSQL' or 'SQLITE', default value '' means 'OGRSQL'

``` r
pols_t$value  Unit: milliseconds
    #>       expr   min    lq   mean median     uq  max neval cld
    #>  terrarize 9.464 9.761 11.306 10.022 10.375 82.0   100  a 
    #>  fasterize 0.647 0.684  0.839  0.845  0.971  1.1   100   b

How does `fasterize()` do on a large set of polygons? Here I download
the IUCN shapefile for the ranges of all terrestrial mammals and
generate a 1/6 degree world map of mammalian biodiversity by rasterizing
all the layers.

(this doesn’t work anymore because the source data is gone, left as a
record 2024-09-25).

``` r
if(!dir.exists("Mammals_Terrestrial")) {
  download.file(
    "https://s3.amazonaws.com/hp3-shapefiles/Mammals_Terrestrial.zip",
    destfile = "Mammals_Terrestrial.zip") #  Unit: seconds
    #>     expr   min    lq  mean median    uq   max neval
    #>  mammals 0.847 0.857 0.883  0.886 0.894 0.963    20

## About

**fasterize** was developed openly at [EcoHealth
Alliance](https://www.ecohealthalliance.org/) under the USAID PREDICT
project by Noam Ross. The repository for hosting fasterize was taken
over by Michael Sumner in December 2022, and was later migrated from
Github ‘ecohealthalliance/fasterize’ to
 in March 2025.

Please note that this project is released with a [Contributor Code of
Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree
to abide by its terms.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++rrasterrcpprcpparmadillo

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言