Skip to main content

Rasvec

This is a Python library designed to streamline the handling of geospatial data, particularly for machine learning applications. Working with geospatial datasets often involves challenges like rasterization, vectorization, and grid creation—this library provides efficient and easy-to-use functions to simplify these processes.

Features

vectors

  • clip_vector_by_raster
  • create_grid_on_vector
  • rasterize

rasters

  • patchify (divides the raster into geotagged patches)
  • vectorization

satellite imagery

  • tms_to_geotiff

view

  • view_rasters

Example

Here's an example of a feature: Generating a grid over a vector file.

import geopandas as gpd
import matplotlib.pyplot as plt
from rasvec import create_grid_on_vector

gdf = gpd.read_file(r"sample_data/vector/vec/vec.shp")

# 
grid_cells = create_grid_on_vector("sample_data/vector/vec/vec.shp", 1000, "grid.shp")

fig, ax = plt.subplots(1,2, figsize=(10, 10))
gdf.plot(ax=ax[0])
ax[0].set_title("Original Vector Data")
gdf.plot(ax=ax[1])
grid_cells.plot(ax=ax[1], facecolor="none", edgecolor="red")
ax[1].set_title("Vector Data with Grid Overlay")
ax[0].axis("off")
ax[1].axis("off")
plt.tight_layout()

The output:

Installation

install from PyPi

To install the library from PyPi run the below command in your terminal.

pip install rasvec

install from GitHub

To install the development version from GitHub using Git, run the following command in your terminal.

pip install git+https://github.com/davnish/rasvec.git

acknowledgements

This package was made possible due to the following open source projects.

Metadata

Release files for rasvec 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rasvec 0.1.5
File Size Uploaded
rasvec-0.1.5.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rasvec 0.1.5
File Interpreter ABI Platform
rasvec-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / rasvec-0.1.5.tar.gz

Download URL rasvec-0.1.5.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d4010fb67bcd7babde4459035121d26d4056bc3e519a7f1caf6509fe23fafa29
BLAKE2b-256 checksum
How to use checksums
b85f37fa3f91eb7216501f8637bdfdb781167f9060159d32b344eeda6c042efd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2025.

Transparency log

Release files / rasvec-0.1.5-py3-none-any.whl

Download URL rasvec-0.1.5-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8182cc439cb52fc4ec9359016b9882a1ca5f7483fe863305c5fa559b0e7160a6
BLAKE2b-256 checksum
How to use checksums
a4f6c4d15bbbd4e4d407c480514e539252e11e832e6d0c6af4a89cd238a6452f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page