Skip to content

feat: add missing map features from arma3-maptiler#147

Merged
fank merged 3 commits into
mainfrom
feat/maptool-missing-features
Feb 7, 2026
Merged

feat: add missing map features from arma3-maptiler#147
fank merged 3 commits into
mainfrom
feat/maptool-missing-features

Conversation

@fank
Copy link
Copy Markdown
Member

@fank fank commented Feb 7, 2026

Summary

  • Sea polygon generation: Generate land/water polygons from DEM via gdal_contour -p with ELEV_MAX/ELEV_MIN properties. Previously only grad_meh GeoJSON layers were processed, so sea data was never available.
  • Land/sea in topo styles: Added as explicit layers (positions 2 & 3 after background) in topo and topo-dark, with ELEV_MAX filtering to split land (#DFDFDF / #2a2a2a) from water (#36B / #1a3a5c).
  • 19 missing feature layers: mount, fortress, airport, bordercrossing, viewpoint, flag, rockarea, handdrawncamp, power, name, faketown, strategic, flatareacity, flatareacitysmall, strongpointarea, civildefense, culturalproperty, dangerousforces, safetyzone — styled as text labels across all three style variants (default, topo, topo-dark).
  • Layer name normalization: Maps mountsmount to handle grad_meh naming differences.
image image image image

Test plan

  • Re-import Altis to verify sea polygons are generated and land/sea renders in topo style
  • Verify mounts layer now renders with mount style instead of generic fallback circle
  • Check topo-dark style has correct dark land/sea colors
  • Import a map with fortress/airport/viewpoint features to verify label rendering

Compared ocap2-web maptool against the original arma3-maptiler and
ported missing features:

- Generate sea polygons from DEM via gdal_contour -p, producing land/water
  polygons with ELEV_MAX filtering (was never generated, only grad_meh
  GeoJSON layers were processed)
- Add land/sea as explicit layers in topo and topo-dark styles, positioned
  right after background with proper ELEV_MAX > 0 / <= 0 filters
- Add 19 missing feature layer styles: mount, fortress, airport,
  bordercrossing, viewpoint, flag, rockarea, handdrawncamp, power, name,
  faketown, strategic, flatareacity, flatareacitysmall, strongpointarea,
  civildefense, culturalproperty, dangerousforces, safetyzone
- Add layer name normalization (mounts → mount) for grad_meh naming
  differences
- All new layers styled across default, topo, and topo-dark variants
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the map rendering capabilities by introducing the generation and styling of sea polygons from DEM data, providing a more complete topographic representation. It also expands the range of displayed map features by adding styles for numerous previously unrendered points of interest and locations, improving the overall detail and utility of the generated maps.

Highlights

  • Sea Polygon Generation: Implemented generation of land/water polygons from Digital Elevation Models (DEM) using gdal_contour, allowing for explicit sea data with ELEV_MAX/ELEV_MIN properties.
  • Enhanced Topographic Styles: Integrated explicit land and sea layers into topo and topo-dark styles, using ELEV_MAX filtering for distinct land and water coloring (e.g., #DFDFDF for land, #36B for water).
  • Added Missing Map Features: Introduced styling for 19 previously missing map features (e.g., mount, fortress, airport, viewpoint) as text labels across all map styles.
  • Layer Name Normalization: Implemented a mechanism to normalize inconsistent layer names, such as mapping mounts to mount, ensuring consistent styling and processing.
Changelog
  • internal/maptool/contours_gdal.go
    • Added a new step to execute gdal_contour to generate sea.geojson polygons from the DEM, capturing ELEV_MAX and ELEV_MIN properties.
    • The path to the generated sea.geojson is now stored in the Job struct.
  • internal/maptool/pipeline.go
    • Introduced a SeaFile field to the Job struct to hold the path of the generated sea polygon GeoJSON.
  • internal/maptool/styles.go
    • Defined new LayerStyle configurations for mount and 19 other missing features (e.g., fortress, airport, viewpoint), primarily as text labels.
    • Added a new helper function makeLabelStyle to simplify the creation of text-only symbol layers.
    • Modified knownTopoLayerStyles and knownTopoDarkLayerStyles to remove direct sea layer definitions, as land/sea fills are now dynamically added.
    • Updated topoLayerOrder to include the newly added feature layers, ensuring they are rendered.
    • Introduced hasVectorLayer utility function to check for layer presence.
    • Modified buildTopoLayers and buildTopoDarkLayers functions to explicitly add land and sea fill layers based on ELEV_MAX filters, providing distinct colors for land and water.
    • Expanded the categorizeLayer function to correctly classify the new feature layers under the "labels" category.
  • internal/maptool/vector.go
    • Added layerNameAliases map to define canonical names for layers (e.g., mounts to mount).
    • Updated NewProcessGeoJSONStage to apply these aliases during GeoJSON processing and to include the sea polygon file generated from the DEM in the list of processed layers.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant enhancements to the map generation process, including sea polygon generation from DEM, rendering of land/sea in topo styles, and support for 19 new feature layers. The code is well-organized and the new features are integrated cleanly. I have a couple of suggestions to improve logging for external commands and to refactor some duplicated code for better maintainability.

Comment thread internal/maptool/contours_gdal.go Outdated
Comment thread internal/maptool/styles.go
fank added 2 commits February 7, 2026 12:24
- Capture sea polygon command output in buffer via io.MultiWriter for
  diagnostic logging while preserving real-time output
- Extract buildLandSeaLayers helper to deduplicate topo/topo-dark
Centralizes the io.MultiWriter pattern into a single runCmd() function
in raster_tiles.go. All command invocations now stream output in real
time while capturing it for diagnostic logging on failure.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 7, 2026

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/web/internal/maptool 14.76% (+0.42%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/OCAP2/web/internal/maptool/colorrelief.go 0.00% (ø) 177 (-18) 0 177 (-18)
github.com/OCAP2/web/internal/maptool/contours_gdal.go 0.00% (ø) 155 (+19) 0 155 (+19)
github.com/OCAP2/web/internal/maptool/dem_pipeline.go 0.00% (ø) 244 (-42) 0 244 (-42)
github.com/OCAP2/web/internal/maptool/hillshade.go 0.00% (ø) 292 (-124) 0 292 (-124)
github.com/OCAP2/web/internal/maptool/pipeline.go 30.70% (ø) 215 66 149
github.com/OCAP2/web/internal/maptool/raster_tiles.go 0.00% (ø) 64 (-47) 0 64 (-47)
github.com/OCAP2/web/internal/maptool/styles.go 31.20% (-1.91%) 971 (+50) 303 (-2) 668 (+52) 👎
github.com/OCAP2/web/internal/maptool/vector.go 6.96% (+0.07%) 948 (-10) 66 882 (-10) 👍

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.

@fank fank merged commit 9721053 into main Feb 7, 2026
2 checks passed
@fank fank deleted the feat/maptool-missing-features branch February 7, 2026 11:29
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