feat: grad_meh import pipeline with ZIP upload and MapLibre styles#136
Merged
Conversation
…ation Add a 12-stage pipeline for importing grad_meh map exports, producing 5 PMTiles (satellite, features, heightmap, hillshade, color-relief), 3 MapLibre style variants (standard, satellite, hybrid), and rich metadata — matching the Python arma3-maptiler output. New stages: prepare_dem, generate_satellite_tiles, generate_heightmap, generate_hillshade, generate_colorrelief, generate_contours (4 intervals via gdal_contour), process_geojson, generate_vector_tiles (per-layer tippecanoe with tile-join fallback), generate_styles, generate_metadata. Includes all Python parity fixes: satellite z8 min zoom, DEM nodata fill, sea level mask (A>=0), contour underwater colors, house extrusion zoom, hillshade LZW compression, hidden satellite toggle in standard style, label colors with halos, correct icon sizes, full color relief guide, and bush layer skip. Renames PBO-specific files to *_pbo/*_legacy suffixes for clarity.
gdal_fillnodata.py requires both src and dst arguments. Write to a temp file and rename back to the original DEM path.
Prevents "attempt to write a readonly database" errors when re-running the pipeline with leftover MBTiles files from a previous run.
The PBO import pipeline (WRP parsing, PAA decoding, shapefile reading, gdal2tiles tiling) is superseded by the grad_meh pipeline. This removes all PBO-specific code, the PAA decoder package, and unused dependencies (go-lzo, gdal2tiles.py, depbo) — net deletion of ~3,700 lines.
Replace the local-path-only importDir endpoint with importZip that accepts multipart ZIP uploads via POST /api/maps/import. Extracts the ZIP with zip-slip protection, locates the grad_meh directory (at root or one level deep), and submits the import job. Also sets SubDirs=true in processJob so web uploads use organized output layout.
Sort vector feature layers by cartographic render order matching the Arma 3 engine: sea → contours → forest → rocks → buildings → roads (trail/track/road/main_road/runway sub-ordered) → railway → powerline → bridges → vegetation → icons → labels. Previously layer order depended on directory listing order, causing labels to render below roads.
Add semi-transparent white text halos to hill, namemarine, namelocal, and citycenter labels so they remain readable over varied terrain. Change runway from line to fill type so it renders as solid grey tarmac instead of just an outline.
…gradmeh 53 new tests covering pure logic functions: - styles: categorizeLayer, isLayerVisible, buildVectorFeatureLayers (sort order, road sub-order, filtering), GenerateStyleDocument - vector: colorArrayToHex, clamp255, toFloat64, transformCoords - geojson: armaToGeoJSON coordinate conversion - metadata: assetPath, computeElevationStats - gradmeh: WorldNameFromDir, ValidateGradMehDir, ReadGradMehMeta
grad_meh is the only import pipeline now, so the qualifier is redundant. Renames: - gradmeh.go → worldmeta.go - satellite_gradmeh.go → satellite.go - vector_gradmeh.go → vector.go - cmd/ocap-maptool/gradmeh.go → pipeline.go (plus corresponding test files)
…st logging Scanner now reports a single status (none/incomplete/complete) based on whether all required files exist (satellite.pmtiles, features.pmtiles, standard.json, map.json). Checks tiles/ and styles/ subdirs with root fallback. Frontend shows colored status badge instead of individual checkmarks. Removes request logging middleware.
Merging this branch changes the coverage (1 decrease, 1 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /api/maps/import) to the maptool web server, replacing the removed PBO upload and local-path-only import-dir endpointsTest plan
go build ./cmd/ocap-maptool && go test ./internal/maptool/...ocap-maptool import -maps maps altis/