-
Notifications
You must be signed in to change notification settings - Fork 0
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
isValid2DCoordinate #1
Comments
M-Scott-Lassiter
added
the
new matcher proposal
Proposal for a new GeoJSON matcher
label
May 18, 2022
M-Scott-Lassiter
changed the title
[New Matcher Request]: areValid2DCoordinates
[New Matcher]: areValid2DCoordinates
May 18, 2022
M-Scott-Lassiter
changed the title
[New Matcher]: areValid2DCoordinates
[New Matcher]: isValid2DCoordinate
May 18, 2022
Closed
github-actions bot
pushed a commit
that referenced
this issue
May 19, 2022
## 1.0.0-beta.1 (2022-05-19) ### 🎯 Test Changes * setup the project testing framework ([6a95c37](6a95c37)) ### 🎁 Feature Changes * **isValid2DCoordinate:** add new matcher function ([527bbc4](527bbc4)), closes [#1](#1) * **isValid3DCoordinate:** add new matcher function ([0329231](0329231)), closes [#2](#2) ### 🏗️ Build Changes * add conventional-changelog-conventionalcommits as dev dependency ([7361d79](7361d79)), closes [#3](#3) * setup initial project environment ([b468a41](b468a41))
🎉 This issue has been resolved in version 1.0.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closed
M-Scott-Lassiter
added
matchers/coordinates
and removed
new matcher proposal
Proposal for a new GeoJSON matcher
labels
May 24, 2022
M-Scott-Lassiter
changed the title
[New Matcher]: isValid2DCoordinate
isValid2DCoordinate
May 24, 2022
github-actions bot
pushed a commit
that referenced
this issue
Jun 2, 2022
## 1.0.0 (2022-06-02) ### 🧭 API Documentation Changes * **toBeMultiLineStringGeometry:** add the min point count error to the JSDoc API ([01f6c4b](01f6c4b)) * change JSDoc param types to avoid using GeoJSON unknown types ([06ac03a](06ac03a)) * **all:** cleanup JSDoc formatting and standardize API examples ([300a96d](300a96d)) * update JSDoc descriptions of coordinate core functions ([f5658f3](f5658f3)) * update JSDoc organization ([7ab7eca](7ab7eca)) * **isValidCoordinate:** update returns description ([70bd43e](70bd43e)) * **isValidCoordinate:** update the error and parameter descriptions ([7e3e8ed](7e3e8ed)) ### 🐞 Bug Fixes * add bounding box validity checking to geometry core functions and matchers ([ac6a9a1](ac6a9a1)), closes [/datatracker.ietf.org/doc/html/rfc7946#section-5](https://github.com/M-Scott-Lassiter//datatracker.ietf.org/doc/html/rfc7946/issues/section-5) [#9](#9) [#10](#10) [#11](#11) [#12](#12) [#13](#13) [#14](#14) [#16](#16) [#29](#29) * **toBeLineStringGeometry:** prohibit single coordinate in "coordinates" member ([ee5de52](ee5de52)), closes [/datatracker.ietf.org/doc/html/rfc7946#section-3](https://github.com/M-Scott-Lassiter//datatracker.ietf.org/doc/html/rfc7946/issues/section-3) [#11](#11) ### 🎯 Test Changes * add 'Feature' and 'FeatureCollection' to test list of disallowed geometry type values ([f139a09](f139a09)) * **toBeLineStringGeometry:** add a stress test with many points ([22df5c7](22df5c7)) * **toBeGeometryCollection:** add an unrecognizable geometry to the invalid tests ([5c041c6](5c041c6)) * **toBeGeometryCollection:** add robust snapshot tests, verify coordinates treated as foreign member ([472d12d](472d12d)), closes [#32](#32) [#33](#33) * **isValid2DBoundingBox:** add robust snapshot tests ([4363710](4363710)), closes [#32](#32) * **isValid2DCoordinate:** add robust snapshot tests ([ae92f67](ae92f67)), closes [#32](#32) * **isValid3DBoundingBox:** add robust snapshot tests ([a37ec48](a37ec48)), closes [#32](#32) * **isValid3DCoordinate:** add robust snapshot tests ([56fbf92](56fbf92)), closes [#32](#32) * **isValidBoundingBox:** add robust snapshot tests ([063b94e](063b94e)), closes [#32](#32) * **isValidCoordinate:** add robust snapshot tests ([7b4a804](7b4a804)), closes [#32](#32) * **toBeAnyGeometry:** add robust snapshot tests ([8a6e611](8a6e611)), closes [#32](#32) * **toBeLineStringGeometry:** add robust snapshot tests ([cfaed46](cfaed46)), closes [#32](#32) * **toBeMultiLineStringGeometry:** add robust snapshot tests ([57dc767](57dc767)), closes [#32](#32) * **toBeMultiPointGeometry:** add robust snapshot tests ([36013e1](36013e1)), closes [#32](#32) * **toBeMultiPolygonGeometry:** add robust snapshot tests ([df1c23a](df1c23a)), closes [#32](#32) * **toBePointGeometry:** add robust snapshot tests ([fd5c516](fd5c516)), closes [#32](#32) * **toBePolygonGeometry:** add robust snapshot tests ([1c9df69](1c9df69)), closes [#32](#32) * **toBeMultiLineStringGeometry:** fix coordinate out of range test that ([d6fe2ac](d6fe2ac)) * **toBeMultiPointGeometry:** fix typo in test and core function that was omitting coverage ([bc10f4e](bc10f4e)) * **isValid2DBoundingBox:** fix typo in test descriptions ([df94c27](df94c27)) * setup the project testing framework ([6a95c37](6a95c37)) ### 🎁 Feature Changes * **isValid2DBoundingBox:** add new matcher function ([7fe56f3](7fe56f3)), closes [#6](#6) * **isValid2DCoordinate:** add new matcher function ([527bbc4](527bbc4)), closes [#1](#1) * **isValid3DCoordinate:** add new matcher function ([0329231](0329231)), closes [#2](#2) * **isValidCoordinate:** add new matcher function ([d7e5b70](d7e5b70)), closes [#4](#4) * **isValid3DBoundingBox:** add new matcher ([6ee8cc6](6ee8cc6)), closes [#7](#7) * **isValidBoundingBox:** add new matcher ([9a8b7ed](9a8b7ed)), closes [#8](#8) * **toBeAnyGeometry:** add new matcher ([ed7c3eb](ed7c3eb)), closes [#15](#15) * **toBeFeature:** add new matcher ([551aa7f](551aa7f)), closes [#32](#32) [#24](#24) * **toBeFeatureCollection:** add new matcher ([21fe044](21fe044)), closes [#25](#25) * **toBeGeometryCollection:** add new matcher ([63cc919](63cc919)), closes [#16](#16) * **toBeLineStringGeometry:** add new matcher ([54416a5](54416a5)), closes [#11](#11) * **toBeMultiLineStringGeometry:** add new matcher ([3d3a15e](3d3a15e)), closes [#12](#12) * **toBeMultiPointGeometry:** add new matcher ([9a12752](9a12752)), closes [#10](#10) * **toBeMultiPolygonGeometry:** add new matcher ([41fef3a](41fef3a)), closes [#14](#14) * **toBePointGeometry:** add new matcher ([9973afa](9973afa)), closes [#9](#9) * **toBePolygonGeometry:** add new matcher ([3b9d18d](3b9d18d)), closes [#13](#13) * split package exports into matcher and core functionality ([a7340d9](a7340d9)), closes [#5](#5) ### 🏗️ Build Changes * add conventional-changelog-conventionalcommits as dev dependency ([7361d79](7361d79)), closes [#3](#3) * **package:** add entry points for all, boundingboxes, and coordinates ([8c1d312](8c1d312)) * move release configuration into a separate shareable file ([fa6e50d](fa6e50d)) * **package:** rename matcher loader entry script ([5221d6d](5221d6d)) * setup initial project environment ([b468a41](b468a41)) * **package:** update the commitizen config for customized scopes ([ac05626](ac05626)) * **devDependencies:** upgrade Jest to v28.1, specify peerDependency at >v24.0.0 ([22d1614](22d1614)), closes [#30](#30) * **package:** upgrade min required Node version to 16 ([58a9824](58a9824)) * **package:** upgrade minimum required node version from 10 to 14 to match LTS schedule ([1e8a8bb](1e8a8bb))
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
18 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
For testing 3D coordinates, see
isValid3DCoordinate
. For testing either, seeisValidCoordinate
.This is one of the first building block matchers needed. Coordinates are the basis of all objects, and we need a way to reliably test that they have been formatted appropriately.
This matcher should limit its scope by only taking an argument of an individual array value (i.e. not the entire property).
This matcher will enforce two-member arrays. Separate matchers will be used for 3D arrays and for validating that geometries and features have a correct
coordinates
key.Any values outside of these WGS-84 standards should fail.
Valid GeoJSON Coordinate Examples
A two-element array of points:
An array of coordinates:
An array of arrays of coordinates:
In each case, the matcher should only get passed the value of a single coordinate, not the object itself.
Example Matcher Usage
Passing Tests
Values in Range
[0, 0]
,[102.0, 0.5]
,[172.0, -15]
,[-10.9, 77]
,[-152.0, -33.33333]
[180, 0]
,[-180, 0]
,[0, 90]
,[0,-90]
,[180, 90]
,[180,-90]
,[-180, 90]
,[-180,-90]
Failing Tests
Coordinates input not an array
undefined
null
true
,false
200
,-200
,Infinity
,-Infinity
,NaN
{ coordinates: [0, 0] }
''
,'Random Coordinate'
,'[0, 0]'
,'[[0, 0], [0, 0]]'
Incorrect number of array elements
[ ]
,[ 20 ]
,[20, 30, 0]
,[20, 30, 0, 20, 30, 0, 20, 30, 0]
Coordinates out of range
[0, 90.0000001]
,[0, -90.0000001]
,[0, 900000]
,[0, -900000]
[180.0000001, 0]
,[-180.0000001, 0]
,[1800000, 0]
,[-1800000, 0]
[181, 91]
,[181, -91]
,[-181, 91]
,[-181, -91]
Coordinates have non-number values
[<value>, 0]
[0, <value>]
[<value>, <value>]
Array nested too deeply
[ [ [1, 1], [0, 0] ] ]
[ [ [10, 20], [2, 59] ] ]
[ [ [10, 20], [2, 90], [95, 5] ] ]
[ [ [ [1, 1], [0, 0] ] ] ]
,[ [ [ [ [2, 2], [3, 3] ] ] ] ]
The text was updated successfully, but these errors were encountered: