Re: [GRASS-user] r.to.vect to selected locations only
About knowing new modules: I didn't know about r.clump a way to accomplish the subject task: r.to.vect for areas where certain locations fall. It can be done with the following flow: r.clump -> loop over r.what (at locations places) and then r.reclass or r.mapcalc to MASK areas other then the ones around singol locations -> r.to.vect Giovanni ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: "module of the day" feed idea - was Re: [GRASS-user] r.to.vect to selected locations only
Hi all, maybe you didn't realize, but the module of the day is already online :) Kudos to Francesco Pirotti! Markus On Fri, Jun 27, 2008 at 10:55 PM, Dylan Beaudette <[EMAIL PROTECTED]> wrote: > On Friday 27 June 2008, Paulo Marcondes wrote: >> 2008/6/24 Markus Neteler <[EMAIL PROTECTED]>: >> > On Tue, Jun 24, 2008 at 2:54 PM, Hamish <[EMAIL PROTECTED]> wrote: >> >> random idea: >> >> Maybe we could add a "module of the day" feed on the grass webpage with >> >> module name and label/description one-liner. I continue to find new >> >> modules many years after first using grass. >> > >> > Nice idea indeed. >> > I guess a bit of PHP/XML hacking is sufficient ... volunteers? >> >> I really like the idea. RSS would be great. >> I'd code it myself if I had any clue. >> >> thanks anyway, nice addition to the homepage. > > A simple approach to this might involve something like: > > 1. extract module name / 1-liner to a database table, keep it updated from > time to time > > 2. periodically query the table for a random row (via PHP) > > 3. convert the returned record into a formatted string, or XML for delivery > RSS style > > 4. use some PHP to access the day's module/desc. and insert it into a small > container on the main page. > > if we have access to PHP / database it is a very simple matter to construct > these queries. for something this small and specialized a file-based DB like > sqlite would work just fine. There are several PHP XML libraries for > constructing XML/RSS - so there wouldn't be a need for wheel-reinventing. > > Dylan > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: "module of the day" feed idea - was Re: [GRASS-user] r.to.vect to selected locations only
Why not use the same method used to create the Documentation page for GRASS? If I'm not wrong it's automatically built every week. Am I wrong? We could simply pick a module randomly from the svn trunk and its documentation. Then, formatting an RSS and a page on the site is an easy task... I launch another idea: what about a "tip of the day"? It could be a second step to the "module of the day". Add a little task/question with an answer proposal. We could pick it from most interesting threads opened in the ML... Ok it cannot be automated, and would need extra-work. Just an idea... giovanni ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: "module of the day" feed idea - was Re: [GRASS-user] r.to.vect to selected locations only
On Friday 27 June 2008, Paulo Marcondes wrote: > 2008/6/24 Markus Neteler <[EMAIL PROTECTED]>: > > On Tue, Jun 24, 2008 at 2:54 PM, Hamish <[EMAIL PROTECTED]> wrote: > >> random idea: > >> Maybe we could add a "module of the day" feed on the grass webpage with > >> module name and label/description one-liner. I continue to find new > >> modules many years after first using grass. > > > > Nice idea indeed. > > I guess a bit of PHP/XML hacking is sufficient ... volunteers? > > I really like the idea. RSS would be great. > I'd code it myself if I had any clue. > > thanks anyway, nice addition to the homepage. A simple approach to this might involve something like: 1. extract module name / 1-liner to a database table, keep it updated from time to time 2. periodically query the table for a random row (via PHP) 3. convert the returned record into a formatted string, or XML for delivery RSS style 4. use some PHP to access the day's module/desc. and insert it into a small container on the main page. if we have access to PHP / database it is a very simple matter to construct these queries. for something this small and specialized a file-based DB like sqlite would work just fine. There are several PHP XML libraries for constructing XML/RSS - so there wouldn't be a need for wheel-reinventing. Dylan -- Dylan Beaudette Soil Resource Laboratory http://casoilresource.lawr.ucdavis.edu/ University of California at Davis 530.754.7341 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: "module of the day" feed idea - was Re: [GRASS-user] r.to.vect to selected locations only
2008/6/24 Markus Neteler <[EMAIL PROTECTED]>: > On Tue, Jun 24, 2008 at 2:54 PM, Hamish <[EMAIL PROTECTED]> wrote: >> random idea: >> Maybe we could add a "module of the day" feed on the grass webpage with >> module name >> and label/description one-liner. I continue to find new modules many years >> after first using grass. > > Nice idea indeed. > I guess a bit of PHP/XML hacking is sufficient ... volunteers? I really like the idea. RSS would be great. I'd code it myself if I had any clue. thanks anyway, nice addition to the homepage. -- Paulo Marcondes = PU1/PU2PIX -22.915 -42.224 = GG86jc ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
"module of the day" feed idea - was Re: [GRASS-user] r.to.vect to selected locations only
On Tue, Jun 24, 2008 at 2:54 PM, Hamish <[EMAIL PROTECTED]> wrote: > random idea: > Maybe we could add a "module of the day" feed on the grass webpage with > module name > and label/description one-liner. I continue to find new modules many years > after first using grass. Nice idea indeed. I guess a bit of PHP/XML hacking is sufficient ... volunteers? Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
RE: [GRASS-user] r.to.vect to selected locations only
Hamish: >random idea: >Maybe we could add a "module of the day" feed on the grass webpage with module >name and label/description one-liner. I continue to find new modules many >years after first using grass. The same with me; not only am I discovering new modules, but also discovering flags present in old modules I've used for years that I wish I had known about years ago! ~ Eric. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
Hamish: > > (r.what or v.what.rast) -> r.reclass -> MASK -> 'g.region zoom=' > > (r.what or v.what.rast) -> r.reclass -> r.grow -> 'g.region rast=' G. Allegri wrote: > r.reclass would reclass all the areas having the same value > as the one from r.what, so it's not guaranteed that just the area > around the specified point is considered. Am I wrong? that is correct; all of that value in the map. > Are you sure r.grow is useful? As far as I've unserstood it makes > a sort of r.buffer+r.patch, based on a buffer radii, not > inspecting the pixel values... oops, I meant r.cost. > Yes r.mapcalc can do the work, but I was tinking to something like > r.lake... Maybe it's more performant. Ok, proabibly it should be > written with a C routine not bash. well bash is nice for prototypes and proof of concept. You can worry about C later if you can't stand the slowness. Usually you can stand it. I've never used r.lake much, so can't comment on if it could offer a solution. random idea: Maybe we could add a "module of the day" feed on the grass webpage with module name and label/description one-liner. I continue to find new modules many years after first using grass. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
> (r.what or v.what.rast) -> r.reclass -> MASK -> 'g.region zoom=' > (r.what or v.what.rast) -> r.reclass -> r.grow -> 'g.region rast=' r.reclass would reclass all the areas having the same value as the one from r.what, so it's not guaranteed that just the area around the specified point is considered. Am I wrong? Are you sure r.grow is useful? As far as I've unserstood it makes a sort of r.buffer+r.patch, based on a buffer radii, not inspecting the pixel values... Yes r.mapcalc can do the work, but I was tinking to something like r.lake... Maybe it's more performant. Ok, proabibly it should be written with a C routine not bash. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
Nikos: > > Assuming there is a raster map with areas (e.g. the > > result of a classification). has the previous suggested (weeks/months?) method worked? (r.what or v.what.rast) -> r.reclass -> MASK -> 'g.region zoom=' 'g.region zoom=' may be a bit slow; I don't know if that can be improved. ISTR that it starts at the current region, not the map bounds, which might help speed things up if you want to zoom in on just one patch. (??) G. Allegri: > Ok, now it's clear. That's a good point... maybe one could write an > algorithm similar to r.grow or r.lake: add pixels starting from a > point until a pixel with the same category of the seed is found. (r.what or v.what.rast) -> r.reclass -> r.grow -> 'g.region rast=' ? or instead of r.reclass use r.mapcalc to create the isolated region before 'g.region zoom=' or r.grow. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
> Assuming there is a raster map with areas (e.g. the result of a > classification). Ok, now it's clear. That's a good point... maybe one could write an algorithm similar to r.grow or r.lake: add pixels starting from a point until a pixel with the same category of the seed is found. A good exercise :-) ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
On Mon, 2008-06-23 at 12:10 +0200, G. Allegri wrote: > >how can raster areas be selected based on vector points that >fall inside > >them? > > What do you mean with this? Isn't Hamish's script useful to achieve it? Yes, it is very useful. But what I mean is something like... point map >v.to.rast create MASK only for areas in which a point falls inside. I hope it's clear enough what I suggest. Thank you, Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
>how can raster areas be selected based on vector points that >fall inside them? What do you mean with this? Isn't Hamish's script useful to achieve it? ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
On Mon, 2008-06-23 at 10:25 +0200, Markus Neteler wrote: > On Mon, Jun 23, 2008 at 5:46 AM, maning sambale > <[EMAIL PROTECTED]> wrote: > ... > > What I need is to, limit raster to vector conversion to the desired > > randomly selected locations only. So that r.to.vect could complete the > > conversion. > > Did you try to set a raster mask (r.mask)? It should be respected > by r.to.vect. > > Markus Dear all, I recently had to think about a similar problem. But the question remain... how can raster areas be selected based on vector points that fall inside them? So one can build an optimal MASK. Thank you, Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
Maning wrote: > Here's the process I plan to do for my image classification > > 1. Create an unsupervised classification from TCAP images to get > clusters of pure pixel values. > 2. Convert to vector. > 3. Create a random location of vector points. > 4. From the converted vector layer, select random polygons > (approximately 60 polys for each class). > 5. Label training polygons for the desired classification classes > 6. Run smap classification > > I will be running this method for a series of LANDSAT > images (one tile at a time). > > My problem is by converting the whole image from raster to vector > areas, the v.to.rast module reports "Killed" and could not complete > the conversion. > This maybe due to the whole image being large. Yes, that's an out of memory error. The operating system kills the offending processes so that the rest of the computer can keep running. > | Data Type:CELL > | Rows: 7518 > | Columns: 8504 probably for sanity's sake you may want to stay under about 4000x4000. It is not a hard limit, the only thing that should limit you for bigger sizes is computer resources and your time. > What I need is to, limit raster to vector conversion to the > desired randomly selected locations only. So that r.to.vect could > complete the conversion. > > Any ideas? I've needed a similar thing a number of times, and so I've just added a new add-on script which may be helpful. "g.region.point - g.region.point is a shell script which resets the computational region to a square box around a given coordinate. It is intended for use within GRASS scripts to speed up processing by focusing expensive raster calculations onto a small area of interest." http://grass.osgeo.org/wiki/GRASS_AddOns#General_add-ons http://trac.osgeo.org/grass/browser/grass-addons/general/g.region.point also perhaps helpful is the v.random.cover add-on script. Hamish ps- If anyone who knows about the clustering modules would like to update the wiki page describing what's available, please go for it. I've no idea. http://grass.osgeo.org/wiki/Image_processing#Clustering ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] r.to.vect to selected locations only
On Mon, Jun 23, 2008 at 5:46 AM, maning sambale <[EMAIL PROTECTED]> wrote: ... > What I need is to, limit raster to vector conversion to the desired > randomly selected locations only. So that r.to.vect could complete the > conversion. Did you try to set a raster mask (r.mask)? It should be respected by r.to.vect. Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user