0

I'm using QGIS 3.10.2 A Coruna.

I translated a DWG/PDF Plan into GIS where I harmonized every object in regard to topology and correct geometry. The map represents a development plan of a project we are working on. In this development plan we have different categories: buildings, streets, park area/open space, estates.

At first, I had a seperate layer for each categorie, until I realized that everytime a change is made in the plan, It is important to check all the other layers and make sure, that topology is still intact. I found this to be a hassle. So, I decided to put all categories in one layer, that way any changes that occur, will only effect one and one layer only.

However, I have a lot of attributes that need to be implemented in the layer, the problem ist, that some attributes only apply to some categories and not others, and some attributes apply to all categories. For example: The attribute "Name" applies to all categories, but the attribute "use" is only for buildings, where I have predifined values.

My attribute table to growing rapidly and my capacity of keeping track of which attribute is set for which category is decreasing. For my collegues I often have to export only one category, and if I always manually delete unecessary attributes, mistakes are bound to happen.

Is there a possibility in QGIS to only show/export the relevant attribute without me having to do so manually every time I want to look at my data?

I have also considered trying out a database-solution like PostGIS, but I'm new to this, so I'm not really sure how I would organise it there either.

1

If all your data is in one file you could duplicate the layer in QGIS (not the file itself, but the layer reference) for as many different categories as you need (right click on layer > Duplicate Layer).

Then filter each reference to the respective category (right click on layer > Filter...) so in essence it's like you have a layer for each category but they all point back to the same file and topology should be maintained.

So for example instead of having one layer called Data that refers to Data.shp, you can have 5 layers - Road, Building, Path, Park, Carpark, filtered by "category" = 'Road', "category" = 'Building' and so on. But the 5 layers still refer to Data.shp.

That way when you open the attribute table or export the features, you will only be dealing with the relevant data per layer.

As for hiding irrelevant fields, you can set up the attribute table settings differently per layer. Open the attribute table and right click on a field heading (column heading) and click Organise Columns. When exporting data it won't abide to these settings but as @Håvard Tveite suggested you can select which columns you want to export using the GUI.

To persistently set up a layer to only export particular columns I guess you need a programmatic approach.

4
  • Thanks, that actually should do the trick!
    – rtaani
    Mar 30 '20 at 11:33
  • I'm thinking about reorganizing our whole project and using databases such as postgres/postgis. Would I use the same approach? Meaning I would have all the data in one dataset and create views for each categories?
    – rtaani
    Apr 2 '20 at 12:52
  • Depends, if they have different fields that are relevant, then I supppse they should be in different layers - if you're using postgis I think it'll be more robust and easier to ensure topological relations across layers? (I have never really dabbled with topology).
    – she_weeds
    Apr 2 '20 at 21:07
  • I would need to test it across relations, I'm still very new to postgis. Thanks for your comment, though!
    – rtaani
    Apr 3 '20 at 11:33
1

Is there a possibility in QGIS to only show/export the relevant attribute without me having to do so manually every time I want to look at my data?

When you right-click on the layer and choose Export-> Save Features as..., you can choose which attributes to save / export. Fields can be hidden in the attribute table of a layer by right-clicking-> Hide Column.

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.