[GRASS-user] Grouping spatial points

Hi,

I’ve a point vector containing more than 500 points.
Some of these points are spatially clumped while
others are single independent points (from viewing the
map). Now I am wondering if there is any tool in
GRASS (or maybe other spatial-statistical software
like R) that can be used to group the data so that each
point clump is assigned to a group and each single group to its
own group. Of course, this needs a criterion where
to distinguish between groups/clusters. I’d like to have
groups that are separated by a distance of at least 5 km.

Is there any recommendation of a simple or more
advanced procedure to do that?

All suggestions all welcome! Thanks!

Best,
Johannes

Actually this might be quite simple, if you are happy with the rigid 5 km. distance: Just create a buffer around all points of 2.5 km, merge the buffer circles that overlap, then overlay the original points on the merged buffer areas (clusters) to get a “cat” value from each cluster into the points attrib table. There’s a nice example of merging buffers in the v.buffer man page.

···

On 08/07/2014 14:58, Johannes Radinger wrote:

Hi,

I’ve a point vector containing more than 500 points.
Some of these points are spatially clumped while
others are single independent points (from viewing the
map). Now I am wondering if there is any tool in
GRASS (or maybe other spatial-statistical software
like R) that can be used to group the data so that each
point clump is assigned to a group and each single group to its
own group. Of course, this needs a criterion where
to distinguish between groups/clusters. I’d like to have
groups that are separated by a distance of at least 5 km.

Is there any recommendation of a simple or more
advanced procedure to do that?

All suggestions all welcome! Thanks!

Best,
Johannes

This mail was received via Mail-SeCure System.

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)
This mail was received via Mail-SeCure System.

-- 
Micha Silver
GIS Consulting
052-3665918
[http://www.surfaces.co.il](http://www.surfaces.co.il)

Hi,

On 08/07/14 13:58, Johannes Radinger wrote:

Hi,

I've a point vector containing more than 500 points.
Some of these points are spatially clumped while
others are single independent points (from viewing the
map). Now I am wondering if there is any tool in
GRASS (or maybe other spatial-statistical software
like R) that can be used to group the data so that each
point clump is assigned to a group and each single group to its
own group. Of course, this needs a criterion where
to distinguish between groups/clusters. I'd like to have
groups that are separated by a distance of at least 5 km.

Is there any recommendation of a simple or more
advanced procedure to do that?

I think you are talking about hierarchical spatial
cluster detection. There is an implementation of this
in the free (but not open source) CrimeStat toolbox
(.Net & Windows only - yuck). Perhaps R has something
similar/identical?

Best,

Ben

All suggestions all welcome! Thanks!

Best,
Johannes

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

--
Dr. Benjamin Ducke, M.A.
{*} Geospatial Consultant
{*} GIS Developer

  benducke@fastmail.fm

On 08/07/14 13:58, Johannes Radinger wrote:

Hi,

I've a point vector containing more than 500 points.
Some of these points are spatially clumped while
others are single independent points (from viewing the
map). Now I am wondering if there is any tool in
GRASS (or maybe other spatial-statistical software
like R) that can be used to group the data so that each
point clump is assigned to a group and each single group to its
own group. Of course, this needs a criterion where
to distinguish between groups/clusters. I'd like to have
groups that are separated by a distance of at least 5 km.

You could create a distance matrix with v.distance and then group all points which have a distance < 5km between each other.

Moritz

Hi Johannes,

On Tue, Jul 8, 2014 at 1:58 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:

I've a point vector containing more than 500 points.
Some of these points are spatially clumped while
others are single independent points (from viewing the
map). Now I am wondering if there is any tool in
GRASS (or maybe other spatial-statistical software
like R) that can be used to group the data so that each
point clump is assigned to a group and each single group to its
own group. Of course, this needs a criterion where
to distinguish between groups/clusters. I'd like to have
groups that are separated by a distance of at least 5 km.

Is there any recommendation of a simple or more
advanced procedure to do that?

I play a bit with some machine learning algorithm, the code is:

https://gist.github.com/zarch/f849df450d622f9eadee

you can see the results apply to the vector map "points_of_interest"
present in the North Carolina mapset, here:

https://plus.google.com/115946523992149326262/posts/2R9HfQh6UvQ

cheers

Pietro

Hi all,

I followed the pathway of using R and its hierarchical clustering tools.
For all interested, I came up with following code that creates clusters
with a user-specified minimum distance between the cluster means.
So this code does not specify the number of clusters a priori.

x ← runif(100,0,150)
y ← runif(100,0,150)
df ← data.frame(x,y)
plot(df)

hc ← hclust(dist(df,method = “euclidean”), method=“average”)
plot(hc)

df$memb ← cutree(hc, h = 60)

cent ← NULL
for(k in 1:length(unique(df$memb))){
cent ← rbind(cent, colMeans(df[df$memb == k, , drop = FALSE]))
}
cent ← as.data.frame(cent)
summary(dist(cent))

plot(df$x,df$y,col=df$memb)
points(cent$x,cent$y,pch=15)

Of course this could also be used with a distance matrix provided
by any GRASS output (v.distance or distance along a network etc.)

Most probably there are also similar libraries for hierachical clustering
and cutting cluster dendrogramms available for python. Maybe together
with Pietro’s approach, its worth considering to write a short add-on, if this
is also of interest to other users.

Thanks for all your hints!

cheers,
Johannes

···

On Wed, Jul 9, 2014 at 6:11 PM, Pietro <peter.zamb@gmail.com> wrote:

Hi Johannes,

On Tue, Jul 8, 2014 at 1:58 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:

I’ve a point vector containing more than 500 points.
Some of these points are spatially clumped while
others are single independent points (from viewing the
map). Now I am wondering if there is any tool in
GRASS (or maybe other spatial-statistical software
like R) that can be used to group the data so that each
point clump is assigned to a group and each single group to its
own group. Of course, this needs a criterion where
to distinguish between groups/clusters. I’d like to have
groups that are separated by a distance of at least 5 km.

Is there any recommendation of a simple or more
advanced procedure to do that?

I play a bit with some machine learning algorithm, the code is:

https://gist.github.com/zarch/f849df450d622f9eadee

you can see the results apply to the vector map “points_of_interest”
present in the North Carolina mapset, here:

https://plus.google.com/115946523992149326262/posts/2R9HfQh6UvQ

cheers

Pietro