Add shared GPS filtering and scanner crime context - #98
Merged
Merged
Conversation
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.
Why
Located records already exist across crime, weather, aviation and other collections, but callers cannot query them consistently by GPS. Scanner coverage also needs to be distinguished from receiver location before attaching nearby crime context.
Changes
lat,long,radius,unit, andbboxvalidation and database filtering before result limits. Support nearest-firstsort=distance,distance_m, and offset pagination for distance-sorted item/feed views./crimesand/scannersaliases to the existing crime collection.scanner-directoryadapter for permissioned JSON catalogs. Store provider, player URL, declared stream permissions, coverage basis and location provenance. No third-party catalog is scraped or enabled automatically./api/v1/items/:id/nearby-crimeand scanner-page context with date filters. Return reported incidents inside coverage, preserving source precision and explicitly separating proximity from verified links to radio transmissions.docs/geographic-queries.md.Validation
git diff --checkpassed.Tests execute actual query functions against PGlite/PostgreSQL, covering mixed collections, limits, distances, miles, invalid coordinates, antimeridian/polar points, polygon holes, index eligibility, saved-feed intersections, notification cursors, CLI/MCP fields, HTML navigation and crime context.
Deployment and limits
0023_geographic_queries.sqlneeds no PostGIS/container change. Its initial ordinaryCREATE INDEXruns inside the migration transaction and blocks writes while building; schedule a maintenance window for a large production table and measure on a production-sized copy first.