[GRASS-user] v.sample - help!

Markus Neteler neteler at osgeo.org
Thu Mar 26 03:13:14 EDT 2009


On Wed, Mar 25, 2009 at 11:44 PM, Richard Chirgwin
<rchirgwin at ozemail.com.au> wrote:
> OK, this is strange.
>
> I am using v.sample to determine whether a point falls inside or outside a
> simple raster (only two colors - white and brown).

Did you see
http://grass.osgeo.org/wiki/Point_in_polygon
?

> The vector points have only two columns in the table: cat, and an integer value
> (327670) - the aim is that the result will be 0 where the point is on the white
> background, and some other number when the vector is on the brown.
>
> The vector is connected to a MySQL table, and the category numbers are unique (I
> made sure of this).
>
> The error is:
>
> DBMI-MySQL driver error:
> Cannot execute:
> insert into ACT_900 values ( 3, 3.000000e+00, 3.276700e+04, 3.276400e+04  )
> Duplicate entry '3' for key 'ACT_900_cat'
>
> (v.sample has worked okay on other maps and tables so I'm completely stumped!).

I dunno but if two points fall into the same quadrant, maybe they pick the
same cat (ID) which is forbidden by the SQL unique rule?

just guessing,
Markus


More information about the grass-user mailing list