## Feature #1136

### grdcontour -Q: specify length instead of number of points

Status: | New | Start date: | 2017-07-26 | |
---|---|---|---|---|

Priority: | Normal | Due date: | ||

Assignee: | - | % Done: | 0% | |

Category: | - | |||

Target version: | - | |||

Platform: |

**Description**

It looks like grdcontour does a contour length calculation and compares it to a minimum value under the hood (from grdcontour.c);

#define GRDCONTOUR_MIN_LENGTH 0.01 /* Contours shorter than this are skipped */

Contours shorter than a minimum length are not plotted. Would it be reasonable to also let the user specify a minimum length, in addition to the current -Q 'number-of-points' cut off?

I find that if you have the same grid, but different resolution, the -Q 'number of points' may have a big impact.

Pragmatic constructed example:

Plotting and extraction of the -2000 contour from a grid with three different resolutions (see contour_length.pdf)

**gebco_8m.nc - x/y increment 0.13333**

number of points: N = 121

Length: 820 km

**gebco_8m_sampled.nc 1 - x/y increment 0.5**

Number of points: N = 30

Length: 738 km

**gebco_8m_sampled.nc 2 - x/y increment 0.05**

Number of points: N = 324

Length: 822 km

The number of points may be very different, but the length will roughly be the same (at least comparable). Wouldn't length be a nice additional way of specifying contour cut?