[GRASSLIST:3976] Re: intersect sites with polygons?

Markus Neteler neteler at itc.it
Fri Jun 28 05:45:27 EDT 2002


On Thu, Jun 27, 2002 at 10:57:56AM -0700, Jeff D. Hamann wrote:
> I would like to intersect a sites layer with a polygon layer to obtain only
> the polygons that have a site within them... Do I have to convert the sites
> to a raster/vector layer first?

An (un)useful hint related to this topic:

GRASS lib provides functions for that:

int
Vect_get_point_in_poly (struct line_pnts *Points, double *X, double *Y)

  get point inside polygon

  This routine finds a suitable area point in the ring described by the line
  struct Points, but without reference to any islands that may be present
  inside the area. This routine is useful where prior topological
  information on an area is not available.
 
  The return value is 0 on success, -1 on failure.}


(also points in islands etc)

So it *should* be possible to write 'v.points.in.polygon' reading a
vector points map (eventually generated with s.to.vect) and a
polygon vector file.
Maybe we find a volunteer to code that?

Markus



More information about the grass-user mailing list