I need to constrain the output of v.random in the polygons of another vector
map. How can I achieve that?
Arcgis has an option at the same tool ("Create Random Points ") named
"constraining_feature_class". I need to implement a function like that in
v.random.
Thank you Leonidas!
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Constrain-the-output-of-v-random-tp5704498p5704498.html
Sent from the Grass - Users mailing list archive at Nabble.com.
Do it in two steps:
1) v.random output=my_points
2) v.select ainput=my_points binput=my_areas output=random_per_area
operator=within
Maris.
2010/11/4, leonidas <leonidas_liakos@yahoo.gr>:
I need to constrain the output of v.random in the polygons of another vector
map. How can I achieve that?
Arcgis has an option at the same tool ("Create Random Points ") named
"constraining_feature_class". I need to implement a function like that in
v.random.
Thank you Leonidas!
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Constrain-the-output-of-v-random-tp5704498p5704498.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
I need the defined "Number of points to be created" to be inside the
polygons. If I follow your method some of them will remain out of the
polygons. I need to get 10 points that will fall inside the polygons NOT to
define 10 points and then select only the points that they are in polygons.
Thanks for your reply!
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Constrain-the-output-of-v-random-tp5704498p5704721.html
Sent from the Grass - Users mailing list archive at Nabble.com.
On Thu, Nov 4, 2010 at 11:00 AM, leonidas <leonidas_liakos@yahoo.gr> wrote:
I need the defined "Number of points to be created" to be inside the
polygons. If I follow your method some of them will remain out of the
polygons. I need to get 10 points that will fall inside the polygons NOT to
define 10 points and then select only the points that they are in polygons.
You could first convert the polygons to a raster map and then use
r.random to generate the defined "Number of points to be created" as
vector points using the rasterized polygons as cover map.
Markus M
Please open a wish ticket at http://trac.osgeo.org/grass and describe
what should v.random do to statisfy Your analysis. Probably someday
someone will modify v.random to contain such feature.
Thanks,
Maris.
2010/11/4, leonidas <leonidas_liakos@yahoo.gr>:
I need the defined "Number of points to be created" to be inside the
polygons. If I follow your method some of them will remain out of the
polygons. I need to get 10 points that will fall inside the polygons NOT to
define 10 points and then select only the points that they are in polygons.
Thanks for your reply!
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Constrain-the-output-of-v-random-tp5704498p5704721.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
I think this is the solution for my problem. Thank you very much.
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Constrain-the-output-of-v-random-tp5704498p5704945.html
Sent from the Grass - Users mailing list archive at Nabble.com.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/04/2010 12:23 PM, leonidas wrote:
I think this is the solution for my problem. Thank you very much.
Just be aware, that by converting to a raster, you include areas which
are not part of the initial polygon and exclude areas which are in the
original polygon - this might or might not be a problem for your
application.
You can kind of circumvent it, by using a very small cell size.
I am not sure - but might MASK help here, or does it only apply to
raster functions?
Rainer
- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa
Tel: +33 - (0)9 53 10 27 44
Cell: +27 - (0)8 39 47 90 42
Fax (SA): +27 - (0)8 65 16 27 82
Fax (D) : +49 - (0)3 21 21 25 22 44
Fax (FR): +33 - (0)9 58 10 27 44
email: Rainer@krugs.de
Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkzSmXgACgkQoYgNqgF2egoTZgCeMD/mooxuZ+p/FQw4DecPGIP1
yqwAnjy6nj+7SmayxgQEOBhWmtPStc/y
=sJSh
-----END PGP SIGNATURE-----
I did it! Thank you very much!
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Constrain-the-output-of-v-random-tp5704498p5704974.html
Sent from the Grass - Users mailing list archive at Nabble.com.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/04/2010 12:23 PM, leonidas wrote:
I think this is the solution for my problem. Thank you very much.
Just another idea - an iterative approach in a script, which is using
v.random and to discard all points outside the polygon and to repeat it
until you have the number of random points you need. This could be made
faster, by using a MASK based on the polygon which has been grown to
encapsulate the whole polygon, and to use on this setup r.random, also
iterative.
Rainer
- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa
Tel: +33 - (0)9 53 10 27 44
Cell: +27 - (0)8 39 47 90 42
Fax (SA): +27 - (0)8 65 16 27 82
Fax (D) : +49 - (0)3 21 21 25 22 44
Fax (FR): +33 - (0)9 58 10 27 44
email: Rainer@krugs.de
Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkzSmskACgkQoYgNqgF2egpQ0QCaAyPkVuZMFjYlhjGhLShQ7dBI
WWwAniZlR06c/rL4GqLW6sZwhrFDs2iB
=Agd0
-----END PGP SIGNATURE-----
Rainer wrote:
Just another idea - an iterative approach in a script,
which is using v.random and to discard all points outside
the polygon and to repeat it until you have the number of
random points you need. This could be made faster, by using a
MASK based on the polygon which has been grown to
encapsulate the whole polygon, and to use on this setup
r.random, also iterative.
see the v.random.cover script already in grass-Addons for this.
r.random points would be not-as-random, as results will all be
aligned to the raster grid, possibly introducing aliasing
problems.
Hamish
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/04/2010 05:49 PM, Hamish wrote:
Rainer wrote:
Just another idea - an iterative approach in a script,
which is using v.random and to discard all points outside
the polygon and to repeat it until you have the number of
random points you need. This could be made faster, by using a
MASK based on the polygon which has been grown to
encapsulate the whole polygon, and to use on this setup
r.random, also iterative.see the v.random.cover script already in grass-Addons for this.
I always love to find out if my ideas have already been implemented in
GRASS or other software - it never happened to me with proprietary software.
r.random points would be not-as-random, as results will all be
aligned to the raster grid, possibly introducing aliasing
problems.
True - I haven't considered that.
Thanks,
Rainer
Hamish
- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa
Tel: +33 - (0)9 53 10 27 44
Cell: +27 - (0)8 39 47 90 42
Fax (SA): +27 - (0)8 65 16 27 82
Fax (D) : +49 - (0)3 21 21 25 22 44
Fax (FR): +33 - (0)9 58 10 27 44
email: Rainer@krugs.de
Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkzS+2cACgkQoYgNqgF2egrB1ACfQsY4hgnFJ2YZNEoStezQicQT
uM4Anj8HhsIEHKwl69+S7EAJY+I+cjU2
=8wWS
-----END PGP SIGNATURE-----