-
-
Notifications
You must be signed in to change notification settings - Fork 736
Add Type Polygon to Schema and PolygonContains to query #696
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #696 +/- ##
===========================================
+ Coverage 52.62% 53% +0.37%
- Complexity 1680 1726 +46
===========================================
Files 131 132 +1
Lines 10120 10240 +120
Branches 1409 1432 +23
===========================================
+ Hits 5326 5428 +102
- Misses 4353 4364 +11
- Partials 441 448 +7
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work man, thanks!
/** | ||
* Throws exception for invalid coordinates. | ||
*/ | ||
static List<ParseGeoPoint> _validate(List<ParseGeoPoint> coords) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove the _? This can just be private
I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about using this for offline query in the future and wanted it to be exposed. I can still remove the _.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's fine
/** | ||
* Get converts coordinate to JSONArray. | ||
*/ | ||
public JSONArray coordinatesToJSONArray() throws JSONException{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make this package protected? We are not exposing JSONs anywhere in the SDK
What do you mean by |
I realized parse server doesn't support PFPolygon in PFConfig. I'll make a separate PR for it in the future. This PR is good 😊 Edit: I only use iOS so if someone can test offline queries on android that would help |
great... go for it |
parse-community/parse-server#3944
I've also added a containsPoint function that can be used for live queries.
ParseGeoPoint was missing equality and tests