Skip to content

Rasterize Point and MultiPoint in GeoJsonDocumentRasterOverlay#1400

Open
baruchInsert-tech wants to merge 1 commit into
CesiumGS:mainfrom
baruchInsert-tech:geojson-document-overlay-points
Open

Rasterize Point and MultiPoint in GeoJsonDocumentRasterOverlay#1400
baruchInsert-tech wants to merge 1 commit into
CesiumGS:mainfrom
baruchInsert-tech:geojson-document-overlay-points

Conversation

@baruchInsert-tech

@baruchInsert-tech baruchInsert-tech commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

CesiumVectorOverlays::GeoJsonDocumentRasterOverlay did not actually rasterize Point and MultiPoint geometry, 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::drawGeoJsonObject routes GeoJsonPoint/GeoJsonMultiPoint to drawPoints(..., style.point). The geometry just never got there.

When GeoJsonDocumentRasterOverlay builds its quadtree, addPrimitivesToData runs RectangleAndLineWidthFromObjectVisitor to compute a bounding rectangle for each object and only stores objects that produce one (if (rect)). The visitor's operator() for GeoJsonPoint and GeoJsonMultiPoint were empty, so points yielded no rectangle and were dropped before ever reaching the rasterizer.

The fix

  • Implement the GeoJsonPoint / GeoJsonMultiPoint visitor operators so they build a (degenerate) bounding rectangle at each coordinate and bump maxLineWidthPixels by the point's pixel footprint (2 * radius, plus the outline width when outlined), mirroring the existing line-width padding.
  • Add a Point/MultiPoint branch to QuadtreeGeometryData::calculateBoundingRectangleForTileSize so per-tile bounds are padded by that same pixel footprint (otherwise points fell into the line branch and were sized by style.line).
  • Update the now-stale comment in addPrimitivesToData that 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:

  • Point rendered as a filled circle (fill color present).
  • Point with an outline (both fill and outline colors present).
  • MultiPoint (fill color present).

All three pass locally (RelWithDebInfo), and CesiumVectorOverlays + cesium-native-tests build 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

@baruchInsert-tech baruchInsert-tech force-pushed the geojson-document-overlay-points branch from 270d0bb to c884b03 Compare June 22, 2026 11:29
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.
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.

GeoJsonDocumentRasterOverlay does not rasterize Point / MultiPoint geometry

3 participants