Bug #854

gmtselect -F fails to recognize columns in polygonfile with option -i

Added by Gyula over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:2016-02-06
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:other Platform:Linux


We have some data in points.xy:

1 45.8 17.7
2 45.8 17.8
3 48.6 20.8

If we want to select points inside a rectangle with gmtselect, this command works:

gmt select points.xy -i2,1 -R17/18/45/46
17.7 45.8
17.8 45.8

However, if we want to do the same with a polygonfile, e.g. in region.d:

17.0 45.0
17.0 46.0
18.0 46.0
18.0 45.0
17.0 45.0

it fails:

gmt select points.xy -i2,1 -Fregion.d
gmtselect: File region.d does not have at least 2 columns required for polygons (found 1)
gmtselect: Syntax error -F option: region.d does not have at least 2 columns with coordinates

On the other hand, if we have exactly the same points in a file points1.xy with only lon,lat columns:

17.7 45.8
17.8 45.8
20.8 48.6

it works:

gmt select points1.xy -Fregion.d
17.7 45.8
17.8 45.8

Platform: Ubuntu 14.04 64-bit
GMT version: 5.2.1 (compiled from source)


#1 Updated by Paul over 5 years ago

  • Status changed from New to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

This was a bug. The -i settings shall only affect the main data input and not any auxiliary files given via options -C, -F, or -L. Fixed in r15580.

#2 Updated by Gyula over 5 years ago

Thanks for the fix. I've applied it in GMT 5.2.1 and works perfectly.

#3 Updated by Remko over 5 years ago

  • Status changed from Resolved to Closed

Closed after successful fix.

Also available in: Atom PDF