Skip to content

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

Merged
merged 2 commits into from
Aug 15, 2017

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Aug 9, 2017

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

@codecov
Copy link

codecov bot commented Aug 9, 2017

Codecov Report

Merging #696 into master will increase coverage by 0.37%.
The diff coverage is 85.12%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...se/src/main/java/com/parse/ParseParcelEncoder.java 83.82% <0%> (-3.87%) 20 <0> (ø)
...se/src/main/java/com/parse/ParseParcelDecoder.java 85.29% <0%> (-2.59%) 31 <0> (ø)
Parse/src/main/java/com/parse/ParseQuery.java 74.18% <100%> (+0.25%) 81 <1> (+1) ⬆️
Parse/src/main/java/com/parse/ParseEncoder.java 94.44% <100%> (+0.5%) 36 <0> (+2) ⬆️
Parse/src/main/java/com/parse/ParseDecoder.java 96.92% <100%> (+0.55%) 23 <1> (+2) ⬆️
Parse/src/main/java/com/parse/ParseGeoPoint.java 64.86% <83.33%> (+1.62%) 16 <5> (+5) ⬆️
Parse/src/main/java/com/parse/ParsePolygon.java 84.5% <84.5%> (ø) 28 <28> (?)
Parse/src/main/java/com/parse/ParseObject.java 50.88% <85.71%> (+0.16%) 205 <2> (+2) ⬆️
...rse/src/main/java/com/parse/OfflineQueryLogic.java 63.08% <90.9%> (+0.76%) 111 <2> (+6) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1fead8...c0bf2c4. Read the comment docs.

Copy link
Contributor

@natario1 natario1 left a 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) {
Copy link
Contributor

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.

Copy link
Member Author

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 _.

Copy link
Contributor

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{
Copy link
Contributor

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

@natario1
Copy link
Contributor

What do you mean by TODO: Polygon? What's missing?

@dplewis
Copy link
Member Author

dplewis commented Aug 10, 2017

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

@natario1
Copy link
Contributor

Looks good to me. I have no way to test offline behavior right now but the tests look good. I'd say let's merge this and move to #684 ?

@rogerhu

@rogerhu
Copy link
Contributor

rogerhu commented Aug 15, 2017

great... go for it

@rogerhu rogerhu merged commit 351d54b into parse-community:master Aug 15, 2017
@dplewis dplewis deleted the type-polygon branch January 9, 2018 22:13
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.

3 participants