How to create Web Maps in QGIS Latest Release # Lesson 19 (Part 1) of 29 #QGIS Tutorial.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] hi guys welcome to today's qgis tutorial lesson 19. in this video we will learn how to create simple web maps in qgis if you haven't subscribed to my channel please do so so that you can get a notification when i upload my next video if you are new to my channel you can follow all my previous lessons and useful gis tips from the links in the description below let's get started so what are web maps web maps are online maps created with gis applications that provide a way to work and interact with geographic content organized as layers they are shared across the organizations and beyond on their web and across smartphones and tablets so in this exercise i went through and i take three very very simple uh steps in creating a web map what i will tell you is that you don't really need to have very very nice coding skills for these it is just as a simple exercise it's going to help you create your first web map so let's go through the steps that we're going to be using in creating this web map first we will symbolize and edit the widgets then we will install the qgis to web plugin that will enable us create our web map then finally we are going to create our web map and save our web map so let's get started we're going to go to directly to qgis so i'm going to open qgis then i'm going to create a new project so i already have a new blank project so the first thing i want to do is i want to bring in the layers that i want to create the webmap for so i'm going to bring in some vector layers i have already downloaded some vector layers for my country kenya actually conflict data for the different counties in my country between 2005 and 2015 so i'm going to just load the shapefiles into qgis so i'm going to go to layer add layer because i'm adding a vector layer i can actually use my shortcuts here but then i i just go the long way so layer add layer add vector layer then i'm going to browse for where my data is i've already saved my data in occasion in my js working data folder so i'm going to search for that and it's in my desktop gis data then i'm going to scroll to my folder which is the kenya data then i have conflict data here between 2005 and 2014 so i'm going to open that folder and i'm going to customize this to be in ssh file now i have my two layers here one is the conflict data which is point data then the other is a kenyan county boundary administrative boundary of kenya so i'm going to load both layers click on open then click on add then my layers have been added here so i'm going to click on close and i have my very nice layers added here so the next thing i want to do is i want to style my layers so i will symbolize my layers first of all i look at what is contained in my first layer which is a point data which is the conflict information so i'm going to open the attribute table right click on the layer and then open that to be table to just look at what what layer i'm working on and you can see i have the event date that is when the event happened then the event type and you can see there's some information here like there's a riot or a protest uh there is some violence against civilians and all that then there's the actor who was the actor of these and you can see there's different militias here then the allies who are the act allies you can see these are the good guys then there's lots to look at you then there is the source where did i get this information from and you can see there are different outlet this is the bbc monitoring news file african all african news um doctors without borders and all that bbc monitoring africa and all that so there are actually very many many sources of my data then there is a note here and under the note you can see if i expand it you can see it has some information about uh what what the the conflict was all about and what was the result you can see one that reported mother islam one dismembered body uh one kill and all that so this is actually what i want to show in my web map so the first thing i want to do is i want to symbolize my data so i'm going to symbolize my data using the event type because there are different event types when i you can see this when i when i when actually sort them in alphabetical order you can actually see there are different types of the kinds of events seen and violent activities and all that writing protest and all that so i'll use the event type to symbolize my data so i'm going to right click go to properties then give it a symbology so instead of a single symbol i'm going to categorize it and then what value of my categorizing i'm categorizing actually the event type then i can even change this symbol i don't like the round symbol i you look for the square symbol here then i'll make it a bit bigger i think that is okay then i will use random colors for this symbol so and then i'm going to click on classify and you can see now i have actually classified everything that i want to showcase in my web map so i'm going to remove this last one here i don't really need it then i remain with now these one two three around seven eight categories that i have for for the conflict then i'm going to click on apply okay and i have actually symbolized them according to these uh event type now the next thing i want to do i'm going to do the same thing to the kenyan county layer i'm going to open the attribute table to see what it contains and you can see it contains the county the area and perimeter this is just the small information that it has so what i want to do is i want to label all these regions here in kenya according to their county names because they're different counties so i'm going to use the county to label them so i'm going to now go to right click go to properties then i'm going to go to the label single label then what value of my labeling i'm labeling it with the county then this is the sample text but i'm going to change the color i think i'm going to give it a bright color like that then okay then i'm going to make sure there's a buffer around it i'm going to go back to text and make sure it's a bit bigger that in is okay it's regular text then formatting i'm going to make sure it's all uppercase because you can see there are some lockers so i'm going to make sure it's all uppercase click on apply okay and now i have my labels nicely within the different regions and you can see this is nairobi and it's neighboring counties so the next thing i want to do is i want to apply some style to this kenyan county layer i'm going to make sure that it's either a hole or there's no pen in it so i'm going to go back to properties then i'm going to go to symbology and then instead of a simple fill i wanted just an outline so i'm going to select simple line and then instead of a solid line i'm going to select maybe say the dashes and then increase the size of this a bit so i think that is okay no i'm just going to reduce it a bit okay then i click on apply okay and now i have my very very very nice styled uh layer of the conflict and the kenyan counties so that's the first thing i'm going to do the next thing so what i'm going to do now is i'm going to click on project i'm going to save this project here first so i'm going to call it web map and click on save so that in case something happens i don't really need to redo all these that i've already done now the next thing i'm going to do is i am going to add uh basemap so how do we add a basemap i'm going to go to the htm js plugin base map then i'm going to add google map and you can see google map has been loaded i'm just going to make sure it's at the bottom end so that my other layers are also visible you can also add any other kind of layers like for example i can go back to hcngs plugin and add the google satellite so i have added also the google satellite so i'm going to bring it down again so that i have the google satellite image and also there google map so i have there too you could even add the open street map there are actually several ways of adding the base layers one you can use the html plugin or you can just go to the web and look for the quick map service and then you can select what kind of uh best map you want to put so in this case i'm going to add another basemap with all of the openstreetmap so i'm going to select the openstack map standard so i'm going to just select that and it has already the open seat maps and here if i uncheck these two no i'll see now i have the openstreetmap standard as my base map so you can choose whichever kind of base map you want to use depending on on the kind of plugins you have so that is the first thing i'm going to do i'm going to click on save to make sure that my my work is saved up to there so the next thing i want to do is i want to look at now what information do i want to see when i create my best my web map so i'm going to open the attribute table and you can see i have several headers here there's the event date event type actor one but i want to give these aliases first so that it is easy for the reader who is going to be reading them up to understand like instead of belonging to their latitude some people don't actually know these they know of the x and y coordinates so i can just give them that alias or x and y coordinates so how do we do that you go to a layer like for example now i want to give aliases to this conflict to the 2005 layer i'm going to open the attribute table then go to no no i'm going to go right click on the layer go to properties then there is the attribute form so i'm going to select the attribute form so i want to do some changes in these fields that are here so there's the event date i can give it an alias and say that let's say it's a bit of occurrence or data card whichever then i'm going to go back to now the event type i also want to show the event type so i'll just say the type type of conflict type of conflict then it's a text and i want to show it so i'm not going to hide it if you want to hide this you don't want to see it you can go to hidden but it's just a text edit then the actor i just say there perpetrators then ally actors i'll say maybe these are the allies i'll not showcase the uh tattoo so what i do i select these i think under the weekday we get type i'll make sure that i it's hidden so that i don't actually show it in my web map then the longitude is there the latitude is there y coordinate y codes then the longitude is the x coordinate then the source is there in form measure source then the note is just more information i will just give it a shot from there then the fatalities is there death i'm going to say after i'm i've done all this and again i'm going to say apply then okay so we have actually given them the aliases if i now go back and look at the fields you can see now i have the aliases of all these that i want to showcase okay now the next thing i want us to do is i want to do the same thing to this kenyan county layer you can actually do the same thing for this you can see but but these are actually friendly names so it's very very straightforward now that we have prepared our data we have actually symbolized the data which is the first step we're now going to go to the second step which is now deploying our very very nice information into our web web map so that actually you can see some little bit of interaction with the data so the second thing you're going to do is you're going to install a plugin so you're going to go to plugins manage and install plugins then it's telling it's fetching repositories and then you're going to search for qgis to web plugin so i'll select the qgis to web plugin and you can see this is a plugin that actually allows you to create nice plugins you can read more information about this so i'm going to click on reinstall if you if you if you haven't if you do you you actually don't have the plugin installed you will click on install but for me i'm just installing it no no no problem takes quite a short while so it has told me plugin reinstalled successfully i'm going to click on close i have already installed now my qgis to web plugin so where does it go when i install it now we'll select the web and then you will see there's the qgis to web plugin so i'm going to select the qgis to web plugin and then we're going to click on create web map so when i click on create web map a new window appears here now this is where we're going to create our web map and what i want us to do first is i want us to create our map using leaflet so i'm going to select leaflet and it tells you uh preview preview preview map i'll add number of features present in the map generating a preview will take some time don't know where is for me so these are actually there the information that we want to show we want to show there event date event type actors longitude latitudes and all that fatalities and all that for now i will just leave everything as it is and then i'll click on update preview but if i click on a bit preview i'll go to appearance then i'll say under the appearance i'll add the abstract maybe on the upper right then add another search you know i'll not add an address search for now uh oddly at least i'll say i want a collapsed list then geolocator for the user no i will not actually check this then layer search and we'll actually do some of these things later on so much crs i'll say much crs we're going to put a measure tool so so that someone can actually measure some distances and the unit of measure for my case is a matrix depending on which which kind of units you want to show then show pop-ups on over i'll say yes and to see some pop-ups then the template should be on canvas size i'll say maybe full screen then we we get background i'll say maybe let it have these nice light green color then the icons i'll just leave it at that then the extent i'll leave it at canvas extent and then i'll leave everything else the way it is then i'll go to export now under export where am i going to export this i'm going to export it first to a folder so i'm going to search for create a folder that i'm going to be exporting everything here so i went to the desktop gis data then i'll create a new folder and call it webmap then i'll select the folder now i am going to save everything in that folder called webmap and then precision i just click on maintain then i'm going to go to look at these settings i'm not going to change anything so the next thing i'm going to do i'm going to go back to the layers and groups then i'm going to just make sure that this is on a leaflet and then click on update preview and then we will look at this screen here now just give it a few minutes a few seconds that it will be loading and you can see now it has loaded our very very nice web map that i can zoom in in and out and you see when i hover on some something it actually gave me information but you can't actually understand this information not unless you had actually checked the attribute table like for example you can see this just giving you information 2006 uh violence against civilians and identified ethnic group some values here so we want to add some more information into these and you can see we have also a drop down here where it now gives us all the layers that we are working on so i can actually even decide to uncheck the conflict data and see what happens it actually disappears so you can actually just decide that you want to see only the boundaries or i can still go back here and check it back so you can check and check any any kind of layer that you want to actually view at a certain given time and the good thing about it is only takes the layers that are actually active so for example the google maps is the only layer that is active and we had actually loaded several other kinds of layers if i check these then all of them will be active but i don't want to do that right now so let's just go ahead and create our first web map let's go and click on export and see how our web map looks like so i'm going to click on export and it's telling me it's creating and exporting everything creating and exporting everything give you a few seconds and it has said export is successful and immediately it opens my web map with my default web browser and you can let just give it a few seconds to bring our web map and you can see this is our first web map that we have actually designed and you can see it has the zoom in and zoom out button it has the layers you can actually check and check the layers and you can also click on the measure distance and all that so this is just our first web map that we have actually created and you can see when i just now zoom into the different regions i can actually select this point as you can see it is it has some information this one has a different kind of information there's another different kind of information and all that so we want to improve on our web map now what do we do so to improve on our web map so that whatever we we want to see is much more clearer to the viewer and all that we can go back now to qgis and i just click on close now i want to do just do some little bit of editing so instead of the under the layers and groups instead of event that no labels i'm actually going to make sure that they're in line with the text so i'm going to make sure the actors is in line the allies is in line everything is actually in line latitudes and longitudes are in line the source in line the note in line the fatality is in line then i'm also going to do some some things here like for example i want the layers to be visible and pop up that is okay but for google maps i don't want them to be popping up and i also want to show these are the layers here so i'm going to check them and then we'll go to appearance i'm going to make sure actually before i go to appearance everything actually here is visible pop-ups it's okay cluster is okay so in line in line then for the county i'll also do the same thing maybe say in line the area in line and the perimeter in line and i'll make sure they're visible but they don't pop up actually then because you already labeled them here we don't need to them they're popping up with information so i'm going to go to appearance now i want to actually customize these a little bit of a little bit more highlight on hover i'll make sure that i check that layer search now you can actually just search directly for layers here so there is there are two kinds of layers you can say an address search like for example you are looking for cities and all that you can just check this it will create a search button for the address so i'm just going to click on that so that you have an address search and then i'm going to also have a layer search and in the layer search i'm going to make sure that it's under the kenyan county which is their county right i want to search them directly from the county then everything else i'll leave it the way it is to extend you get on everything i'll leave it at that so i've actually actually tried to uh to make and instead of collapsed here i'll make sure it's expanded so so that you can actually see the differences so this is the for our first web map we had collapsed but now we have clicked on expanded then export we are going to click still export in the same folder so i'm going to first click on update preview so that we see the changes that i've actually made give it a few seconds to load and now you can see it has some more information including this now no longer collapsed but it is expanded so you see now you now have even a such search for places button here you have a search for the layers button here so what i'm going to do is now i'm going to now save this as my new web map so i'm going to click on export and it's exporting my web map and once it's finished it will now open my new web map again in my browser my default browser and now you can see the changes that we actually made now i want to show you the difference now like for example if i zoom in you can now see it has the titles for all these like for example this one is the date of occurrence which is that the type of configurations i have perpetrators allies y-coordinate x-coordinate information source and more information about the layer and all that so that is now the importance of making sure now that it's just within line so that if we go to a region like say maybe nairobi what you can actually do is now we can just use the search button here which is the search for the layer so i'm going to search for nairobi and you can see it has nairobi here and it will actually highlight where nairobi is so i can zoom in to nairobi and just select maybe say like this one here and you can see uh there's a that was arrived here uh let's go to maybe say this region here these at the point here and you can see protesters and they say their occurrence that was on 12th or on on 28th of 2012 riots and the perpetrators of the protesters that was the x and y coordinates the information source is the capital fm which is a radio session then more information is demonstrators leave confident parliament getting protest over corruption so that is the more information and then you can actually see the importance of these the importance of creating a weapon because it's live so let's now go to the folder where we were actually saving our web map so what i'll do i'll minimize these i'll close this because we already made or exported our web map so i'll just minimize everything here i'll even close this for now minimize this then i'm going to go to my folder it's a gs folder data webmap uh qgs and you can see i have actually two projects here so this was the first project which was a bit earlier than the this one another one this other one and you can see the time difference between the two so this is actually all the information that you need including the css and the javascript here so actually if you're very good in programming you can actually just open these using maybe say not part c plus plus or anything like that and then do some edits i'm going to just open so that you can look at the code so i'm going to open where only this index i'm going to open it with i'm just going to use notepad because i don't have any other text and you can see now this is the code of your webmap so if you're good at programming you can actually do a lot of changes here and then save it save it and refresh this link here and you'll be able to see the differences in your web map for now i haven't actually done any differences in any changes so it will just remain the same and that is how you create a simple web map in qgis if you found this video useful and you want to learn more on gis subscribe to my channel hit the bell icon so that you can get a notification when i upload the next lesson otherwise i'm just happy you're here see you in the next video
Info
Channel: WiseGIS
Views: 2,983
Rating: undefined out of 5
Keywords: qgis, qgis3.14, webmap, notepad++, leaflet, opendata, foss, qgis tutorial, education, vector data, gis, remote sensing, webmapping, web mapping, web map, vector data and raster data in gis, qgis tutorial for beginners, qgis 3, qgis3, how to create web map in qgis
Id: SmO87DoFcJk
Channel Id: undefined
Length: 29min 39sec (1779 seconds)
Published: Mon Oct 05 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.