Associating points with their municipality or zone: simple spatial joins with MMQGIS

When you have a layer of points (field surveys, geocoded addresses, incidents, observations, etc.) and a polygon layer (municipalities, sectors, zones), it is often useful to know which zone each point is located in.

This is what a spatial join allows you to do. And with the MMQGIS plugin, you can do it in just a few clicks, without writing a single line of code.



Objective

For each point, add descriptive information from the polygon in which it is located: name of the municipality, sector, INSEE code, etc.


Required data

  • A point layer (Shapefile, GeoPackage, or geocoded CSV format).
  • A polygon layer containing the attribute to be reported (e.g., municipality_name, zone_code, etc.).

Both layers must be in the same coordinate system (ideally EPSG:4326 or EPSG:2154 for France).


Steps in QGIS

  • Open both layers in QGIS (points + polygons).
  • Menu:

    • MMQGIS → Combine → Spatial Join

  1. In the dialog box:

    • Target Layer = point layer (the one that will receive the attribute).
    • Join Layer = polygon layer (the one that contains the attributes to be added).
    • Field Operation = First (“Take attributes of first matching feature”).
    • Select the fields to retrieve (e.g., municipality_name).
    • Specify an output file (shapefile or other).

  2. Click OK.


Result

A new enriched point layer appears. Each point now contains one or more additional fields from the polygon in which it is located.


Best practices

  • If a point does not fall within any polygon, the added fields will remain empty. Remember to check for “out of zone” cases.
  • You can choose to add the first intersecting polygon or all of them (but MMQGIS only handles one match per point).
  • For complex cases (points in multiple areas, overlaps), the QGIS Processing Toolbox offers more options (including “Join attributes by location (summary)”).


Concrete example

You have:

  • schools (points),

  • municipalities (polygons).

After spatial joining, each school carries the attribute fields of the municipalities, which is useful for:

  • grouping data,
  • creating thematic maps,
  • generating reports by municipality.


Si cet article vous a intéressé et que vous pensez qu'il pourrait bénéficier à d'autres personnes, n'hésitez pas à le partager sur vos réseaux sociaux en utilisant les boutons ci-dessous. Votre partage est apprécié !

Leave a Reply

Your email address will not be published. Required fields are marked *