geosptools


Namegeosptools JSON
Version 3.3.7 PyPI version JSON
download
home_pageNone
SummaryA geospatial data processing and analysis toolkit
upload_time2025-07-17 11:21:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License Copyright (c) 2024 geosptools Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords geospatial gis spatial analysis geographic data mapping
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # geosptools

[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![PyPI Version](https://img.shields.io/pypi/v/geosptools.svg)](https://pypi.org/project/geosptools/)

**geosptools** is a specialised Python toolkit designed for geospatial raster data processing and analysis. Built on top of GDAL (Geospatial Data Abstraction Library), it provides robust tools for converting NetCDF files to raster formats and merging independent raster datasets. The package emphasises reliable raster processing workflows with comprehensive error handling and defensive programming practices.

## Features

- **NetCDF to Raster Conversion**:
  - Convert NetCDF files to various raster formats (GeoTIFF, JPEG, PNG, etc.)
  - Configurable resolution and coordinate reference systems
  - Batch processing with nested list support
  - Comprehensive error handling and validation

- **Raster Merging Operations**:
  - Merge independent raster files from multiple regions
  - Synchronised processing of multi-region datasets
  - Flexible output format configuration
  - NoData value handling and projection preservation

- **GDAL Integration**:
  - Professional GDAL-based processing workflows
  - Support for multiple raster formats and drivers
  - Efficient memory management and dataset handling
  - Robust error reporting and debugging capabilities

- **Defensive Programming**:
  - Automatic nested list flattening for file inputs
  - Comprehensive parameter validation
  - Enhanced error handling with detailed diagnostics
  - Type safety with modern Python annotations

## Installation

### Prerequisites

Before installing, please ensure the following dependencies are available on your system:

- **External Tools** (required for full functionality):
  - GDAL Library (system-level installation required)
  - Database server (if using database features)

- **GDAL Library** (system-level installation required):

  ```bash
  # Ubuntu/Debian
  sudo apt-get update
  sudo apt-get install gdal-bin libgdal-dev

  # macOS (using Homebrew)
  brew install gdal

  # CentOS/RHEL
  sudo yum install gdal gdal-devel
  ```

- **Required Python Libraries**:

  ```bash
  pip install gdal numpy
  ```

  Or via Anaconda (recommended for GDAL compatibility):

  ```bash
  conda install -c conda-forge gdal numpy
  ```

- **Internal Package Dependencies**:

  ```bash
  pip install paramlib
  pip install pygenutils                    # Core functionality
  pip install pygenutils[arrow]             # With arrow support (optional)
  ```

### For regular users (from PyPI)

```bash
pip install geosptools
```

### For contributors/developers (with latest Git versions)

```bash
# Install with development dependencies (includes latest Git versions)
pip install -e .[dev]

# Alternative: Use requirements-dev.txt for explicit Git dependencies
pip install -r requirements-dev.txt
pip install -e .
```

**Benefits of the new approach:**

- **Regular users**: Simple `pip install geosptools` with all dependencies included
- **Developers**: Access to latest Git versions for development and testing
- **PyPI compatibility**: All packages can be published without Git dependency issues

**If you encounter import errors:**

1. **For PyPI users**: The package should install all dependencies automatically. If you get import errors, try:

   ```bash
   pip install --upgrade geosptools
   ```

2. **For developers**: Make sure you've installed the development dependencies:

   ```bash
   pip install -e .[dev]
   ```

3. **Common issues**:
   - **Missing GDAL**: Ensure GDAL is properly installed at the system level
   - **Missing dependencies**: For regular users, all dependencies are included. For developers, use `pip install -e .[dev]`
   - **Python version**: Ensure you're using Python 3.10 or higher

### Verify Installation

To verify that your installation is working correctly:

```python
try:
    import geosptools
    from filewise.file_operations.path_utils import find_files
    from pygenutils.arrays_and_lists.data_manipulation import flatten_list
    from paramlib.global_parameters import COMMON_DELIMITER_LIST
    
    print("✅ All imports successful!")
    print(f"✅ geosptools version: {geosptools.__version__}")
    print("✅ Installation is working correctly.")
    
except ImportError as e:
    print(f"❌ Import error: {e}")
    print("💡 For regular users: pip install geosptools")
    print("💡 For developers: pip install -e .[dev]")
```

## Usage

### Basic Example - NetCDF to Raster Conversion

```python
from geosptools.raster_tools import nc2raster

# Convert a single NetCDF file to GeoTIFF
nc2raster(
    nc_file_list="temperature_data.nc",
    output_file_format="GTiff",
    raster_extension="tif",
    raster_resolution=300,
    nodata_value=-9999,
    crs="EPSG:4326"
)

# Batch convert multiple NetCDF files
nc_files = ["temp_2020.nc", "temp_2021.nc", "temp_2022.nc"]
nc2raster(
    nc_file_list=nc_files,
    output_file_format="GTiff",
    raster_extension="tif",
    raster_resolution=500
)
```

### Advanced Example - Nested List Processing

```python
from geosptools.raster_tools import nc2raster

# Handle complex nested file structures automatically
nested_files = [
    ["region1_temp.nc", "region1_precip.nc"],
    ["region2_temp.nc", "region2_precip.nc"],
    "global_summary.nc"
]

# Defensive programming automatically flattens nested lists
nc2raster(
    nc_file_list=nested_files,
    output_file_format="GTiff",
    raster_extension="tif",
    raster_resolution=1000,
    nodata_value=-32768,
    crs="EPSG:3857"  # Web Mercator projection
)
```

### Multi-Region Raster Merging

```python
from geosptools.raster_tools import merge_independent_rasters

# Define raster files for different regions
raster_data = {
    "north_region": [
        "north_temp_jan.tif",
        "north_temp_feb.tif",
        "north_temp_mar.tif"
    ],
    "south_region": [
        "south_temp_jan.tif",
        "south_temp_feb.tif",
        "south_temp_mar.tif"
    ],
    "central_region": [
        "central_temp_jan.tif",
        "central_temp_feb.tif",
        "central_temp_mar.tif"
    ]
}

# Merge corresponding files from each region
merge_independent_rasters(
    raster_files_dict=raster_data,
    output_file_format="GTiff",
    joint_region_name="combined",
    output_file_name_ext="tif",
    nodata_value=-9999
)
```

### Climate Data Processing Example

```python
from geosptools.raster_tools import nc2raster, merge_independent_rasters

# Step 1: Convert climate NetCDF files to rasters
climate_files = [
    "ERA5_temperature_2023.nc",
    "ERA5_precipitation_2023.nc",
    "ERA5_humidity_2023.nc"
]

nc2raster(
    nc_file_list=climate_files,
    output_file_format="GTiff",
    raster_extension="tif",
    raster_resolution=1000,
    crs="EPSG:4326"
)

# Step 2: Merge regional climate data
regional_data = {
    "europe": ["EUR_temp_2023.tif", "EUR_precip_2023.tif"],
    "asia": ["ASIA_temp_2023.tif", "ASIA_precip_2023.tif"],
    "africa": ["AFR_temp_2023.tif", "AFR_precip_2023.tif"]
}

merge_independent_rasters(
    raster_files_dict=regional_data,
    output_file_format="GTiff",
    joint_region_name="global",
    output_file_name_ext="tif"
)
```

## Project Structure

The package is organised as a focused raster processing toolkit:

```text
geosptools/
├── raster_tools.py              # Core raster processing functions
├── __init__.py                  # Package initialisation
├── CHANGELOG.md                 # Version history and changes
└── README.md                    # Package documentation
```

## Key Functions

### `nc2raster()`

**Purpose**: Convert NetCDF files to various raster formats using GDAL

**Key Features**:

- Supports single files, lists, and nested lists of NetCDF files
- Configurable output formats (GeoTIFF, JPEG, PNG, etc.)
- Customisable resolution and coordinate reference systems
- NoData value handling and projection settings
- Comprehensive error handling and progress reporting

**Parameters**:

- `nc_file_list`: NetCDF file(s) to convert (supports nested lists)
- `output_file_format`: GDAL driver name (e.g., "GTiff", "JPEG")
- `raster_extension`: Output file extension
- `raster_resolution`: Resolution for output rasters
- `nodata_value`: NoData value for raster files (optional)
- `crs`: Coordinate reference system (default: "EPSG:4326")

### `merge_independent_rasters()`

**Purpose**: Merge corresponding raster files from multiple regions into unified outputs

**Key Features**:

- Synchronised processing of multi-region datasets
- Automatic validation of input file consistency
- Preserves geospatial metadata and projections
- Flexible output naming and format configuration
- Robust error handling for GDAL operations

**Parameters**:

- `raster_files_dict`: Dictionary mapping region names to file lists
- `output_file_format`: GDAL driver for output format
- `joint_region_name`: Name for combined region in output files
- `output_file_name_ext`: Extension for output files
- `nodata_value`: NoData value handling (optional)

## Advanced Features

### Defensive Programming

- **Nested List Support**: Automatically flattens complex nested file structures
- **Parameter Validation**: Comprehensive input validation with detailed error messages
- **Type Safety**: Modern Python type annotations (PEP-604) for better IDE support
- **Error Handling**: Detailed RuntimeError and ValueError reporting for debugging

### GDAL Integration

- **Professional Workflows**: Proper dataset opening, processing, and closing
- **Memory Management**: Efficient handling of large raster datasets
- **Format Support**: Wide range of raster formats through GDAL drivers
- **Metadata Preservation**: Maintains geospatial information during processing

### Performance Optimisation

- **Batch Processing**: Efficient handling of multiple files
- **Progress Reporting**: Real-time feedback during long operations
- **Resource Management**: Proper cleanup of GDAL datasets and memory

## Supported Formats

### Input Formats

- **NetCDF** (.nc) - Primary input format for conversion
- **Various raster formats** - For merging operations (GeoTIFF, JPEG, PNG, etc.)

### Output Formats

- **GeoTIFF** (.tif) - Recommended for geospatial data
- **JPEG** (.jpg) - For visualisation and web applications
- **PNG** (.png) - For high-quality images with transparency
- **And many others** - Any format supported by GDAL drivers

## Version Information

Current version: **3.3.0**

### Recent Updates (v3.3.0)

- Enhanced defensive programming with nested list support
- Modern PEP-604 type annotations throughout
- Improved error handling and documentation
- Variable name standardisation for consistency

For detailed version history, see [CHANGELOG.md](CHANGELOG.md).

## Error Handling

The package provides comprehensive error handling:

- **RuntimeError**: For GDAL operation failures (file opening, driver issues, raster creation)
- **ValueError**: For parameter validation and input consistency checks
- **TypeError**: For incorrect parameter types

Example error scenarios:

```python
# This will raise ValueError if regions have different numbers of files
raster_data = {
    "region1": ["file1.tif", "file2.tif"],
    "region2": ["file1.tif"]  # Inconsistent length
}
merge_independent_rasters(raster_data, "GTiff", "combined", "tif")
```

## System Requirements

- **Python**: 3.8 or higher
- **GDAL**: System-level installation required (>= 2.0)
- **Operating System**: Linux, macOS, Windows (with proper GDAL setup)
- **Memory**: Sufficient RAM for processing large raster datasets

## Dependencies

### Core Dependencies

- **GDAL Python bindings**: Essential for all raster operations
- **NumPy**: For efficient array operations (indirect dependency)

### Internal Dependencies

- **pygenutils**: Utility functions and data manipulation
- **paramlib**: Parameter and configuration management

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

### Development Guidelines

- Follow existing code structure and GDAL best practices
- Add comprehensive docstrings with parameter descriptions
- Include error handling for all GDAL operations
- Test with various raster formats and coordinate systems
- Update changelog for significant changes

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- **GDAL Development Team** for the foundational geospatial data processing library
- **OSGeo Community** for open-source geospatial tools and standards
- **Python Geospatial Community** for ecosystem development and best practices
- **Climate and Earth Science Communities** for driving requirements and use cases

## Contact

For any questions or suggestions, please open an issue on GitHub or contact the maintainers.

## Troubleshooting

### Common Issues

1. **GDAL Import Error**:

   ```bash
   # Ensure GDAL is properly installed
   conda install -c conda-forge gdal
   # Or check system installation
   gdalinfo --version
   ```

2. **Coordinate Reference System Issues**:
   - Verify CRS string format (e.g., "EPSG:4326")
   - Check if target CRS is supported by GDAL

3. **Memory Issues with Large Files**:
   - Process files in smaller batches
   - Monitor system memory usage during operations
   - Consider using GDAL virtual file systems for very large datasets

### Getting Help

- Check the [CHANGELOG.md](CHANGELOG.md) for recent updates
- Review function docstrings for parameter details
- Open an issue on GitHub for bugs or feature requests

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "geosptools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "geospatial, GIS, spatial analysis, geographic data, mapping",
    "author": null,
    "author_email": "Jon Ander Gabantxo <jagabantxo@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/db/c5/11d5a0a9694cffa85f1d2747164d72016c4d00b6067e2e4cb79d839a2f48/geosptools-3.3.7.tar.gz",
    "platform": null,
    "description": "# geosptools\n\n[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![PyPI Version](https://img.shields.io/pypi/v/geosptools.svg)](https://pypi.org/project/geosptools/)\n\n**geosptools** is a specialised Python toolkit designed for geospatial raster data processing and analysis. Built on top of GDAL (Geospatial Data Abstraction Library), it provides robust tools for converting NetCDF files to raster formats and merging independent raster datasets. The package emphasises reliable raster processing workflows with comprehensive error handling and defensive programming practices.\n\n## Features\n\n- **NetCDF to Raster Conversion**:\n  - Convert NetCDF files to various raster formats (GeoTIFF, JPEG, PNG, etc.)\n  - Configurable resolution and coordinate reference systems\n  - Batch processing with nested list support\n  - Comprehensive error handling and validation\n\n- **Raster Merging Operations**:\n  - Merge independent raster files from multiple regions\n  - Synchronised processing of multi-region datasets\n  - Flexible output format configuration\n  - NoData value handling and projection preservation\n\n- **GDAL Integration**:\n  - Professional GDAL-based processing workflows\n  - Support for multiple raster formats and drivers\n  - Efficient memory management and dataset handling\n  - Robust error reporting and debugging capabilities\n\n- **Defensive Programming**:\n  - Automatic nested list flattening for file inputs\n  - Comprehensive parameter validation\n  - Enhanced error handling with detailed diagnostics\n  - Type safety with modern Python annotations\n\n## Installation\n\n### Prerequisites\n\nBefore installing, please ensure the following dependencies are available on your system:\n\n- **External Tools** (required for full functionality):\n  - GDAL Library (system-level installation required)\n  - Database server (if using database features)\n\n- **GDAL Library** (system-level installation required):\n\n  ```bash\n  # Ubuntu/Debian\n  sudo apt-get update\n  sudo apt-get install gdal-bin libgdal-dev\n\n  # macOS (using Homebrew)\n  brew install gdal\n\n  # CentOS/RHEL\n  sudo yum install gdal gdal-devel\n  ```\n\n- **Required Python Libraries**:\n\n  ```bash\n  pip install gdal numpy\n  ```\n\n  Or via Anaconda (recommended for GDAL compatibility):\n\n  ```bash\n  conda install -c conda-forge gdal numpy\n  ```\n\n- **Internal Package Dependencies**:\n\n  ```bash\n  pip install paramlib\n  pip install pygenutils                    # Core functionality\n  pip install pygenutils[arrow]             # With arrow support (optional)\n  ```\n\n### For regular users (from PyPI)\n\n```bash\npip install geosptools\n```\n\n### For contributors/developers (with latest Git versions)\n\n```bash\n# Install with development dependencies (includes latest Git versions)\npip install -e .[dev]\n\n# Alternative: Use requirements-dev.txt for explicit Git dependencies\npip install -r requirements-dev.txt\npip install -e .\n```\n\n**Benefits of the new approach:**\n\n- **Regular users**: Simple `pip install geosptools` with all dependencies included\n- **Developers**: Access to latest Git versions for development and testing\n- **PyPI compatibility**: All packages can be published without Git dependency issues\n\n**If you encounter import errors:**\n\n1. **For PyPI users**: The package should install all dependencies automatically. If you get import errors, try:\n\n   ```bash\n   pip install --upgrade geosptools\n   ```\n\n2. **For developers**: Make sure you've installed the development dependencies:\n\n   ```bash\n   pip install -e .[dev]\n   ```\n\n3. **Common issues**:\n   - **Missing GDAL**: Ensure GDAL is properly installed at the system level\n   - **Missing dependencies**: For regular users, all dependencies are included. For developers, use `pip install -e .[dev]`\n   - **Python version**: Ensure you're using Python 3.10 or higher\n\n### Verify Installation\n\nTo verify that your installation is working correctly:\n\n```python\ntry:\n    import geosptools\n    from filewise.file_operations.path_utils import find_files\n    from pygenutils.arrays_and_lists.data_manipulation import flatten_list\n    from paramlib.global_parameters import COMMON_DELIMITER_LIST\n    \n    print(\"\u2705 All imports successful!\")\n    print(f\"\u2705 geosptools version: {geosptools.__version__}\")\n    print(\"\u2705 Installation is working correctly.\")\n    \nexcept ImportError as e:\n    print(f\"\u274c Import error: {e}\")\n    print(\"\ud83d\udca1 For regular users: pip install geosptools\")\n    print(\"\ud83d\udca1 For developers: pip install -e .[dev]\")\n```\n\n## Usage\n\n### Basic Example - NetCDF to Raster Conversion\n\n```python\nfrom geosptools.raster_tools import nc2raster\n\n# Convert a single NetCDF file to GeoTIFF\nnc2raster(\n    nc_file_list=\"temperature_data.nc\",\n    output_file_format=\"GTiff\",\n    raster_extension=\"tif\",\n    raster_resolution=300,\n    nodata_value=-9999,\n    crs=\"EPSG:4326\"\n)\n\n# Batch convert multiple NetCDF files\nnc_files = [\"temp_2020.nc\", \"temp_2021.nc\", \"temp_2022.nc\"]\nnc2raster(\n    nc_file_list=nc_files,\n    output_file_format=\"GTiff\",\n    raster_extension=\"tif\",\n    raster_resolution=500\n)\n```\n\n### Advanced Example - Nested List Processing\n\n```python\nfrom geosptools.raster_tools import nc2raster\n\n# Handle complex nested file structures automatically\nnested_files = [\n    [\"region1_temp.nc\", \"region1_precip.nc\"],\n    [\"region2_temp.nc\", \"region2_precip.nc\"],\n    \"global_summary.nc\"\n]\n\n# Defensive programming automatically flattens nested lists\nnc2raster(\n    nc_file_list=nested_files,\n    output_file_format=\"GTiff\",\n    raster_extension=\"tif\",\n    raster_resolution=1000,\n    nodata_value=-32768,\n    crs=\"EPSG:3857\"  # Web Mercator projection\n)\n```\n\n### Multi-Region Raster Merging\n\n```python\nfrom geosptools.raster_tools import merge_independent_rasters\n\n# Define raster files for different regions\nraster_data = {\n    \"north_region\": [\n        \"north_temp_jan.tif\",\n        \"north_temp_feb.tif\",\n        \"north_temp_mar.tif\"\n    ],\n    \"south_region\": [\n        \"south_temp_jan.tif\",\n        \"south_temp_feb.tif\",\n        \"south_temp_mar.tif\"\n    ],\n    \"central_region\": [\n        \"central_temp_jan.tif\",\n        \"central_temp_feb.tif\",\n        \"central_temp_mar.tif\"\n    ]\n}\n\n# Merge corresponding files from each region\nmerge_independent_rasters(\n    raster_files_dict=raster_data,\n    output_file_format=\"GTiff\",\n    joint_region_name=\"combined\",\n    output_file_name_ext=\"tif\",\n    nodata_value=-9999\n)\n```\n\n### Climate Data Processing Example\n\n```python\nfrom geosptools.raster_tools import nc2raster, merge_independent_rasters\n\n# Step 1: Convert climate NetCDF files to rasters\nclimate_files = [\n    \"ERA5_temperature_2023.nc\",\n    \"ERA5_precipitation_2023.nc\",\n    \"ERA5_humidity_2023.nc\"\n]\n\nnc2raster(\n    nc_file_list=climate_files,\n    output_file_format=\"GTiff\",\n    raster_extension=\"tif\",\n    raster_resolution=1000,\n    crs=\"EPSG:4326\"\n)\n\n# Step 2: Merge regional climate data\nregional_data = {\n    \"europe\": [\"EUR_temp_2023.tif\", \"EUR_precip_2023.tif\"],\n    \"asia\": [\"ASIA_temp_2023.tif\", \"ASIA_precip_2023.tif\"],\n    \"africa\": [\"AFR_temp_2023.tif\", \"AFR_precip_2023.tif\"]\n}\n\nmerge_independent_rasters(\n    raster_files_dict=regional_data,\n    output_file_format=\"GTiff\",\n    joint_region_name=\"global\",\n    output_file_name_ext=\"tif\"\n)\n```\n\n## Project Structure\n\nThe package is organised as a focused raster processing toolkit:\n\n```text\ngeosptools/\n\u251c\u2500\u2500 raster_tools.py              # Core raster processing functions\n\u251c\u2500\u2500 __init__.py                  # Package initialisation\n\u251c\u2500\u2500 CHANGELOG.md                 # Version history and changes\n\u2514\u2500\u2500 README.md                    # Package documentation\n```\n\n## Key Functions\n\n### `nc2raster()`\n\n**Purpose**: Convert NetCDF files to various raster formats using GDAL\n\n**Key Features**:\n\n- Supports single files, lists, and nested lists of NetCDF files\n- Configurable output formats (GeoTIFF, JPEG, PNG, etc.)\n- Customisable resolution and coordinate reference systems\n- NoData value handling and projection settings\n- Comprehensive error handling and progress reporting\n\n**Parameters**:\n\n- `nc_file_list`: NetCDF file(s) to convert (supports nested lists)\n- `output_file_format`: GDAL driver name (e.g., \"GTiff\", \"JPEG\")\n- `raster_extension`: Output file extension\n- `raster_resolution`: Resolution for output rasters\n- `nodata_value`: NoData value for raster files (optional)\n- `crs`: Coordinate reference system (default: \"EPSG:4326\")\n\n### `merge_independent_rasters()`\n\n**Purpose**: Merge corresponding raster files from multiple regions into unified outputs\n\n**Key Features**:\n\n- Synchronised processing of multi-region datasets\n- Automatic validation of input file consistency\n- Preserves geospatial metadata and projections\n- Flexible output naming and format configuration\n- Robust error handling for GDAL operations\n\n**Parameters**:\n\n- `raster_files_dict`: Dictionary mapping region names to file lists\n- `output_file_format`: GDAL driver for output format\n- `joint_region_name`: Name for combined region in output files\n- `output_file_name_ext`: Extension for output files\n- `nodata_value`: NoData value handling (optional)\n\n## Advanced Features\n\n### Defensive Programming\n\n- **Nested List Support**: Automatically flattens complex nested file structures\n- **Parameter Validation**: Comprehensive input validation with detailed error messages\n- **Type Safety**: Modern Python type annotations (PEP-604) for better IDE support\n- **Error Handling**: Detailed RuntimeError and ValueError reporting for debugging\n\n### GDAL Integration\n\n- **Professional Workflows**: Proper dataset opening, processing, and closing\n- **Memory Management**: Efficient handling of large raster datasets\n- **Format Support**: Wide range of raster formats through GDAL drivers\n- **Metadata Preservation**: Maintains geospatial information during processing\n\n### Performance Optimisation\n\n- **Batch Processing**: Efficient handling of multiple files\n- **Progress Reporting**: Real-time feedback during long operations\n- **Resource Management**: Proper cleanup of GDAL datasets and memory\n\n## Supported Formats\n\n### Input Formats\n\n- **NetCDF** (.nc) - Primary input format for conversion\n- **Various raster formats** - For merging operations (GeoTIFF, JPEG, PNG, etc.)\n\n### Output Formats\n\n- **GeoTIFF** (.tif) - Recommended for geospatial data\n- **JPEG** (.jpg) - For visualisation and web applications\n- **PNG** (.png) - For high-quality images with transparency\n- **And many others** - Any format supported by GDAL drivers\n\n## Version Information\n\nCurrent version: **3.3.0**\n\n### Recent Updates (v3.3.0)\n\n- Enhanced defensive programming with nested list support\n- Modern PEP-604 type annotations throughout\n- Improved error handling and documentation\n- Variable name standardisation for consistency\n\nFor detailed version history, see [CHANGELOG.md](CHANGELOG.md).\n\n## Error Handling\n\nThe package provides comprehensive error handling:\n\n- **RuntimeError**: For GDAL operation failures (file opening, driver issues, raster creation)\n- **ValueError**: For parameter validation and input consistency checks\n- **TypeError**: For incorrect parameter types\n\nExample error scenarios:\n\n```python\n# This will raise ValueError if regions have different numbers of files\nraster_data = {\n    \"region1\": [\"file1.tif\", \"file2.tif\"],\n    \"region2\": [\"file1.tif\"]  # Inconsistent length\n}\nmerge_independent_rasters(raster_data, \"GTiff\", \"combined\", \"tif\")\n```\n\n## System Requirements\n\n- **Python**: 3.8 or higher\n- **GDAL**: System-level installation required (>= 2.0)\n- **Operating System**: Linux, macOS, Windows (with proper GDAL setup)\n- **Memory**: Sufficient RAM for processing large raster datasets\n\n## Dependencies\n\n### Core Dependencies\n\n- **GDAL Python bindings**: Essential for all raster operations\n- **NumPy**: For efficient array operations (indirect dependency)\n\n### Internal Dependencies\n\n- **pygenutils**: Utility functions and data manipulation\n- **paramlib**: Parameter and configuration management\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n### Development Guidelines\n\n- Follow existing code structure and GDAL best practices\n- Add comprehensive docstrings with parameter descriptions\n- Include error handling for all GDAL operations\n- Test with various raster formats and coordinate systems\n- Update changelog for significant changes\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- **GDAL Development Team** for the foundational geospatial data processing library\n- **OSGeo Community** for open-source geospatial tools and standards\n- **Python Geospatial Community** for ecosystem development and best practices\n- **Climate and Earth Science Communities** for driving requirements and use cases\n\n## Contact\n\nFor any questions or suggestions, please open an issue on GitHub or contact the maintainers.\n\n## Troubleshooting\n\n### Common Issues\n\n1. **GDAL Import Error**:\n\n   ```bash\n   # Ensure GDAL is properly installed\n   conda install -c conda-forge gdal\n   # Or check system installation\n   gdalinfo --version\n   ```\n\n2. **Coordinate Reference System Issues**:\n   - Verify CRS string format (e.g., \"EPSG:4326\")\n   - Check if target CRS is supported by GDAL\n\n3. **Memory Issues with Large Files**:\n   - Process files in smaller batches\n   - Monitor system memory usage during operations\n   - Consider using GDAL virtual file systems for very large datasets\n\n### Getting Help\n\n- Check the [CHANGELOG.md](CHANGELOG.md) for recent updates\n- Review function docstrings for parameter details\n- Open an issue on GitHub for bugs or feature requests\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 geosptools\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE. ",
    "summary": "A geospatial data processing and analysis toolkit",
    "version": "3.3.7",
    "project_urls": {
        "Bug Reports": "https://github.com/EusDancerDev/geosptools/issues",
        "Documentation": "https://github.com/EusDancerDev/geosptools#readme",
        "Homepage": "https://github.com/EusDancerDev/geosptools",
        "Repository": "https://github.com/EusDancerDev/geosptools.git"
    },
    "split_keywords": [
        "geospatial",
        " gis",
        " spatial analysis",
        " geographic data",
        " mapping"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c52eee619c12f32aadbd8cb93d061016084d41693e99fd480232da68492d3ce8",
                "md5": "3d948abb31cb0be432963b1ae29d6a2a",
                "sha256": "48b8a0545fb806e35316f31fa9ce062b02436dc6c4b4f6f7f2ef15e0a6ae01cc"
            },
            "downloads": -1,
            "filename": "geosptools-3.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3d948abb31cb0be432963b1ae29d6a2a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 10734,
            "upload_time": "2025-07-17T11:21:02",
            "upload_time_iso_8601": "2025-07-17T11:21:02.217284Z",
            "url": "https://files.pythonhosted.org/packages/c5/2e/ee619c12f32aadbd8cb93d061016084d41693e99fd480232da68492d3ce8/geosptools-3.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dbc511d5a0a9694cffa85f1d2747164d72016c4d00b6067e2e4cb79d839a2f48",
                "md5": "b8f8abd5a8e7007d6010e63bd5e23d38",
                "sha256": "0a24e669455a155c5991f3fc78a313a7b1f3404158dd34e33c5ea530b72f0b6c"
            },
            "downloads": -1,
            "filename": "geosptools-3.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "b8f8abd5a8e7007d6010e63bd5e23d38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15393,
            "upload_time": "2025-07-17T11:21:03",
            "upload_time_iso_8601": "2025-07-17T11:21:03.246834Z",
            "url": "https://files.pythonhosted.org/packages/db/c5/11d5a0a9694cffa85f1d2747164d72016c4d00b6067e2e4cb79d839a2f48/geosptools-3.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-17 11:21:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EusDancerDev",
    "github_project": "geosptools",
    "github_not_found": true,
    "lcname": "geosptools"
}
        
Elapsed time: 1.90812s