Extract polygons having certain number of points

Hello!

I’ll be surprised if I can extract those polygons (from xx.gmtfile) having certain numbers of points (from yy.csv). I did the other way using gmt select to extract out the points for certain polygons, but I wonder if GMT can do the prior one. Thank you.

Yes :slight_smile:

@PlanetGus, thank you for positive response. Could you suggest a command of ‘GMT’ can perform a task on a non-grid file?

Can you be more clear on what you have and what you want?

From what I understand, you have :

  • some polygons
  • some points

And you want to know the number of points within each polygon.

Is that correct?

Noooooo… @PlanetGus

I have two files.
(1) multi polygon file having .gmtfile extension
(2) point file in .csv format

I want to extract those polygons having a certain amount of points.
For instance, extracting the polygons has more than 20 points. I hope I will clear here.

It looks like a job for contour with -Q and -D