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

Fix a bug with transforming GeoJSON to WKT #1342

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

greg-does-weather
Copy link
Collaborator

What does this PR do? 🛠️

Due to a bad assumption about what the API returns (I assumed it was always polygons or nothing), the process by which we converted an alert geometry into a SQL query would break on multipolygons. This PR implements a new helper method called geoJSONtoSQL, which takes the entire GeoJSON object (instead of just the list of points) and uses the GeoJSON geometry type as a switch for what kind of WKT text to create.

Copy link
Member

@loganmcdonald-noaa loganmcdonald-noaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the code and to me trigonometry-challenged mind it makes sense :) nice test.

@greg-does-weather greg-does-weather merged commit 91d8a08 into main Jun 20, 2024
11 of 13 checks passed
@greg-does-weather greg-does-weather deleted the mgwalker/1331-multipolygon-bug branch June 20, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SpatialUtility doesn't handle Multipolygon geometries
2 participants