tidwall / tile38

Real-time Geospatial and Geofencing
https://tile38.com
MIT License
9.15k stars 569 forks source link

Intersect boundaries returning incorrect results #313

Closed stephenlacy closed 6 years ago

stephenlacy commented 6 years ago

Josh, Found another intersects returning results outside it's boundary.

Reproduction: https://gist.github.com/stevelacy/8f58d1f66a537f225a7bbb3d6ccc470d

{"ok":true,"ids":["portland-or","earth","usa","seattle-wa"],"count":4,"cursor":0,"elapsed":"21.028092ms"}

Both seattle and portland are triggered.

Boundary: screen shot 2018-05-09 at 10 43 41

MultiPolygon (highlighted in orange)

screen shot 2018-05-09 at 10 45 19

tidwall commented 6 years ago

I published a new release v1.12.2. Thanks!

stephenlacy commented 6 years ago

awesome thanks!!!

panchicore commented 6 years ago

+1.

Came here because a MultiPolygon of Norway was returning as intersected [in geonames country] in far countries:

[0L, ['gn_149590_Tanzania', 'gn_2017370_Russia', 'gn_2510769_Spain', 'gn_2461445_WesternSahara', 'gn_2378080_Mauritania', 'gn_2589581_Algeria', 'gn_2264397_Portugal', 'gn_2420477_Guinea', 'gn_366755_Sudan', 'gn_1036973_Mozambique', 'gn_357994_Egypt', 'gn_298795_Turkey', 'gn_690791_Ukraine', 'gn_3042362_Guernsey', 'gn_2802361_Belgium', 'gn_2750405_Netherlands', 'gn_2963597_Ireland', 'gn_3042225_IsleofMan', 'gn_3371123_BouvetIsland', 'gn_953987_SouthAfrica', 'gn_3370751_SaintHelena', 'gn_2635167_UnitedKingdom', 'gn_3355338_Namibia', 'gn_3351879_Angola', 'gn_203312_DemocraticRepublicoftheCongo', 'gn_2287781_IvoryCoast', 'gn_2542007_Morocco', 'gn_3175395_Italy', 'gn_2562770_Malta', 'gn_2464461_Tunisia', 'gn_3194884_Montenegro', 'gn_3202326_Croatia', 'gn_2623032_Denmark', 'gn_630336_Belarus', 'gn_597427_Lithuania', 'gn_453733_Estonia', 'gn_2233387_Cameroon', 'gn_2328926_Nigeria', 'gn_783754_Albania', 'gn_2400553_Gabon', 'gn_2309096_EquatorialGuinea', 'gn_2410758_SaoTomeandPrincipe', 'gn_2215636_Libya', 'gn_2661886_Sweden', 'gn_3144096_Norway', 'gn_660013_Finland', 'gn_661882_AlandIslands', 'gn_2622320_FaroeIslands', 'gn_607072_SvalbardandJanMayen', 'gn_390903_Greece', 'gn_3017382_France', 'gn_3164670_Vatican', 'gn_2921044_Germany']]

(Note how this little one were involved)

Updated to 1.12 and now results are:

[0L, ['gn_3371123_BouvetIsland', 'gn_2017370_Russia', 'gn_2661886_Sweden', 'gn_607072_SvalbardandJanMayen', 'gn_660013_Finland', 'gn_3144096_Norway']]

Touches only neighbors so makes more sense with the quality of data indexed on tile38 instance.

Thanks for the fix.