Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.0.1 #693

Merged
merged 10 commits into from
Feb 28, 2025
Merged

Release 3.0.1 #693

merged 10 commits into from
Feb 28, 2025

Conversation

stmitt
Copy link
Contributor

@stmitt stmitt commented Feb 28, 2025

Summary by CodeRabbit

  • New Features

    • Added support for specifying minimum zoom and extent options for GeoJSON source styling.
  • Bug Fixes

    • Resolved an issue with polygon offset rendering on iOS for more accurate map display.
  • Documentation

    • Updated version information and dependency references to version 3.0.1 across platforms.
  • Refactor

    • Enhanced thread safety and improved error handling for asynchronous operations and tile processing, contributing to overall stability and performance.

Copy link
Contributor

coderabbitai bot commented Feb 28, 2025

Walkthrough

This pull request updates the project to version 3.0.1. It introduces a new feature that allows GeoJSON sources to specify minZoom and extent options when defined in style JSON files. Multiple files have been updated to improve thread safety by replacing static vectors with thread-local storage. Additionally, various components have received enhanced error handling via try-catch blocks and improved logging. Several data types have been modified from uint16_t to uint32_t to support larger ranges. Minor bug fixes and dependency version updates are also included across Android, iOS, and shared modules.

Changes

Files Change Summary
CHANGELOG.md, android/gradle.properties, android/readme.md, ios/readme.md, shared/src/MapsCoreSharedModule.cpp Update version info to 3.0.1 with dependency and module version bumps.
shared/src/map/layers/tiled/vector/Tiled2dMapVectorGeoJSONLayerConfig.h, .../Tiled2dMapVectorLayerParserHelper.cpp Add minZoom & extent options for GeoJSON sources and update zoom level info retrieval.
shared/src/map/layers/effect/SphereEffectLayer.cpp, .../Tiled2dMapVectorLayer.cpp, .../Tiled2dMapVectorSymbolLabelObject.cpp Replace static vectors with thread_local storage to enhance thread safety.
android/src/main/java/io/openmobilemaps/mapscore/map/util/AssetLocalDataProvider.kt, shared/public/Actor.h, .../Tiled2dMapVectorSourceDataManager.cpp, .../Tiled2dMapVectorSourceRasterTileDataManager.cpp Introduce error logging and try-catch blocks in asynchronous operations and pointer validations.
ios/graphics/Model/Polygon/PolygonGroup2d.swift, ios/graphics/Model/Polygon/PolygonPatternGroup2d.swift Optimize vertex processing by switching to SIMD4 for more efficient rendering.
.../geojson/geojsonvt/geojsonvt.hpp, .../geojson/geojsonvt/tile.hpp Update extent and buffer types from uint16_t to uint32_t for expanded value range.
shared/public/LoaderHelper.h Modify lambda capture to copy the loaders vector instead of capturing by reference.
.../Tiled2dVectorGeoJsonSource.h, .../Tiled2dMapVectorPolygonTile.cpp Reset lastVisibleTilesHash on load and adjust shaderStyles capacity dynamically based on stripe condition.

Sequence Diagram(s)

sequenceDiagram
    participant JSON as Style JSON Parser
    participant Parser as Tiled2dMapVectorLayerParserHelper
    participant Config as Tiled2dMapVectorGeoJSONLayerConfig
    participant Loader as GeoJSON Data Loader

    JSON->>Parser: Parse style JSON (including minZoom & extent)
    Parser-->>Config: Pass extracted options (minZoom, extent, etc.)
    Config->>Loader: Configure GeoJSON source with options
    Loader-->>Config: Load data asynchronously with error handling
Loading
sequenceDiagram
    participant Caller as Async Caller
    participant Manager as VectorLayer Source Manager
    participant Thread as Worker Thread

    Caller->>Manager: Request tile information
    Manager->>Thread: Invoke method with thread_local variables
    Thread-->>Manager: Process tile data with error handling (try-catch)
    Manager-->>Caller: Return processed data or log error
Loading

Possibly related PRs

Suggested reviewers

  • maurhofer-ubique
  • zimmermannubique

Poem

I'm a rabbit hopping through lines of code,
Version bumps and new options light my road.
Thread safety shrugs off static gloom,
With minZoom and extent, our maps now bloom.
Errors caught neatly, logs in a row,
I nibble on carrots while our project grows.
🥕 Happy coding from this little bunny!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
android/src/main/java/io/openmobilemaps/mapscore/map/util/AssetLocalDataProvider.kt (1)

106-106: Great addition of error logging!

Adding this log statement improves debugging by providing visibility when GeoJSON loading fails due to a missing data loader. This follows the error logging pattern used elsewhere in the class.

For even better alignment, consider using LoaderStatus.ERROR_OTHER instead of ERROR_404 on line 111, as this is more of a configuration issue (missing loader) than a "not found" situation.

CHANGELOG.md (1)

3-8: Fix grammatical error in changelog.

There's a grammatical error in the last bullet point.

