Allow coordinate pairs in $geoWithin/$polygon query#4064
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4064 +/- ##
==========================================
+ Coverage 90.7% 90.71% +0.01%
==========================================
Files 116 116
Lines 7916 7920 +4
==========================================
+ Hits 7180 7185 +5
+ Misses 736 735 -1
Continue to review full report at Codecov.
|
|
Can you add support for PFPolygon? |
|
@dplewis, I’m not sure I understand. Looks like the iOS SDK already supports withinPolygon queries? |
|
@madsb never mind as it would require change to all sdks |
|
Ah, I see - you mean adding something like Parse.Polygon to the JS SDK? I briefly considered that but seemed like it would take a little more time than I had. |
|
Parse.Polygon is already in parse-server |
|
@dplewis That's correct, but I was talking about the JS SDK. Anyway, I think I've found a bug. When saving a Polygon object to the database, the coordinates are saved as [lat, lon] pairs. But mongo expects [lon, lat] which makes $geoIntersect queries fail. |
|
@madsb For that I'm just waiting for parse-server 2.6.0 to be released then I'll rerun the tests. It works locally. Edited: I meant adding to this PR. |
|
The tests are succeeding with the test coordinates, but try running the |
|
Alright, never mind... I was confused about the whole lat/lon lon/lat thing. GeoJSON is lon/lat, and thus I must also define lon/lat when saving my Polygon object. Pretty confusing when everything else in Parse is lat/lon 😬 |
|
Yeah WGS84 is annoying. What about __type: Polygon to this PR? |
|
Yeah, my epiphany above has kind of invalidated this pull request, so I'll close this and open a new one with |
This pull requests allows for a polygon that consists of an array of basic coordinate pairs besides an array of
Parse.GeoPoints.