feat: add radius parameter for spatial filtering for history api and expanded response api spatial queries using history api v2 style #2437
Open
motamman wants to merge 2 commits intoSignalK:masterfrom
Conversation
…expanded spatial queries using hsitory api v2 style
…sertions in history API tests
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
Extends the V2 History API with spatial filtering and enhanced path expressions, and adds a
radiusquery parameter to the Resources API for cross-API consistency.History API extensions
bbox,radius,distance, andpositionquery parameters on/history/values. Supports two equivalent styles for radius queries — the compactradius=lon, lat, metersform and the Resources API-compatibledistance=meters&position=[lon,lat]form. Mutually exclusive parameter combinations are validated and return HTTP 400.contextparameter: Allows querying historical data for a specific vessel or object (e.g.context=vessels.urn:mrn:imo:mmsi:123456789), defaulting tovessels.self.path:aggregate:smoothing:paramsyntax for post-aggregation smoothing (e.g.navigation.speedOverGround:average:sma:5computes bucket averages then applies a 5-sample Simple Moving Average). Supportssmaandemasmoothing methods.ValuesRequesttype:PathSpecgains an optionalsmoothingfield;ValuesRequestgains optionalbboxandradiusfields so providers receive structured, validated spatial data.Resources API
radiusquery parameter: AddedRadiusParamto the OpenAPI spec and referenced in all four resource collection GET endpoints (routes, waypoints, regions, notes). The built-in resources provider'sprocessParameters()parsesradius=lon,lat,metersinto the samegeoboundspolygon used bybboxanddistance+position.Tests
splitPathExpressionandparseValuesQuerycovering all path expression formats, spatial parameter parsing, mutual exclusivity validation, and error cases.radiusfiltering on the Resources API, mirroring the existingbboxtest.Documentation
radiusexample alongside existingbboxanddistanceexamples.Test plan
npm run buildcompiles cleanlynpm test— all existing and new tests passradiusquery on resources returns the same results as the equivalentbboxquery