# Geo\_shape: False positives when the polygon has aligned points

**URL:** <https://discuss.elastic.co/t/geo-shape-false-positives-when-the-polygon-has-aligned-points/240725>\
**Category:** Elasticsearch\
**Created:** [July 10, 2020, 3:49pm UTC](https://discuss.elastic.co/t/geo-shape-false-positives-when-the-polygon-has-aligned-points/240725 "2020-07-10T15:49:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![franck.valentin](https://avatars.discourse-cdn.com/v4/letter/f/d2c977/32.png) [@franck.valentin](https://discuss.elastic.co/u/franck.valentin)\
**Post date:** [July 10, 2020, 3:49pm UTC](https://discuss.elastic.co/t/geo-shape-false-positives-when-the-polygon-has-aligned-points/240725/1 "2020-07-10T15:49:53Z")

</div>

Hi,

I got false positives when searching intersections with a polygon that have aligned points:  
For example, after indexing the following FeatureCollection (directly from Kibana):

```auto
    {
        "type": "FeatureCollection",
        "name": "testGeoJson_polygon1",
        "crs": {
            "type": "name",
            "properties": {
                "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
            }
        },
        "features": [{
                "type": "Feature",
                "properties": {},
                "geometry": {
                    "type": "Polygon",
                    "coordinates": [[
    				[180.0, -36], 
    				[180, 90], 
    				[-180, 90], 
    				[-180, 79], 
    				[16, 58], 
    				[8, 13], 
    				[-180, 74], 
    				[-180, -85], 
    				[-180, -90], 
    				[180, -90], 
    				[180, -85], 
    				[26, 6], 
    				[33, 62], 
    				[180, -36]]]
                }
            }
        ]
    }

```

I get this result after filtering the data with a non intersecting box in the Atlantic ocean :

 ![testGeoJson_polygon1](https://us1.discourse-cdn.com/elastic/original/3X/2/a/2a00a9a9f64c804098477a39354da70541e3d05d.jpeg)  
Note that filtering with a non intersecting box in the Indian ocean works correctly.

Now, the filtering is correct if I remove the point [-180, -85]. I've tried with other aligned points and got also incorrect results.  
I couldn't see anywhere that geojson polygons with aligned points are invalid so I assume it's a bug from Elasticsearch/Lucene. Note also that I got the same error with ES6.2.3 and ES7.7

Is it really a bug or do I miss something?

Thanks!

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [July 13, 2020, 7:54am UTC](https://discuss.elastic.co/t/geo-shape-false-positives-when-the-polygon-has-aligned-points/240725/2 "2020-07-13T07:54:50Z")

</div>

Hi @franck.valentin,

I think it is a bug. Could you open an issue in the GitHub repository?

Thanks!

---

<div class="post-metadata">

**Author:** ![franck.valentin](https://avatars.discourse-cdn.com/v4/letter/f/d2c977/32.png) [@franck.valentin](https://discuss.elastic.co/u/franck.valentin)\
**Post date:** [July 13, 2020, 9:18am UTC](https://discuss.elastic.co/t/geo-shape-false-positives-when-the-polygon-has-aligned-points/240725/3 "2020-07-13T09:18:16Z")

</div>

Hi Ignacio,

done: [https://github.com/elastic/elasticsearch/issues/59386](https://github.com/elastic/elasticsearch/issues/59386)

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 10, 2020, 9:18am UTC](https://discuss.elastic.co/t/geo-shape-false-positives-when-the-polygon-has-aligned-points/240725/4 "2020-08-10T09:18:26Z")

</div>

Closed on August 10, 2020, 9:18am UTC

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