[GRASS-user] Re: proximity mapping / site clustering

ivan marchesini marchesini at unipg.it
Sat Jul 22 17:34:03 EDT 2006


Dear all...
the topic was really interesting.... and really useful for me!!!!
so, although I'm not so experienced with shell programming, I have
decided to try to create a shell script for performing clustering into
grass using R.
I have heavily used Dylan's previous e-mails...  

I attach the script to this e-mail....
please try it and give me suggestion about how to improve it... ( the
code is not so good  :-(   )

The script need an input point map, the number of cluster to create and
the name of the output map...

Cheers,

Ivan










On ven, 2006-07-21 at 16:07 -0700, Dylan Beaudette wrote:
> One more example for fun...
> 
> #see previous email in thread by D.E.B.
> 
> # add in cost derived from slope map, and distance to some initial point 
> b_start:
> echo "596204.6875|4917668.75" | v.in.ascii  out=b_start
> r.cost in=slope out=b_cost start_points=b_start stop_points=bugsites -k
> 
> #add this to bugsites att tables
> echo "ALTER TABLE bugsites add column s_cost double" | db.execute
> v.what.rast vect=bugsites rast=b_cost column=s_cost
> 
> #export busgites
> v.out.ascii.db in=bugsites out=bugsites.xy columns='s_cost'
> 
> # similar R commands, but standardize the data frame prior to partitionin 
> around medoid approach:
> 
> y.pam <- pam(y, 5, stand=TRUE)
> 
> #yields slightly different results. note red 'dot' is the location of some 
> arbitrary starting point ' b_start'
> http://169.237.35.250/~dylan/temp/spatial_clustering_idea2-cost.png
> 
> 
> Seriously, I really wish that GRASS, R, PostGIS, etc. weren't so damn 
> flexible - then I would stick to my work instead of trying out things like 
> this!
> 
> Cheers,
> 
> Dylan
> 
> 
> On Friday 21 July 2006 14:33, M S wrote:
> > followup/correction.
> >
> > The "hubbing" does not have to occur along the optimal route (steiner
> > tree).  this is "line of sight" orientated (cell towers as example).
> >
> > On 7/21/06, M S <mseibel at gmail.com> wrote:
> > >  So far the network engineer/planner (who happens to be my Dad) I have
> > > been working with on using GRASS for WAN Network engineering and design
> > > has been working out awesome.  After a successful steiner tree, i have
> > > come to another problem to solve with GRASS.
> > >
> > > i have all these sites on the minimal connection network.  what i need to
> > > do now on a simplistic level, is cluster the sites or aggregate them.
> > > Clustering them by proximity is the first step, even though traffic
> > > generation is another factor that will have to be added.
> > >
> > > I have looked at v.net.iso and v.net.alloc, but none seem to produce the
> > > results sought after.  is there a function or combination of functions
> > > that might cluster sites on the network based upon their proximity to
> > > each other?
> > >
> > >
> > > i used v.net.iso with roughly a mile iso band.  i was able to highlight
> > > on the optimal network all sites within a mile of each other but those
> > > were not the desired results.
> > >
> > > Any ideas?
> > >
> > > thanks in advance
> 
-- 
Ivan Marchesini
Department of Civil and Environmental Engineering
University of Perugia
Via G. Duranti 93/a 
06125
Perugia (Italy)
e-mail: marchesini at unipg.it
        ivan.marchesini at gmail.com
tel: +39(0)755853760
fax: +39(0)755853756
jabber: geoivan73 at jabber.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.cluster
Type: application/x-shellscript
Size: 4155 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20060722/6655bddd/v.bin


More information about the grass-user mailing list