Rasterize Point and MultiPoint in GeoJsonDocumentRasterOverlay#1400
Open
baruchInsert-tech wants to merge 1 commit into
Open
Rasterize Point and MultiPoint in GeoJsonDocumentRasterOverlay#1400baruchInsert-tech wants to merge 1 commit into
baruchInsert-tech wants to merge 1 commit into
Conversation
270d0bb to
c884b03
Compare
Point and MultiPoint geometry was silently dropped by the quadtree build: the bounding-box visitor returned no rectangle for them, so they never reached the rasterizer (which already knows how to draw them via VectorRasterizer::drawGeoJsonObject -> drawPoints). Make the Point/MultiPoint visitor operators produce a degenerate bounding rectangle at each coordinate and pad the tile's pixel footprint by the point's diameter (plus outline width), mirroring the existing line-width padding. Points then flow through the existing machinery and are rasterized as filled/outlined circles using VectorStyle::point. Adds render tests for Point, outlined Point, and MultiPoint, and a CHANGES.md entry.
c884b03 to
f1f83a5
Compare
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
CesiumVectorOverlays::GeoJsonDocumentRasterOverlaydid not actually rasterizePointandMultiPointgeometry, even though the changelog for v0.61.0 states that it can display points. This PR makes the document overlay genuinely render points, fixing that latent gap.The problem
The rasterizer already knows how to draw points:
VectorRasterizer::drawGeoJsonObjectroutesGeoJsonPoint/GeoJsonMultiPointtodrawPoints(..., style.point). The geometry just never got there.When
GeoJsonDocumentRasterOverlaybuilds its quadtree,addPrimitivesToDatarunsRectangleAndLineWidthFromObjectVisitorto compute a bounding rectangle for each object and only stores objects that produce one (if (rect)). The visitor'soperator()forGeoJsonPointandGeoJsonMultiPointwere empty, so points yielded no rectangle and were dropped before ever reaching the rasterizer.The fix
GeoJsonPoint/GeoJsonMultiPointvisitor operators so they build a (degenerate) bounding rectangle at each coordinate and bumpmaxLineWidthPixelsby the point's pixel footprint (2 * radius, plus the outline width when outlined), mirroring the existing line-width padding.Point/MultiPointbranch toQuadtreeGeometryData::calculateBoundingRectangleForTileSizeso per-tile bounds are padded by that same pixel footprint (otherwise points fell into the line branch and were sized bystyle.line).addPrimitivesToDatathat claimed points are intentionally not rasterized.Points then flow through the existing machinery and are rasterized as filled/outlined circles using
VectorStyle::point. No new drawing code was needed.Tests
Added three render tests to
TestGeoJsonDocumentRasterOverlay.cpp, each rasterizing an in-code document and asserting the expected colors appear:Pointrendered as a filled circle (fill color present).Pointwith an outline (both fill and outline colors present).MultiPoint(fill color present).All three pass locally (RelWithDebInfo), and
CesiumVectorOverlays+cesium-native-testsbuild clean.Changelog
Added a Fixes entry under the unreleased section. Note the v0.61.0 entry already (incorrectly) claimed the document overlay could display points; this PR makes that true.
issue #1403
@azrogers
@j9liu