# Boundary Search x miles from original Boundary

**URL:** <https://discuss.elastic.co/t/boundary-search-x-miles-from-original-boundary/256239>\
**Category:** Elasticsearch\
**Created:** [November 21, 2020, 7:07pm UTC](https://discuss.elastic.co/t/boundary-search-x-miles-from-original-boundary/256239 "2020-11-21T19:07:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mecham](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@mecham](https://discuss.elastic.co/u/mecham)\
**Post date:** [November 21, 2020, 7:07pm UTC](https://discuss.elastic.co/t/boundary-search-x-miles-from-original-boundary/256239/1 "2020-11-21T19:07:23Z")

</div>

I can across this article and found it very useful:

> **[Geospatial search with Elasticsearch and NEST](https://forloop.co.uk/blog/geospatial-search-with-elasticsearch-and-nest)**

I am trying to achieve something a little different and I thought you might be able to advise.

On [Rightmove.co.uk](http://Rightmove.co.uk) you can perform a radius search:  
[https://www.rightmove.co.uk/property-for-sale/map.html?includeSSTC=false&keywords=&sortType=2&viewType=MAP&channel=BUY&index=0&radius=3.0&locationIdentifier=REGION^884](https://www.rightmove.co.uk/property-for-sale/map.html?includeSSTC=false&keywords=&sortType=2&viewType=MAP&channel=BUY&index=0&radius=3.0&locationIdentifier=REGION%5E884)

3 miles on this search is not correct however.

I am not looking for a Geo Polygon query within a shape in effect or a geo distance query from a point:

> **[GeoQueries with elasticsearch](https://medium.com/@antunesleo/geoqueries-with-elasticsearch-5684f165455d)**
>
> Elasticsearch is a powerful search engine and supports geo queries, but not everyone is used to work with spatial data. If you don’t know…

I effectively need to create a search from a similar polygon at scale:

> **[Similar Polygons (Explained w/ 23+ Step-by-Step Examples!)](https://calcworkshop.com/similarity/similar-polygons/)**
>
> What are similar polygons? With 23 step-by-step examples, you'll have everything you need to identify, setup, and solve these geometry problems.

In other words I have a geolocation boundary, I need to scale by 3 miles and find all locations within the bounds.

I was wondering if you had any idea how i could perhaps achieve this?

I am theory looking to build a property site that performs searches across the whole of the UK and your help and expertise would be most appreciated.

---

<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:** [December 19, 2020, 7:07pm UTC](https://discuss.elastic.co/t/boundary-search-x-miles-from-original-boundary/256239/2 "2020-12-19T19:07:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [January 30, 2021, 7:15am UTC](https://discuss.elastic.co/t/boundary-search-x-miles-from-original-boundary/256239/3 "2021-01-30T07:15:38Z")

</div>

Scaling a polygon up or down is known as inward/outward polygon offsetting. It is possible to use a GIS library like [JTS TopologySuite](https://github.com/locationtech/jts) (and language ports like [NetTopologySuite](https://github.com/NetTopologySuite/NetTopologySuite)) or [Clipper](http://www.angusj.com/delphi/clipper.php) to do this.

I think a simple approach to scale out the outer boundary of the shell of a polygon can be achieved with JTS TopologySuite's [`OffsetCurveBuilder.getRingCurve()`](https://locationtech.github.io/jts/javadoc/org/locationtech/jts/operation/buffer/OffsetCurveBuilder.html#getRingCurve-org.locationtech.jts.geom.Coordinate:A-int-double-).
