# Replacement of CircleBuilder/PolygonBuilder

**URL:** <https://discuss.elastic.co/t/replacement-of-circlebuilder-polygonbuilder/295676>\
**Category:** Elasticsearch\
**Created:** [January 28, 2022, 9:46am UTC](https://discuss.elastic.co/t/replacement-of-circlebuilder-polygonbuilder/295676 "2022-01-28T09:46:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![UglyBarnacle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/uglybarnacle/32/47961_2.png) [@UglyBarnacle](https://discuss.elastic.co/u/UglyBarnacle)\
**Post date:** [January 28, 2022, 9:46am UTC](https://discuss.elastic.co/t/replacement-of-circlebuilder-polygonbuilder/295676/1 "2022-01-28T09:46:35Z")

</div>

Since the circle was not supported anymore (I think now it is, atleast on query execution), we approximated a circle with the PolygonBuilder from the main Elasticsearch package.

Elasticsearch 7.16 did a cleanup, removing dependencies from the main package to the module packages, basically deprecating those classes (legacygeo)

> <https://github.com/elastic/elasticsearch/pull/77856>
>
> This PR moves the legacy geo\_shape implementation to its own module and removes …the dependency on Spatial4J / JTS from server. In addition moves the dependency with lucine-spatial-extras away from server.
> 
> Unfortunately the diff is pretty big due to run spotless in the new module, but the PR is mostly moving files around.

Is there a replacement for those builder-classes? is there a jar that provides those classes that were moved? or do we rather have to replace and adjust our codebase (we use the builder to create and calculate intersections and how much of an area they cover in another shape to get a percentage, determining if the area is relevant or not).

---

<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:** [January 28, 2022, 10:02am UTC](https://discuss.elastic.co/t/replacement-of-circlebuilder-polygonbuilder/295676/2 "2022-01-28T10:02:30Z")

</div>

Hi @UglyBarnacle,

This is the replacement:

[https://mvnrepository.com/artifact/org.elasticsearch/elasticsearch-geo](https://mvnrepository.com/artifact/org.elasticsearch/elasticsearch-geo)

hope it helps.

---

<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:** [January 28, 2022, 10:06am UTC](https://discuss.elastic.co/t/replacement-of-circlebuilder-polygonbuilder/295676/3 "2022-01-28T10:06:59Z")

</div>

> [@UglyBarnacle](#):
>
> we use the builder to create and calculate intersections and how much of an area they cover in another shape to get a percentage, determining if the area is relevant or not

oh, but you will not be able to do that as I guess you were using the JTS output for that.

---

<div class="post-metadata">

**Author:** ![UglyBarnacle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/uglybarnacle/32/47961_2.png) [@UglyBarnacle](https://discuss.elastic.co/u/UglyBarnacle)\
**Post date:** [January 30, 2022, 1:31am UTC](https://discuss.elastic.co/t/replacement-of-circlebuilder-polygonbuilder/295676/4 "2022-01-30T01:31:00Z")

</div>

yeah, we already use the Elasticsearch-geo dependency, but it does not contain those builders.  
so to sum it up: those classes were removed and have no replacement provided by dependencies, the only option is to dive more into JTS and skip the convenient builders.

---

<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:** [February 27, 2022, 1:31am UTC](https://discuss.elastic.co/t/replacement-of-circlebuilder-polygonbuilder/295676/5 "2022-02-27T01:31:35Z")

</div>

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