We consider a model based clustering technique that directly accounts for network relations between subjects and their position in geographical space. A natural framework to deal with this issue is social network analysis, where municipalities are the nodes and the relationship between them is measured by the commuting flows. In our model the flows are explained by the distances between the nodes in a three-dimensional space where two coordinates are the actual geographical coordinates and the third one is a latent variable. The model is completed by specifying a gaussian mixture distribution for the coordinates: this model component allows us to obtain a clustering of the municipalities based on the flows (having discounted for the populations).