clustering shp file

37 views
Skip to first unread message

Suhad Faisal

unread,
Dec 5, 2014, 9:49:10 AM12/5/14
to
Hello 

I try to cluster a shape file divided as voronoi  polygons, to make it as groups of aggregated adjacent polygons , according to this code 
but it seems to be wrong , can you advice me please , I also try many different values as the max. distance between the polygons, but the same result .

Can I control the number of resulted groups of clusters ? 
How can I verify the generated clusters?  to use each of them independently

  model ProtoType
global 
{   
file         vor             <-file('../includes/VoronoiVoronoi.shp')   ;
geometry     shape           <-envelope(vor)                            ;
 init 
         {
         
create vorpoly from: vor with:[towerpoly ::int(read('Tower')), 
                          location.x::int(read('pos_x')),
                          location.y::int(read('pos_y'))];    

list<list<vorpoly>> clusters <- list<list<vorpoly>>(simple_clustering_by_distance(vorpoly, 0.2));
               
               loop cluster over: clusters {
                rgb rnd_color <- rgb(rnd(255),rnd(255),rnd(255));
                ask cluster as: vorpoly { color <- rnd_color;     }
               
                }

                           }//init
                                            }//global   
                                                        
entities
 {
  species vorpoly 
{     rgb      color ;
int       towerpoly;
       aspect vorpolygon { draw  shape   color:  color  ;      }        }     }
                    
experiment Clustering     type:gui  { output { display  city_display   refresh_every: 1 type:java2D  
 {     species vorpoly      aspect:vorpolygon  transparency:0.5;    }  }  }   

any Example !

thanks in advance 

cheers
suhad

Srirama Bhamidipati

unread,
Dec 9, 2014, 5:30:07 AM12/9/14
to gama-p...@googlegroups.com
Hi,

May be you can consider making your polygons to points? 

There is a distant cousin of GAMA by the name GAM (geographic analysis machine), may be you can try that ? I think it is also java based and free and on google code. www.ccg.leeds.ac.uk/software/gam  .. if you find those methods suitable, you can request GAMA for a specific method and may be they add that method for you.

regards,
srirama

Suhad Faisal

unread,
Dec 9, 2014, 5:34:26 AM12/9/14
to gama-p...@googlegroups.com
Thank you veeeeeeeeeeeeeeeeeeeeeeeery much Srirama , I will try it 

you are great supporter 

cheers
Suhad

--
You received this message because you are subscribed to a topic in the Google Groups "GAMA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gama-platform/vseuVydH2pY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages