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.4.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.4-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rasvec-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 755ca8fc3ae6675a07f8f322dbfacb517649319c3f124e246bd1547220f355ca
MD5 5c66214e230bfcc1e51914ec4dd22251
BLAKE2b-256 8f937c4c4bc4ce77ad7ab4ca8fd38c4c0bad80b7e167f4b8a7a833a587fec5bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rasvec-0.1.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: rasvec-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 494539968117d6849afe3d3c3f8428505f0750ded0cbbae1676806ad5746752e
MD5 516dd6a77a7b4adde1f9c6d962a26ac7
BLAKE2b-256 f829241f9a1e6ccf4d4c3f0b9914b42c3785b436edfd367540fda136a9ad875d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rasvec-0.1.4-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