QGIS 2 Lesson 17 - Advanced Labeling Using Expression Dialog in QGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi and welcome to lesson 17 if the maths freaky GIS course in today's lesson we're going to look at some more advanced labeling and this might seem a little bit intense but I've breaking it down into really simple steps we are going to be looking at Unicode but it's something that's really important and just allows us to make our Maps completely customizable so you stick with it and good luck one of the best things about GIS systems and key GIS is that GIS systems are basically infinitely customizable so today were going to look at some advanced labels and we're going to look at labeling the areas that we created in the last couple of lessons so you'll remember that we always do is we just go to labels and choose single labels and then we can choose area for example and it will give us the area of our area of our potential habitat that we created last week and that's great but if you were looking at this map for the first time it wouldn't be particularly useful so what we're going to do is we're going to open the attribute table and if we click Edit first thing we're going to do is just remove a couple of these fields because we have far too many too I'm just going to remove everything and start again okay okay so now everything is removed and I'm going to open the field calculator create a new field this one's just going to be called ID and under the expression we're just going to write the dollar sign again and then ID and you'll notice that the output preview is zero this is just because QGIS starts it's its feature ID codes at zero for some reason see what we can do is just the ID plus one and that will start our IDs here running all the way from one down to 100 and whatever it was okay okay so the next thing we're going to do is we're going to re-add we're going to re-add an area color and this time instead of a whole number we're going to make it a decimal number because it could be useful just to share a couple of decimal places say you remember we just did dollar area and you can now see that we've got all our IDs and all of our areas so it's giving us the biggest area so I'll because there is nine point eight eight kilometers squared and I can just update our labels to represent this information so if I go to area again just click apply and ok and you can see that now if you look at our data we've got some more information and this area here that was representing zero is now represented showing 0.01 kilometers squared so it was any change there because the value was a fillet one last time okay excellent see you know I've always shown you that's easier to see that the layers if we have a buffer so I'm just going to add that buffer now just to make it easier to read against the different lines it just means you don't have to worry about any of your labels in the lapping with lines okay so now we've got that we can have to look at some more advanced labeling because as I said this information doesn't really give us an awful lot to go with so what we can do is if we gave back to our labels and rather than selecting a value here we can actually go to this this key button here and this is just our expression dialog and it allows us to do a little more than what we could do before so what we can do is you can just right area this time Oh apologies area in single quote marks because that's our text and we can just say that we want a space because you'll notice that whatever we type in here is what's represented so your ID area then down here in the output it just says area so we want area and then a space and then I'm going to use this function here which is the string concatenation it sounds terrifying string concatenation but it actually just means adding different parts together and I'm just going to type ID in here now you should actually type it with with the double inverted commas and you can see now it's giving the the text string area and then it's concatenated that with our ID column so if I classic press okay now then if we go onto this it's got all of our areas and rather than just being around a number we've got the text that says area 50 area 30 etc etcetera which is really useful because we now we know what information we're looking at but we were interested in the area so if we go back into the label and we can just edit this a bit more to go to our expression dialogue which is the epsilon the East symbol and this time what we're going to do is we're going to add the concatenate function again and we're going to add this little backslash N and the backslash n in unicode means to add a new line so if I just get rid of this concatenate you'll see that in our output preview is now added a new line okay so I'm going to add another concatenate function and this time we're going to put our actual area and I'm just going to change this to Zane so it becomes a little bit less confusing so we're gonna have Zane's brother area so now I've got zoom one and we're using the column area okay and I'm just going to write this as kilometers squared and again I'm gonna write this in the brackets okay and one thing about Gigi is and ArcGIS is actually really difficult to get superscript symbols so I might show you that in a later video but for now we're just going to write kilometers and then an up arrow and squared okay if you think that looks two other ways it's very obvious what we're talking about if we do this and we might want to speed to there as or to make it more obvious say we can do this hit apply and ok and this is some great information but if we zoom out a little bit we get an awful lot of labels so we've got places like here where we've got a bit of some overlapping labels and we don't really need areas like down here we've got all this information here where we've got zero kilometers squared and that means the piece of land which is our potential zone say zones 40 1947-48 a 1/4 4 etc these are all less than 10 meters squared because we we did it two decimal places so one decimal place with the say zero point won't be 100 meters squared and zero point zero one would be ten meter square see these are all the areas that are less than 10 meter squared so we might not want to show these on our map and we can do that on our labeling tools as well see if we get into this we can do what's called a conditional statement say we use this case and again this looks really scary say please they panic because we're going to break it down say what we're saying is when a condition is equal to something then do one thing and then it should really have this else in it as well okay so the first thing we need to do is move this end statement to the end work because this is obviously the end and what we're gonna do is we're going to type in when area equals zero then null okay so I've said here is when our area is equal to zero kilometers then we didn't want anything to displayed say no else so if it's not equal to zero kilometers then we want our original expression okay so now if you press ok and we look down here at some of our zero kilometers Eanes click apply you'll see they've disappeared so we can use that just narrow down a few more of our options say we were interested in an area which was less than 0.2 I can do exactly the same so okay and look at these ones here and here you'll see that they disappear just to give us the areas of the bigger than 0.2 km/h could do this for anything and we can do this for any value obviously see it's just a way to show exactly the information that we want to show and it just demonstrates just how flexible QGIS is I think that's useful and I'll see you in the next lesson okay thanks bye
Info
Channel: DMAD Marine Mammals Research Association
Views: 1,740
Rating: undefined out of 5
Keywords:
Id: h4AXQqJTrCU
Channel Id: undefined
Length: 12min 43sec (763 seconds)
Published: Tue May 12 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.