Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to perform a kind of 'spatial join' in Arcgis, joining to a polygon layer atributes of the closest feature of a point layer, as well as distance. But 'spatial query' doesn't offer an option 'closest feature on target layer'.

I guess I could create a distance matrix, I've tried but the distances are something like 4695923.10207, can it be because I am working with WGS 84 non projected layers?

And, is it possible to perform the spatial join I mentioned, resulting on a layer, instead of creating a distance matrix?

share|improve this question

Both answers from @HåvardTveite and @mapBaker should help you get your results. What I normally do is first use the Distance to nearest hub tool and then Join the resulting layer with the polygon layer.

This is a late answer but anyway, I created 2 simple layers (polygon and point) with the following attributes:


I then ran the Distance to nearest hub via the Processing Toolbox and chose the appropriate settings:

Distance to nearest hub

This gives me a point layer as an output (I left the default name as I'm lazy) with the distances calculated:

Output attributes

Now, I Join the polygon layer with the Output layer by connecting a common attribute from each. This is done from Layer Properties > Joins:

Layer Joins

Finally, your polygon layer will contain its original attributes plus the distances calculated from the Output layer:

New attributes

If you want to keep all those attributes in a single shapefile then you can simply do a Save as... on the polygon layer or alternatively, run the Join attributes table from the Processing Toolbox.

share|improve this answer

Using a projected coordinate reference system (e.g. UTM) simplifies things.

In GRASS you can use the v.distance function.

In QGIS you can use v.distance through the GRASS plugin. If your datasets are not too big you can use the QGIS NNJoin plugin.

share|improve this answer

Try this tutorial, or this one

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.