feat(bindings): asMVTGeom + geoMeasure for tgeompoint#84
Closed
estebanzimanyi wants to merge 1 commit intomainfrom
Closed
feat(bindings): asMVTGeom + geoMeasure for tgeompoint#84estebanzimanyi wants to merge 1 commit intomainfrom
estebanzimanyi wants to merge 1 commit intomainfrom
Conversation
Closes the visualization-essential analytics in geo/076_tpoint_analytics so users can both encode trajectories for Mapbox Vector Tile rendering and add a measure dimension (M-coord) from a parallel tfloat. New SQL surface (6 registrations): - asMVTGeom(tgeompoint, stbox bounds[, extent[, buffer[, clip bool]]]) -> STRUCT(geom geometry, times bigint[]) 4 overloads (default extent=4096, buffer=256, clip=TRUE). Routes to MEOS tpoint_as_mvtgeom which clips the trajectory to the tile bounds and projects to vector-tile coordinates. - geoMeasure(tgeompoint, tfloat measure[, segmentize boolean]) -> geometry 2 overloads (default segmentize=FALSE). Routes to MEOS tpoint_tfloat_to_geomeas which produces an M-coord geometry: the trajectory's spatial path with each vertex carrying the measure's value at that timestamp. asMVTGeom output schema is STRUCT(geom GEOMETRY, times BIGINT[]) — single row per input, with `times` being the array of Unix-epoch seconds for each vertex of the encoded geometry. Hooked into LoadInternal via a new RegisterAnalyticsViz method on TgeompointType. Test: test/sql/parity/076_asmvtgeom_geomeasure.test (6 assertions covering the typeof shape, default- and custom-extent encodings, times-array length, and both geoMeasure overloads). Full suite: 758 / 14 cases under TZ=UTC.
Member
Author
|
Superseded by the consolidated PR branch |
3 tasks
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.
Closes the visualization-essential analytics in `geo/076_tpoint_analytics` so users can encode trajectories for Mapbox Vector Tile rendering and add a measure dimension (M-coord) from a parallel `tfloat`.
New SQL surface (6 scalar registrations)
Implementation notes
asMVTGeom
Output is a single-row composite `STRUCT(geom GEOMETRY, times BIGINT[])` matching MobilityDB's `geom_times` type. MEOS hands back one clipped/projected geometry plus a parallel array of Unix-epoch second timestamps (one per vertex). The exec function:
geoMeasure
Routes `tpoint_tfloat_to_geomeas(tpoint, measure, segmentize, &geom)` and encodes the resulting GSERIALIZED with M-coord via `GSerializedToGeometry`.
Both are scalar functions, no TableFunction infra required.
Tests
Coverage delta
Per the audit in PR #66:
Test plan