I have a problem with TERYT codes (in Poland, these are the codes that code the different segments of the administrative division of the country).

I have a map of the administrative division of the country uploaded into the program in .shp format.

When I try to merge data from Excel with the .shp map after TERYT codes there is a problem with data compatibility. When I try to merge an entire city (e.g. Warsaw, TERYT code: 1465011) with the .shp map, there is no problem.

The problem arises when I try to merge individual city districts with individual blocks on the .shp map (e.g. Bemowo, Warsaw district, TERYT code: 1465028), because nothing is displayed. QGIS treats this code as if it doesn't exist, as if it doesn't match any area of the map. This problem is quite significant for my work.

If so how can I check what codes (in my case TERYT) QGIS supports? After all, there should be some kind of list of what codes are available for "understanding" QGIS, is not it?

  • 3
    Can you share your data ? And explain what happens in the case where you mention it works ? Do you ask QGIS to map the .CSV data to the geometries? I don't know anything about Teryt but from what you describe I don't expect that Qgis handles them in any way, except for being able to map IDs to geometries, provided that there are geometries for each ID
    – Kasper
    Commented Nov 26, 2022 at 16:47
  • 3
    And what do you mean by 'merge', are you performing a join?
    – Matt
    Commented Nov 26, 2022 at 17:42

1 Answer 1


Join tables: basics

It seems your Shapefile conains features (objects, entries) for town level only, not for sub-units. Check in your Execl file and the attribute table of your Shapefile if there is an entry for the TERYT code you're looking for (like 1465028 in your example). Only if both contain the same code you can join the respective units. If it is missing in one of the files, no join is possible for this feature.

Find dataset

Try to find a dataset that contains features (geometries + attributes) for subunits (like city districts) as well. GADM e.g. does contain data only for city-level and above: https://gadm.org/download_country.html > [select Poland].

Solution: Download data for your use case from OSM

OpenStreetMap (OSM) has data for city district subunits. See here how to find the OSM key for the feature category you're interested in: it's teryt:simc. You can now download the features in QGIS using QuickOSM plugin. Zoom in to the city of Warszawa and search for key = teryt:simc.

The polygon layer that is downloaded contains an attribute teryt:terc that contains the value you're interested in, see screenshot. You can now perform a table join, joining the excel table to this layer.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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