[GRASS-user] Re: Further on Checking if a point (X,
Y) is inside the, polygons of a shape file using command line
Moritz Lennert
mlennert at club.worldonline.be
Tue Mar 4 16:08:20 EST 2008
On Tue, March 4, 2008 18:04, John C. Tull wrote:
> I think your approach with two runs is adequate, although I am not
> sure which tool you would use to extend your polygon as I have not
> looked into that issue recently. I have similar questions that I
> address. In order to get names of the polygons (conservation areas for
> you), I go beyond v.select to populate a field with the names of the
> areas being queried. I then dump to a text file that I can open in a
> spreadsheet application for summarizing. My example assumes you have a
> field called 'name' in your input polygon file:
>
> v.select ainput=in_points binput=conservation_polygons
> out=points_in_polygons
> v.db.addcol points_in_polygons col="polygon_name VARCHAR(40)"
> v.distance from= points_in_polygons to=conservation_polygons dmax=0
> upload=to_attr to_column=name col=polygon_name
> v.db.select points_in_polygons > points_in_polygons.txt
>
Just out of curiosity: do you really need the v.select ? Wouldn't this work:
v.db.addcol in_points col="polygon_name VARCHAR(40)"
v.distance from=in_points to=conservation_polygons dmax=0 /
upload=to_attr to_column=name col=polygon_name
?
Moritz
More information about the grass-user
mailing list