2

How can I merge shapefiles in a special order in QGIS? What I have and what I need to be merged in that order:

what i have

What happens when using merge by mmqgis:

merged by mmqgis

As u can see not usable at all. Attributes are gone.

What happens when i use "merge shapefiles" tool by qgis:

merge shapefiles by qgis

As u can see some time zones are covering smaller time zones. So i tried to order them by using mmqgis again:

sort merged shapefiles by qgis by mmqgis

Attributes are ordered now but geometry is still overlapping.

Is it possible to merge shapefiles in a special order using qgis respectively to sort their geometry afterwards?

8

Most data providers do not guarantee any order in the way they deliver features. While an apparently stable order is often a side effect of the order in which features are stored in files, one shouldn't rely on this.

Therefore I'll re-interpret the question as "how can features be rendered in a given order within QGIS".

To do this, open the layer properties, head to the Symbology tab, scroll down to the Layer rendering group box on this page, where you find a Control feature rendering order checkbox. Once this is checked, there is a A->Z button on which you can define which attribute(s) should define the sort order and if it should be in descending or ascending order.

For your case, entering "time" as sort order expression might be good. Or, if you want smaller areas on top of bigger areas, use $area.

enter image description here

3

You need to use Union Tool from Vector -> Geoprocessing tools -> Union. This should give you the correct topology. Or, you can use difference tool repeatedly to get the difference between big polygons and smallers polygons and finally use Merge tool to put them in one polygon shapefile.

But Union will solve the problem.

  • union works as well. unfortunately i cannot mark more than one answer as accepted. but of course this one is as well. difference tool is what i was using so far to bypass the problem. – MrXsquared Nov 27 '17 at 9:51
  • No problem at all, but you can still upvote the answer if you did not do so. Good luck :) – ahmadhanb Nov 27 '17 at 9:53

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.