Create a quick Atlas (a.k.a. map collection) in QGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello again in this short video i will show you how to use the atlas function in kugis this function is very useful when you have to create several maps and you want to use the same style or map template for all of them that is scale colors legend north arrow and so on the function is called atlas and not because the greek titan but because once upon a time a printed map collection used to be called like this now to create a map collection using the atlas function of kookies all you have to do is to create a point line or polygon layer that you will use to control the position of each map in the collection kudus will check the extent or centroid of each feature on this layer to control the central position of each map view in your print layout template if you want to learn how to create a print layout in kuji's take a look at the video that i have created for this purpose by clicking up here or follow the link in the description of this video thanks for watching and i hope you like it the first thing we want to do is to set up our layers and style them it is always better to have everything in order before we move on to the print layout if we want an atlas layer that is a layer to control the atlas we need to have that layer inside our project in this case i will show you two different cases one with polygons and one with points both layers have the same attributes so let's create a quick layout first i'm going to add a map that will cover most of the layout except for the top where i will add a title then i'm going to add a scale i'm going to go with a double color scale with two sections to the left and only one to the right in meters and each section to the right will have let's say 500 meters necessary after the creation of the atlas we might have to change this for now i'm going to add a black transparent black background and a larger margin from the scale to the border of the background and maybe a rounded frame finally i'm changing the font of the numbers which is done in display then font then notosands and bold and a little bit larger and yeah that's it okay one good thing to do with the scale is to set up the anchor position because the scale will change depending on the feature you are displaying unless we display each map of our collection with a fixed scale for this exercise is since i am putting the scale in the bottom right corner of my map view i'm going to set up the anchor in the bottom right corner of the scale so if it grows or changes it will grow from here to the left then i'm going to add a legend this is very simple uh just keeping the canals and legs and i will change the patches of each symbol for the legs i created a patch using the shape of one of the lakes and for the canals i am using a patch created by class carlson and available for free in the cartosa open source geospatial solutions github page under the repository kuji's legend patches for the legend just to make it look a bit different i will choose a transparent white background with a rounded black frame same noto sans bold font and that's it finally i will add an svg north arrow that i downloaded from the internet and that i modified it with notepad plus plus in order to be able to change the colors i'm using a light blue resembling the legs and canals and i'm using the heart like blending mode so the blue color can adapt whenever the colors in the map change okay so we have everything we need for our atlas so creating an atlas is very simple just go to the atlas panel to your right and if it's not activated right click on an empty space in the toolbars area and activate it normally it should be already activated and appear in the fourth tab to the right of the layout the first option you have to select the layer that you will be used to manipulate the atlas for the first exercise i will select the points layer but i don't want the point to appear in the coverage layer so i will select the option hidden coverage layer then i will select a field in my layer to have a name for each map this name is useful inside qgis as a visual aid once the atlas is running for this atlas i will not filter my layer with an expression but i will sort the legs by name so you can see what does this mean okay finally we have to activate atlas to do that select your map view to see its properties scroll down until you see control by atlas activated by selecting it and that's it very simple huh so if you display the atlas properties here you will see that the only available option is fixed scale that is because we are using points since we are using a points layer to manipulate the atlas and technically a point only has one dimension the scale will will be fixed automatically depending on the scale of your map view as it was when you added it if you want to change the scale just change the scale of your map scroll up to main properties and change the scale okay now apparently nothing has changed apart from the scale but if you take a look at the atlas so go up to the toolbar section and click on the atlas button and you will notice that other buttons will be available just use the arrows to navigate your map collection to see if you are happy with the results as you can see now you have a map pair like from this toolbar you can also check the atlas properties and export your images but for now let's modify the atlas a little bit more and select the polygons so in your atlas properties change the coverage layer to your polygons layer in this case lakes polygons the main difference is that the polygons have two dimensions and the atlas will consider the area of each polygon to adjust the scale of each map however you can still set up a fixed scale or set up a margin from the feature to the border of the map view right now we are producing an atlas for every single polygon in our file but we could filter our file using a simple query expression and use only those polygons that meet a certain criteria for instance i can use the expression editor and tell kgs that i would like to produce a map collection only with those legs that are artificial and natural so select the filter with option open the expression editor look for fields and values from the expression box and only the fields of your legs polygons layers should appear now double click type which is a field in my lakes polygon layer where the type of each lake is stored and now grid equals two and then you can check the values within that field by clicking on all unique which is just below the expressions help window and you should see all the unique values stored in the type field so there are on unknown chin amperos artificial and natural in this case i will select artificial which means that my map collection my atlas will comprise artificial legs but i will also select natural so to select both before you double click on natural write or then select type again equals display all unique values and select natural okay now the full expression is finished below the window you have a preview of the expression every time is correct you will see a number of some gray text if it's not correct you will see expression is invalid in red and between parenthesis and in blue more info okay everything is in order click ok to accept the expression and close the window good now let's explore the atlas notice that whenever you change the map the scale won't change this is because we added points first and we told kgs to have a fixed scale for the atlas so let's change that select your map go to properties scroll down to control by atlas and you will notice that now you have two more options if you select predefined scale kuji's will try to set up the extent of your polygons the best way possible with rounded values so you might use a numeric scale for your maps that you can actually use if you prefer to fit the extent of each polygon based on the polygon regardless the scale use margin around feature and just adjust the margin from the polygon to the map view border each map will have a different scale and if you use a numeric scale and it will not have rounded values okay so far so good but there is a small problem with our maps we might know the name of each map by reading the name of the file in the atlas toolbar or as a small tab on top of each map but if we see the map itself we might not be able to recognize the lake so let's add a label that will function as a title for each map it's very simple just add a label using this icon or go into items menu and then select add label then i just customize the fonts and adjust a little bit the label box and that's it the problem with this label is that it won't change depending the lake but there is a simple way to change this behavior check the properties of the label and click on the button expression below the text editor where it says insert an expression okay for this exercise i want the name of the lake it's type and uh yeah that's it okay i will concatenate it each element i need to produce this title so for this example i will use expression called concat then open a parenthesis go again to the fields and values expression menu then select name now use comma to concatenate another value then i will use text so i'm adding it by using a simple quotation mark then i will gray space then is then space again and then after the space i'm i'm closing the simple quotation marks that will let koogees to know that this bit is text with a space before and after the word is okay then comma again to concatenate another value and then i will go again to fill some values but now i will select type and then close parentheses parenthesis to finish the expression if everything is correct you will see a preview in the bottom left of the expressions window if you're happy accept the changes and now you have a nice title for your map okay finally to export the map you can just modify the output properties of the atlas again by using expressions you can also change the name of your final images by default output underscore and then the atlas feature number will appear but if you want for instance the name instead of the number or additional to the number you just have to deselect this option single file export when possible so now let's open the expression editor now that it's available use two pipe symbols which you can also use to concatenate values instead of the concat expression and after the atlas feature number let's add two pipes then single quotation mark underscore single quotation mark two pipes again and then fill them values again double click on name and that's it okay before we export the maps uh let's double check if the scale since it's gonna change uh will fit inside the layout so let's just explore them so this is map one map two it's inside map three so for instance map three it's outside so we need to change this so not right now the scale is very big so let's remove the segments to the left like that uh let's see if that works for all the maps yeah it works for this one it's very small but it works it still works works i think it's okay okay this is very small so let's um yeah i think if we change for this map and we put a very small scale for the all for the for the big maps it's not going to work so for this specific map i'm going to change the scale to just 100 units and i and i will export this map alone but as you can see uh since we are using the atlas actually the name is already defined for us so just go to layout and export as image and i'm gonna save it and i'm gonna save it here like alone and i'm gonna change the scale the the resolution to 200 dpi and now i'm just we'll keep looking so i'm going to change the scale this again to 500 okay so this is this is wrong but let's see the rest so yeah it's inside which is good and just let's see if okay the image export format in our atlas i'm going to change this to jpeg and then i'm going to export it using this icon so with this icon you will export all the atlas as images so i'm going to create a folder here just for the atlas and i'm going to change the resolution to 200 and then i'm gonna save so depending on the resolution and the size of your layout this could take a while and also depending on the layers and how many styles are you using etc okay let's open the folder and now we have all the images including this one which is incorrect but now we can just replace this file this single file and that's it so this should be okay excellent and now you have your maps completely finished so the only thing that i forgot to do here is just to remove the layer of points but i mean that's all right that's it i hope you like it and thanks for watching you
Info
Channel: ishibaro
Views: 891
Rating: undefined out of 5
Keywords:
Id: PhJmTwwHLIM
Channel Id: undefined
Length: 19min 21sec (1161 seconds)
Published: Mon Nov 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.