# Nearneighbor search radius

**URL:** <https://forum.generic-mapping-tools.org/t/nearneighbor-search-radius/475>\
**Category:** Q&A\
**Created:** [May 16, 2020, 2:30am UTC](https://forum.generic-mapping-tools.org/t/nearneighbor-search-radius/475 "2020-05-16T02:30:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dietmar](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/dietmar/32/286_2.png) [@dietmar](https://forum.generic-mapping-tools.org/u/dietmar)\
**Post date:** [May 16, 2020, 2:30am UTC](https://forum.generic-mapping-tools.org/t/nearneighbor-search-radius/475/1 "2020-05-16T02:30:39Z")

</div>

I would like to use gmt nearneighbor with a non-circular search radius (applied to non-geographic xy data), i.e. the equivalent of setting an anisotropic aspect ratio in gmt surface. Is this possible?

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [May 16, 2020, 4:22pm UTC](https://forum.generic-mapping-tools.org/t/nearneighbor-search-radius/475/2 "2020-05-16T16:22:39Z")

</div>

GMT6.1 (currently GMTdev) has a new module called `grdgal` that should let you do that. The key is going to be passing the correct [gdal options](https://gdal.org/programs/gdal_grid.html#nearest) in **-F** option.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [May 16, 2020, 6:13pm UTC](https://forum.generic-mapping-tools.org/t/nearneighbor-search-radius/475/3 "2020-05-16T18:13:58Z")

</div>

Looks like nearneighbor is computing a circle radius, which for Cartesian data with different x and y meanings might be odd. You may be able to get what you want to scaling your y data coordinates such that a circle radius of r ends up needing N nodes in x but M nodes in y, effectively using an ellipse instead of a circle.