-Catch c++ future exception if the promise is deallocated while the its not fulfilled
+Catch c++ future exception if the promise is deallocated while it's not fulfilled
🧰 Tools
🪛 LanguageTool

[grammar] ~7-~7: A determiner cannot be combined with a possessive pronoun. Did you mean simply “the” or “its”?
Context: ...ion if the promise is deallocated while the its not fulfilled ## Version 3.0.0 - Intro...

(A_MY)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 869bc72 and ceb39f7.

📒 Files selected for processing (21)
  • CHANGELOG.md (1 hunks)
  • android/gradle.properties (1 hunks)
  • android/readme.md (1 hunks)
  • android/src/main/java/io/openmobilemaps/mapscore/map/util/AssetLocalDataProvider.kt (1 hunks)
  • ios/graphics/Model/Polygon/PolygonGroup2d.swift (1 hunks)
  • ios/graphics/Model/Polygon/PolygonPatternGroup2d.swift (1 hunks)
  • ios/readme.md (1 hunks)
  • shared/public/Actor.h (6 hunks)
  • shared/public/LoaderHelper.h (1 hunks)
  • shared/src/MapsCoreSharedModule.cpp (1 hunks)
  • shared/src/map/layers/effect/SphereEffectLayer.cpp (1 hunks)
  • shared/src/map/layers/tiled/vector/Tiled2dMapVectorGeoJSONLayerConfig.h (1 hunks)
  • shared/src/map/layers/tiled/vector/Tiled2dMapVectorLayer.cpp (3 hunks)
  • shared/src/map/layers/tiled/vector/Tiled2dMapVectorLayerParserHelper.cpp (1 hunks)
  • shared/src/map/layers/tiled/vector/geojson/Tiled2dVectorGeoJsonSource.h (1 hunks)
  • shared/src/map/layers/tiled/vector/geojson/geojsonvt/geojsonvt.hpp (2 hunks)
  • shared/src/map/layers/tiled/vector/geojson/geojsonvt/tile.hpp (2 hunks)
  • shared/src/map/layers/tiled/vector/sourcemanagers/Tiled2dMapVectorSourceDataManager.cpp (1 hunks)
  • shared/src/map/layers/tiled/vector/sourcemanagers/Tiled2dMapVectorSourceRasterTileDataManager.cpp (2 hunks)
  • shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (1 hunks)
  • shared/src/map/layers/tiled/vector/tiles/polygon/Tiled2dMapVectorPolygonTile.cpp (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • android/gradle.properties
  • android/readme.md
  • shared/src/MapsCoreSharedModule.cpp
  • ios/readme.md
🧰 Additional context used
🪛 Cppcheck (2.10-2)
shared/src/map/layers/tiled/vector/sourcemanagers/Tiled2dMapVectorSourceRasterTileDataManager.cpp

[error] 199-199: syntax error

(syntaxError)

shared/src/map/layers/tiled/vector/sourcemanagers/Tiled2dMapVectorSourceDataManager.cpp

[error] 46-46: syntax error

(syntaxError)

shared/src/map/layers/tiled/vector/Tiled2dMapVectorLayer.cpp

[error] 1162-1162: syntax error

(syntaxError)

🪛 LanguageTool
CHANGELOG.md

[grammar] ~7-~7: A determiner cannot be combined with a possessive pronoun. Did you mean simply “the” or “its”?
Context: ...ion if the promise is deallocated while the its not fulfilled ## Version 3.0.0 - Intro...

(A_MY)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (20)
shared/src/map/layers/tiled/vector/geojson/Tiled2dVectorGeoJsonSource.h (1)

69-69: LGTM: Properly initializes lastVisibleTilesHash

The initialization of lastVisibleTilesHash to 0 is appropriate as mentioned in the comment on line 68, since there's no concept of curT for GeoJSON.

shared/src/map/layers/tiled/vector/sourcemanagers/Tiled2dMapVectorSourceDataManager.cpp (1)

43-47: Improved error handling for future results

Good addition of try-catch block that prevents unhandled exceptions when getting the future result from the readyManager. This enhances the robustness of the constructor.

Note: The static analysis warning about a syntax error on line 46 appears to be a false positive. The LogError << "message" <<= e.what() syntax seems to be part of the project's custom logging framework.

🧰 Tools
🪛 Cppcheck (2.10-2)

[error] 46-46: syntax error

(syntaxError)

shared/src/map/layers/tiled/vector/Tiled2dMapVectorLayerParserHelper.cpp (1)

204-206: Added support for 'extent' property in GeoJSON sources

This addition completes the feature that allows GeoJSON sources to specify extent options in style JSON files. The implementation follows the same pattern as the existing code for minzoom and maxzoom properties, and correctly uses uint32_t to support larger values.

shared/public/Actor.h (1)

90-90: Enhanced error logging for better diagnostics.

The error logging for WeakActor null pointer conditions now includes additional diagnostic information from fn.diagnostics.toString(). This provides more context when debugging issues where the actor's object or mailbox is no longer available.

Also applies to: 101-101, 112-112, 123-123, 141-141, 159-159

shared/src/map/layers/tiled/vector/Tiled2dMapVectorGeoJSONLayerConfig.h (1)

28-28: Added support for minZoom in GeoJSON sources.

This implements the new feature mentioned in the changelog that allows GeoJSON sources to specify minimum zoom levels. The configuration now properly reads the minZoom from the GeoJSON data and uses it when generating zoom level information instead of using a hardcoded value of 0.

Also applies to: 30-31, 33-33

shared/src/map/layers/tiled/vector/tiles/polygon/Tiled2dMapVectorPolygonTile.cpp (1)

102-102: Memory optimization for striped polygon rendering

This change optimizes memory allocation by conditionally reserving the appropriate amount of space for shader styles based on whether the polygon is striped. For striped polygons, two additional float values per feature are needed to store the stripe width.

shared/src/map/layers/tiled/vector/sourcemanagers/Tiled2dMapVectorSourceRasterTileDataManager.cpp (2)

195-201: Enhanced error handling for asynchronous operations

The added try-catch block properly handles potential exceptions when retrieving tile data from the raster source. This prevents crashes and allows for graceful degradation when the future operation fails.

🧰 Tools
🪛 Cppcheck (2.10-2)

[error] 199-199: syntax error

(syntaxError)


306-312: Enhanced error handling for asynchronous operations

Similar to the previous change, this try-catch block provides robust error handling for the asynchronous operation in reloadLayerContent. Good practice to ensure consistent error handling across similar code patterns.

shared/src/map/layers/tiled/vector/symbol/Tiled2dMapVectorSymbolLabelObject.cpp (1)

351-352: Improved thread safety and performance for baseline vector

The change from static to thread_local storage improves thread safety by ensuring each thread has its own vector instance. Additionally, using resize() with an initial value is more efficient than repeatedly pushing back values in a loop.

ios/graphics/Model/Polygon/PolygonGroup2d.swift (1)

139-146: Performance optimization for vertex processing

The implementation has been improved to leverage SIMD more effectively by directly processing vertex data as SIMD4 instead of individual components. This reduces pointer arithmetic and conditional checks, resulting in more efficient code.

ios/graphics/Model/Polygon/PolygonPatternGroup2d.swift (1)

166-173: Well-optimized SIMD code!

This change efficiently processes vertex data by using SIMD4 instead of individual Float values. This approach reduces the number of operations needed and improves memory access patterns by reading 4 components at once.

shared/src/map/layers/tiled/vector/geojson/geojsonvt/tile.hpp (2)

22-22: Good type expansion to support larger extents.

Changing from uint16_t to uint32_t allows for much larger tile extents (up to 4,294,967,295 instead of 65,535), which is needed for the new feature allowing GeoJSON sources to specify custom extents in style JSON files.


41-41: Type consistency maintained in constructor.

Correctly updated the constructor parameter type to match the member variable change, ensuring type consistency throughout the class definition.

shared/src/map/layers/tiled/vector/geojson/geojsonvt/geojsonvt.hpp (3)

22-22: Good type expansion for extent.

Changing from uint16_t to uint32_t allows for much larger tile extents, consistent with the changes in tile.hpp.


25-25: Good type expansion for buffer.

Changing the buffer type from uint16_t to uint32_t ensures consistency with the extent type and allows for larger buffer sizes.


90-90: Improved error handling for loader results.

This change properly captures the status and error code from the result into the loadingResult, which ensures that error information is correctly preserved for error handling.

shared/src/map/layers/tiled/vector/Tiled2dMapVectorLayer.cpp (3)

670-670: Thread-safety improvement.

Replacing static with thread_local ensures each thread has its own instance of the vector, preventing potential race conditions in multi-threaded contexts. This is an important improvement for thread safety.


1158-1164: Enhanced error handling for tile information retrieval.

Added proper exception handling when retrieving current tile information. If an exception occurs, it logs the error and continues with the next source, improving the robustness of the application.

🧰 Tools
🪛 Cppcheck (2.10-2)

[error] 1162-1162: syntax error

(syntaxError)


1399-1405: Consistent error handling pattern.

Applied the same error handling pattern as in getFeatureContext, maintaining code consistency while improving robustness.

shared/src/map/layers/effect/SphereEffectLayer.cpp (1)

77-78: Good improvement for thread safety!

Converting these vectors from static to thread_local storage is an excellent change. This ensures each thread has its own instance of the coefficient vectors, eliminating potential data races that could occur if multiple threads call update() concurrently. The initialization and usage patterns remain unchanged, but the code is now properly thread-safe.

@maurhofer-ubique maurhofer-ubique merged commit 3e984eb into main Feb 28, 2025
3 checks passed
@maurhofer-ubique maurhofer-ubique deleted the release/3.0.1 branch February 28, 2025 14:35
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.

4 participants