The Australian Bureau of Statistics (ABS) issues Esri shapefiles or MapInfo files which have a code # for each geographical area at various 'resolutions' and I have a database with a column of variables and their lat/lon (it's a .csv file). How is it best to get a list of the #'d geographical areas (i.e. the ABS ID_codes) that each variable lat/lon point is within? And how can I get these both in the same database?

I am using QGIS.


I would use the 'Point sampling tool' plugin in QGIS. Check the bottom of Using field calculator in QGIS to return name of country from different shapefile?


Step 1: get the coordinates in the csv to points. You'll first need to determine, if possible, the coordinate system used. You say lat/lon, so right away it should be a Geographic Coordinate System. Frequently it will be GCS WGS84, but there are other datums out there and it's best to be sure. Once you have that info you can use Add Delimited Text Layer and be sure the points will be in the right place.

Step 2: determine the coordinate system and datum of the polygon shapefiles and add them to the project. If it is the same as the points, great. If not, you'll probably want to reproject the points to the polygon CRS (right-click layer and save as, specifying new CRS). Also note your project has a CRS and the ability to use on-the-fly projection. More info in the QGIS Documentation.

Step 3: With both points and polygons in the project and properly aligned you have several options to transfer the codes from the polygons to the points:

  • Intersect
  • Join Attributes by Location (aka Spatial Join/Query)
  • Point Sampling tool

Depending on the method you choose, the result may either be a new point file with the desired attributes, or a temporary layer/join that must be saved/exported to a file.


This operation is called a "Spatial Join". You can use the "Join Attributes by Location" tool in QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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