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.3.tar.gz (13.1 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.3-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rasvec-0.1.3.tar.gz
  • Upload date:
  • Size: 13.1 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.3.tar.gz
Algorithm Hash digest
SHA256 b944c06fcd241694518da934ec8d79158a0b608b02bc0fec33a204f1a8ba603f
MD5 a6cbf3e54cc828ce8b12f9e27058d723
BLAKE2b-256 1f826eb44e5151db2495fb0073fad24571eb6e7bbe87dd6c6ebca602dd57b653

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: rasvec-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c1afb58c335f08d50ddc08330bd1739b7f91fb9231ce09ab8f6827a1226735
MD5 95782518c193d4dc2c2dfa1f310c603a
BLAKE2b-256 89e494688a93901f7e165d34c89062d3d1c4ea8cbae507a65cbc243b3bc1c049

See more details on using hashes here.

Provenance

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