Circle radius propblem v8.5.3

I'm trying to insert a location that is using a circle processor to generate the circle points. Location [30, 10] in the document is generated with the circle points properly.
docs: Circle processor | Elasticsearch Guide [8.5] | Elastic

PUT _ingest/pipeline/polygonize_circles
{
  "description": "translate circle to polygon",
  "processors": [
    {
      "circle": {
        "field": "circle",
        "error_distance": 1,
        "shape_type": "geo_shape"
      }
    }
  ]
}


PUT circles
{
  "mappings": {
    "properties": {
      "circle": {
        "type": "geo_shape"
      }
    }
  }
}
 

PUT circles/_doc/2?pipeline=polygonize_circles
{
  "circle": {
    "type": "circle",
    "radius": "40m",
    "coordinates": [35.539917, -78.472000]
  }
}

GET circles/_doc/2

But if I use another location. The generated coordinate looks like an oval with the wrong radius.

my location [35.54171753710938, -78.472]

created coordinates:
"circle": {
            "coordinates": [
              [
                [
                  35.54171753710938,
                  -78.472
                ],
                [
                  35.54112406581135,
                  -78.47173430472324
                ],
                [
                  35.540630197847186,
                  -78.47167003953963
                ],
                [
                  35.540375564960186,
                  -78.47165140797998
                ],
                [
                  35.54021828908823,
                  -78.47164529506406
                ],
                [
                  35.54010640465818,
                  -78.47164274491611
                ],
                [
                  35.54001650261309,
                  -78.47164162397662
                ],
                [
                  35.53993651647515,
                  -78.47164003979641
                ],
                [
                  35.539858062238046,
                  -78.47164049555624
                ],
                [
                  35.53977439153409,
                  -78.47164207973975
                ],
                [
                  35.5396750942597,
                  -78.47164321572573
                ],
                [
                  35.5395458932956,
                  -78.47164846905713
                ],
                [
                  35.539348254773515,
                  -78.47165779735127
                ],
                [
                  35.53899878746994,
                  -78.47169061817682
                ],
                [
                  35.53833938849573,
                  -78.47182842440924
                ],
                [
                  35.53833938849573,
                  -78.47217157559075
                ],
                [
                  35.53899878746994,
                  -78.47230938182317
                ],
                [
                  35.539348254773515,
                  -78.47234220264872
                ],
                [
                  35.5395458932956,
                  -78.47235153094286
                ],
                [
                  35.5396750942597,
                  -78.47235678427425
                ],
                [
                  35.53977439153409,
                  -78.47235792026024
                ],
                [
                  35.539858062238046,
                  -78.47235950444374
                ],
                [
                  35.53993651647515,
                  -78.47235996020358
                ],
                [
                  35.54001650261309,
                  -78.47235837602337
                ],
                [
                  35.54010640465818,
                  -78.47235725508388
                ],
                [
                  35.54021828908823,
                  -78.47235470493592
                ],
                [
                  35.540375564960186,
                  -78.47234859202001
                ],
                [
                  35.540630197847186,
                  -78.47232996046036
                ],
                [
                  35.54112406581135,
                  -78.47226569527675
                ],
                [
                  35.54171753710938,
                  -78.472
                ]
              ]
            ],
            "type": "Polygon"
          }

Is it an issue or It's working as expected? Because the coordinates are not a circle so it's impacting the search result.

This is working as expected, the circle processor "polygonize" the circle as the index does not support indexing circles natively.

1 Like

@Ignacio_Vera

Thanks for your reply. Is there any way to transform a point along with the radius to a circle similar CircleShape in ESS 6.8? We are doing the upgrade from 6.8 to 8.5.3 and got this issue by using the Circle Processor.
When I map the generated coordinate in Gooogle Maps. It looks like this.

I tried your first example and indeed the generated polygon looks in kibana maps like :

But this is a problem of the precision you are using. If I change the precision to 0.001:

PUT _ingest/pipeline/polygonize_circles
{
  "description": "translate circle to polygon",
  "processors": [
    {
      "circle": {
        "field": "circle",
        "error_distance": 0.01,
        "shape_type": "geo_shape"
      }
    }
  ]
}

Then it looks much better:

Could you explain how are you generating the second example? I tried to see if I can reproduce it but I could not. I tried the following:

PUT _ingest/pipeline/polygonize_circles
{
  "description": "translate circle to polygon",
  "processors": [
    {
      "circle": {
        "field": "circle",
        "error_distance": 100,
        "shape_type": "geo_shape"
      }
    }
  ]
}

PUT circles/_doc/2?pipeline=polygonize_circles
{
  "circle": {
    "type": "circle",
    "radius": "2000m",
    "coordinates": [-122.25, 37.47]
  }
}

And it looks like:

2 Likes

Sorry. I missed it. The input coordinate should be lon, lat instead of lat, lon. It's working now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.