Skip to main content

A Geospatial data handling library.

Project description

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.

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

rasvec-0.1.5.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

rasvec-0.1.5-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file rasvec-0.1.5.tar.gz.

File metadata

  • Download URL: rasvec-0.1.5.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rasvec-0.1.5.tar.gz
Algorithm Hash digest
SHA256 d4010fb67bcd7babde4459035121d26d4056bc3e519a7f1caf6509fe23fafa29
MD5 5ec8523ae3cffd638f04e0d4909c86bb
BLAKE2b-256 b85f37fa3f91eb7216501f8637bdfdb781167f9060159d32b344eeda6c042efd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rasvec-0.1.5.tar.gz:

Publisher: python-publish.yml on davnish/rasvec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rasvec-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: rasvec-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rasvec-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8182cc439cb52fc4ec9359016b9882a1ca5f7483fe863305c5fa559b0e7160a6
MD5 d6b3ab19f2ee213ea38947fe1bc81d13
BLAKE2b-256 a4f6c4d15bbbd4e4d407c480514e539252e11e832e6d0c6af4a89cd238a6452f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rasvec-0.1.5-py3-none-any.whl:

Publisher: python-publish.yml on davnish/rasvec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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