# Issue with GeoUtils.planeDistance

**URL:** <https://discuss.elastic.co/t/issue-with-geoutils-planedistance/80576>\
**Category:** Elasticsearch\
**Created:** [March 30, 2017, 2:56am UTC](https://discuss.elastic.co/t/issue-with-geoutils-planedistance/80576 "2017-03-30T02:56:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivasagar\_172](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sivasagar\_172](https://discuss.elastic.co/u/sivasagar_172)\
**Post date:** [March 30, 2017, 2:56am UTC](https://discuss.elastic.co/t/issue-with-geoutils-planedistance/80576/1 "2017-03-30T02:56:49Z")

</div>

We are migrating from ES 2.0 to 5.0

My existing SortBuilder is as below,

SortBuilder sort = SortBuilders..geoDistanceSort("address.plocation",Double.valueOf(modParams.get(P\_LAT)),Double.valueOf(modParams.get(P\_LON))).unit(DistanceUnit.MILES).order(SortOrder.ASC).geoDistance(GeoDistance.PLANE);

AS GeoDistance.PLANE is deprecated, I also see from some forums/blogs that we should be using planeDistance(double lat1,double lon1, double lat2, double lon2) instead of GeoDistance.PLANE

[http://atetric.com/atetric/javadoc/org.elasticsearch/elasticsearch/5.0.2/org/elasticsearch/common/geo/GeoUtils.html#planeDistance-double-double-double-double-](http://atetric.com/atetric/javadoc/org.elasticsearch/elasticsearch/5.0.2/org/elasticsearch/common/geo/GeoUtils.html#planeDistance-double-double-double-double-)

Any example/suggestion on how/where to implement this will be helpful.

---

<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:** [April 27, 2017, 2:56am UTC](https://discuss.elastic.co/t/issue-with-geoutils-planedistance/80576/2 "2017-04-27T02:56:54Z")

</div>

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