Skip to content

Implement real GIS processors and converters for Datasets module - #107

Merged
antosubash merged 1 commit into
mainfrom
feature/wonderful-leavitt
Apr 13, 2026
Merged

Implement real GIS processors and converters for Datasets module#107
antosubash merged 1 commit into
mainfrom
feature/wonderful-leavitt

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • Replace all stub processors and converters in the Datasets module with working implementations backed by GDAL/OGR and tippecanoe CLI tools
  • Add shared CliRunner (deadlock-safe process runner) and TempDirectory (auto-cleanup) infrastructure helpers
  • Fix worker startup crash (Lazy<IEventBus> missing), job discovery (AddModuleJob instead of AddScoped), and conversion of non-GeoJSON vector sources (read from normalized GeoJSON cache)

Processors (metadata extraction on upload)

FormatToolNotes
GeoTIFF/COGgdalinfo -jsonRaster metadata (dimensions, bands, pixel size, bbox, compression)
Shapefileunzip + ogrinfo + ogr2ogrUnzips archive, extracts vector metadata, normalizes to GeoJSON
KMLogrinfo + ogr2ogrVector metadata + GeoJSON normalization
GeoPackageogrinfo + ogr2ogrVector metadata + GeoJSON normalization
PMTilesBinary header readerParses v3 spec header (zoom levels, bbox, tile format, layer names)

Converters (format conversion)

ConversionTool
Vector → PMTilestippecanoe (zoom 0-14)
Raster → COGgdal_translate -of COG -co COMPRESS=DEFLATE

Bug fixes

  • DatasetsModule.cs: Register jobs via AddModuleJob<T>() so JobTypeRegistry discovers them
  • SimpleModuleWorkerExtensions.cs: Add Lazy<IEventBus> registration (mirrors host) to fix worker crash
  • ConvertDatasetJob.cs: Read from NormalizedPath for non-GeoJSON vector sources
  • Worker/appsettings.json: Point at shared host database and storage paths for local dev

Test plan

  • Upload GeoJSON → verify processing succeeds, metadata extracted, auto-conversion to PMTiles
  • Upload zipped Shapefile → verify unzip, metadata extraction, GeoJSON normalization, PMTiles conversion
  • Upload GeoTIFF → verify raster metadata extraction, COG re-optimization
  • Trigger manual conversions (GeoJSON→PMTiles, GeoJSON→GeoJSON, COG→COG) via API
  • Download original and derivative files via /api/datasets/{id}/download?variant=
  • Verify worker processes jobs when run as separate process alongside host
  • Build succeeds with 0 warnings, 0 errors

Replace all stub processors and converters with working implementations
that shell out to GDAL/OGR and tippecanoe for GIS file processing:
Processors (metadata extraction on upload):
- CogProcessor: gdalinfo -json for raster metadata
- ShapefileProcessor: unzip + ogrinfo/ogr2ogr for zipped shapefiles
- KmlProcessor: ogrinfo/ogr2ogr for KML files
- GeoPackageProcessor: ogrinfo/ogr2ogr for GPKG files
- PmTilesProcessor: binary v3 header reader with correct spec offsets
Converters (format conversion):
- VectorToPmTilesConverter: tippecanoe CLI for GeoJSON → PMTiles
- RasterToCogConverter: gdal_translate -of COG for raster → COG
Infrastructure:
- CliRunner: shared async process runner with concurrent stdout/stderr
draining to prevent pipe-buffer deadlocks
- TempDirectory: IDisposable temp dir wrapper with auto-cleanup
Bug fixes:
- Register dataset jobs via AddModuleJob instead of AddScoped so the
worker's JobTypeRegistry can discover and execute them
- Add Lazy<IEventBus> to worker extensions (mirrors host) to fix crash
when SettingsService resolves via AuditSaveChangesInterceptor
- Fix ConvertDatasetJob to read from NormalizedPath for non-GeoJSON
vector sources instead of the raw original file
- Point worker appsettings at shared host database and storage paths
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simplemodule-website with Cloudflare Pages Cloudflare Pages

Latest commit:d1811f2
Status: ✅ Deploy successful!
Preview URL:https://7a042376.simplemodule-website.pages.dev
Branch Preview URL:https://feature-wonderful-leavitt.simplemodule-website.pages.dev

View logs

@antosubash
antosubash merged commit 14ea8fd into mainApr 13, 2026
5 checks passed
@antosubash
antosubash deleted the feature/wonderful-leavitt branch April 13, 2026 08:53
Sign up for freeto 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

@antosubash