Skip to main content

A Python package to rasterize GeoDataFrames

Project description

Rasterizer

rasterizer is a lightweight Python package for rasterizing geopandas GeoDataFrames.

This package provides functionalities that are not present in rasterio.features, such as area and length-based rasterization. It is also lighter and faster than using GDAL-based solutions.

For detailed usage and API documentation, please see the full documentation.

Features

  • Rasterize lines into a binary (presence/absence) or length-based grid.
  • Rasterize polygons into a binary (presence/absence) or area-based grid.
  • Weighted rasterization: Rasterize geometries while weighting the output by a numerical column in the GeoDataFrame.
  • Works with geopandas GeoDataFrames.
  • Outputs an xarray.DataArray for easy integration with other scientific Python libraries.
  • No GDAL dependency for the rasterization algorithm itself.

Installation

You can install the package directly from PyPI:

pip install rasterizer

Usage

Here are some examples of what you can do with rasterizer.

Rasterizing Lines

You can rasterize lines in either binary or length mode.

Binary Mode Length Mode
Lines - Binary Lines - Length

Rasterizing Polygons

You can rasterize polygons in either binary or area mode.

Binary Mode Area Mode
Polygons - Binary Polygons - Area

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rasterizer-0.2.1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rasterizer-0.2.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file rasterizer-0.2.1.tar.gz.

File metadata

  • Download URL: rasterizer-0.2.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for rasterizer-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a7864c3925866f4480dbc79f85526a59c31caa202d96a81abc8a67a9991d1ef8
MD5 dab2b00cd69a22a6f659dfe982886281
BLAKE2b-256 0ca576499389e3315a4f8db5bea6461cede8c98f63e01ba3801e25432e1089be

See more details on using hashes here.

File details

Details for the file rasterizer-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: rasterizer-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for rasterizer-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea08b45b05fc3eee28b2d4d99b7215d763da601fbd8b055b5ee69f5a4fc059e4
MD5 b001d5e98da2a4256ad99cfa0d9eaed1
BLAKE2b-256 162f39e75aea8eb4c8cd1a09aa41e48a51aa7085fc4751aad8fd718be8e8f698

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page