Skip to content

Add new processing and transformation commands for geospatial data#181

Open
Hackshaven wants to merge 1 commit intostagingfrom
149-workflow-gap-aligning-goes-satellite-loops-with-fire-detections-polygons-and-hrrr-overlays-for-wildfire-case-studies
Open

Add new processing and transformation commands for geospatial data#181
Hackshaven wants to merge 1 commit intostagingfrom
149-workflow-gap-aligning-goes-satellite-loops-with-fire-detections-polygons-and-hrrr-overlays-for-wildfire-case-studies

Conversation

@Hackshaven
Copy link
Collaborator

This pull request introduces new geospatial and raster transformation utilities, improves CLI input handling for byte reading, and updates documentation to reflect new features. The main changes are the addition of modules for converting shapefiles and CSVs to GeoJSON, transforming GeoTIFFs to Cloud Optimized GeoTIFFs (COGs), and refactoring how input bytes are read to support subsetting and remote sources.

Geospatial and Raster Transformation Utilities

  • Added src/zyra/transform/geospatial.py with functions to convert shapefiles and CSV point tables to GeoJSON, including timestamp normalization and timezone handling. Also includes CLI-compatible write helpers.
  • Added src/zyra/transform/raster.py with a function to convert GeoTIFFs to Cloud Optimized GeoTIFFs, supporting reprojection, tiling, overviews, and compression options.

CLI Input Handling Improvements

  • Refactored read_all_bytes in src/zyra/utils/cli_helpers.py to support reading from local files, HTTP(S) URLs, and other schemes, improving robustness and flexibility for CLI commands.
  • Introduced _read_input_bytes in src/zyra/processing/__init__.py to support .idx-based GRIB subsetting for HTTP and S3 sources, used in several CLI commands for more efficient data access. [1] [2] [3] [4]

Documentation Updates

  • Updated src/zyra/transform/README.md to document new commands: shapefile-to-geojson and csv-to-geojson, with example usage demonstrating time normalization and timezone options. [1] [2]

- Implemented `process geotiff-to-cog` and `transform geotiff-to-cog` commands for converting GeoTIFF files to Cloud Optimized GeoTIFFs (COGs) with options for reprojection, compression, and overview generation.
- Added `process shapefile-to-geojson` and `transform shapefile-to-geojson` commands to convert shapefiles to GeoJSON, including options for handling local time fields.
- Introduced `process csv-to-geojson` and `transform csv-to-geojson` commands for converting CSV files with latitude/longitude into GeoJSON points, with support for local timestamps.
- Created unit tests for new geospatial transformation functions, ensuring correct handling of time zones and output formats.
- Added tests for overlay rendering in visualizations, verifying the correct assignment of features by time and rendering of overlays on maps.

Signed-off-by: Eric Hackathorn <Eric.J.Hackathorn@noaa.gov>
@Hackshaven Hackshaven self-assigned this Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments