Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1637

Geospatial queries on collections don't seem to work

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      We have the following model:

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      public partial class Company : IRealmObject
      {
          public string Name { get; set; }
      
          public IList<CustomGeoPoint> Offices { get; }
      }
      
      public partial class CustomGeoPoint : IEmbeddedObject
      {
          public IList<double> coordinates { get; }
      
          public string type { get; set; } = "Point";
      }
      

      And the following data:

      [{ "Name":"1,2",
          "Offices":[{
              "type":"Point",
              "coordinates":[ 1.0, 1.0 ]
          }, {
              "type":"Point",
              "coordinates":[ 2.0, 2.0 ]
          }]
      }, { 
          "Name":"2,3",
          "Offices":[{
              "type":"Point",
              "coordinates":[ 2.0, 2.0 ]
          }, {
              "type":"Point",
              "coordinates":[ 3.0, 3.0 ]
          }]
      }]
      

      Then, this query doesn't return any results, even though I would expect it to match the first company:

      Offices GEOWITHIN GeoSphere([1, 1], 0.00872665)
      

            Assignee:
            james.stone@mongodb.com James Stone
            Reporter:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: