-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Prevent users from entering impossible geographic coordinates in the editor #2159
Comments
In addition to inverted coordinates, another thing to check for may be bounding boxes that attempt to traverse the international dateline or tries to contain the north or south poles, which don't really work. |
We now have a |
- Show validation error when N coord is less than S coord - Fix the HTML input pattern for decimal degrees (was throwing an error) - Add a test for reversed coords to the EMLGeoCoverage model spec Issue #2159
- Add validation rule to prevent bounding boxes from: containing the poles or crossing the anti-meridian - Add unit tests for the new validation rules Issue #2159
These are great. Could the errors also include solutions? For example, something like:
Maybe it could be shorter, but that's the idea. |
Yes, good idea! |
- For each error type, provide solutions for invalid geo coverages - Move error messages to an object in the model (rather than a switch statement) - Update tests to get error messages from the model Issue #2159
✅ Done! (@mbjones please let me know if any of these should be tweaked) errorMessages: {
"default": "Please correct the geographic coverage.",
"north": "Northwest latitude out of range, must be >-90 and <90. Please correct the latitude.",
"east": "Southeast longitude out of range (-180 to 180). Please adjust the longitude.",
"south": "Southeast latitude out of range, must be >-90 and <90. Please correct the latitude.",
"west": "Northwest longitude out of range (-180 to 180). Check and correct the longitude.",
"missing": "Latitude and longitude are required for each coordinate. Please complete all fields.",
"description": "Missing location description. Please add a brief description.",
"needPair": "Location requires at least one coordinate pair. Please add coordinates.",
"northSouthReversed": "North latitude should be greater than South. Please swap the values.",
"crossesAntiMeridian": "Bounding box crosses the anti-meridian. Please use multiple boxes that meet at the anti-meridian instead.",
"containsPole": "Coordinates include a pole. Latitudes should be >-90 and <90."
} |
Describe the feature you'd like
Build some logic In the geographic coverage section of the editor that prevents users from entering in coordinates that don't make sense, like a bounding box that has the south point further north than the north point.
Additional context
A dataset seems to have reversed the north and south coordinate of the bounding box, and this prevented it from being indexed properly in Solr. As a result, the dataset did not appear on the catalog search map:
. See #2158.
Related to: #303
The text was updated successfully, but these errors were encountered: