Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add geo::latLng() #128

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions spec/14-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,30 @@ global_geo_validate(args):
- If the length of {args} is not 1:
- Report an error.

### geo::latLng()

Takes latitude and longitude as arguments and returns a Geo Point.

geo_latLng(args, scope):

- Let {latNode} be the first element of {args}.
- Let {lngNode} be the second element of {args}.
- Let {lat} be the result of {Evaluate(latNode, scope)}.
- Let {lng} be the result of {Evaluate(lngNode, scope)}.
- If {lat} or {lng} is not a number:
- Return {null}.
- If {lat} is not in the range of -90 to 90:
- Return {null}.
- If {lng} is not in the range of -180 to 180:
- Return {null}.
- Otherwise:
- Return a GeoJSON Point with {lat} and {lng} as coordinates, in lng, lat order.

geo_latLng_validate(args):

- If the length of {args} is not 2:
- Report an error.

### geo::contains()

Returns true if first geo argument completely contains the second one, using a planar (non-spherical) coordinate system. Both geo argument can be any geo value. A geo value is considered contained if all its points are within the boundaries of the first geo value. For `MultiPolygon`, it's sufficient that only one of the polygons contains the first geo value.
Expand Down
2 changes: 1 addition & 1 deletion spec/GROQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _Current Working Draft_
This is the specification for GROQ (**G**raph-**R**elational **O**bject **Q**ueries), a query language and execution engine made at Sanity, Inc, for filtering and projecting JSON documents. The work started in 2015. The development of this open standard started in 2019.

GROQ is authored by [Alexander Staubo](https://twitter.com/purefiction) and [Simen Svale Skogsrud](https://twitter.com/svale).
Additional follow up work by [Erik Grinaker](https://twitter.com/erikgrinaker), [Magnus Holm](https://twitter.com/judofyr), [Radhe](https://github.com/j33ty), [Israel Roldan](https://github.com/israelroldan), [Sindre Gulseth](https://github.com/sgulseth), [Matt Craig](https://github.com/codebymatt).
Additional follow up work by [Erik Grinaker](https://twitter.com/erikgrinaker), [Magnus Holm](https://twitter.com/judofyr), [Radhe](https://github.com/j33ty), [Israel Roldan](https://github.com/israelroldan), [Sindre Gulseth](https://github.com/sgulseth), [Matt Craig](https://github.com/codebymatt), [Espen Hovlandsdal](https://github.com/rexxars).

This specification should be considered _work in progress_ until the first release.

Expand Down
Loading