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: Save and decode ParsePolygon correctly #118

Merged
merged 3 commits into from
Jun 13, 2023
Merged

fix: Save and decode ParsePolygon correctly #118

merged 3 commits into from
Jun 13, 2023

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Jun 13, 2023

New Pull Request Checklist

Issue Description

ParsePolygon encoding during a save and decoding resulted in (longitude, latitude) when it should be
(latitude, longitude).

Approach

When a ParsePolygon is saved, encode it as (latitude, longitude). If querying with a ParsePolygon as a constraint, encode it as (longitude, latitude). Always decode a ParsePolygon as (latitude, longitude).

If a developer used ParseSwift <= 5.7.1 to save/update ParsePolygon's, they will need to update the respective ParseObject's by swapping the latitude and longitude manually.

Deprecated withinPolygon() query constraint for geoPoint() and polygonContains() for polygon()

TODOs before merging

  • Add tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@cbaker6 cbaker6 linked an issue Jun 13, 2023 that may be closed by this pull request
3 tasks
@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Merging #118 (5e8e03b) into main (7f07262) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage   91.57%   91.58%           
=======================================
  Files         173      173           
  Lines       15409    15425   +16     
=======================================
+ Hits        14111    14127   +16     
  Misses       1298     1298           
Impacted Files Coverage Δ
Sources/ParseSwift/Types/ParsePolygon.swift 97.84% <100.00%> (+0.12%) ⬆️
Sources/ParseSwift/Types/QueryConstraint.swift 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@cbaker6 cbaker6 merged commit 47548b3 into main Jun 13, 2023
25 checks passed
@cbaker6 cbaker6 deleted the fixPolygon branch June 13, 2023 17:50
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.

Latitude & Longitude misplacement of decoding ParsePolygon.
1 participant