Skip to main content

A Python package for digital agriculture in vineyard-related activities

Project description

VineyardUtils

A Python package for digital agriculture in vineyard-related activities

VineyardUtils is a Python package designed to assist in handling georeferenced data, processing KML files, and organizing data from field activities in vineyards. This package provides several utility functions and tools to streamline data operations and analysis.

Installation

You can install VineyardUtils using pip:

pip install VineyardUtils

Note: for some functions an external OSGeo package must be installed in the system.

Usage

import VineyardUtils

Functions

Datasampler

cut_data(dataframe, time, timecolumn):
Splits a DataFrame based on time intervals specified.

field_counter(dataf, min_number, exclude_words=None):
Counts occurrences of fields in a DataFrame and appends the most common field as a new column.

get_summary_stats(df, columns=None):
Computes summary statistics from specified columns in a DataFrame.

Elevation

get_elevation(osgeopath, coordmode, geotiff_filename, lat, lon):
Retrieves elevation data from a GeoTIFF file using gdallocationinfo.

crop_geotiff(osgeopath, srsmode, minlon, minlat, maxlon, maxlat, source_path_tif, output_path_tif):
Crops a GeoTIFF file to specified bounding box coordinates.

get_elevation_list(osgeopath, sourcename, coordmode, geotiff_filename):
Retrieves a list of elevations from a list of coordinates stored in a file.

add_elevation_to_df(df, latcolname, loncolname, osgeopath, coordmode, geotiff_filename, crop=False, type_srs="EPSG:4326"):
Adds elevation data to a DataFrame based on latitude and longitude columns.

KMLUtils

extract_coordinates(file_path):
Extracts longitude and latitude coordinates from a KML file.

calculate_angle(x1, y1, x2, y2, x3, y3):
Calculates the angle between three points.

iterate_check_angle(longitudes, latitudes, tanklevels, min_angle, max_angle, elevation):
Iterates through a list of coordinates to find tuples based on specified angles.

generate_alpha_shapes(dataframe, alpha=0.2):
Generates alpha shapes from longitude and latitude coordinates.

create_kml(dataframe, row_tuples, kml_filename='outputfile.kml'):
Creates a KML file with polygons and lines based on specified rows of coordinates.

Dependencies

pandas
numpy
scikit-learn
simplekml
alphashape

Contributing

Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

vineyardutils-0.3.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

vineyardutils-0.3-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file vineyardutils-0.3.tar.gz.

File metadata

  • Download URL: vineyardutils-0.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for vineyardutils-0.3.tar.gz
Algorithm Hash digest
SHA256 43c779776b4427a131692de59edba357901a4285d026fa5006d47817a5367644
MD5 58936d7e08b9bd6c848d8d7f06cf20d3
BLAKE2b-256 ff6be7c27423ce4cd29717c4e72253820440dbe5e6df7cc1d1f2e489ba5c7f25

See more details on using hashes here.

File details

Details for the file vineyardutils-0.3-py3-none-any.whl.

File metadata

  • Download URL: vineyardutils-0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for vineyardutils-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d99401936a6f2c32f2a0abe6a7989978b82b87862fdc75b332ed2e0a3718cab6
MD5 55c6e267348e77c81036c504902184b7
BLAKE2b-256 b72263ab635c7684e57347eec5b5cc96e748358a6effb041674de9ebbe214f25

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