Creating Spatialite Layers in QGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Best to stick with GeoPackage rather than Spatialite. It's a geodatabase format based on SQlite. GeoPackage is the default spatial format in QGIS now.

https://youtu.be/27Mn0aq8e9A

It's possible to store multiple layers of different geometries, layer attributes and even a QGIS project in a GeoPackage.

👍︎︎ 1 👤︎︎ u/Bbrhuft 📅︎︎ Jan 28 2021 🗫︎ replies
Captions
[Music] [Music] so [Music] hi guys welcome to today's qgis tutorial in this video we will learn how to create special light layers in qgis you can subscribe to this channel to follow all my previous useful gear tips and tutorials if you like what you do here and you want to support this channel you can join our patreon i will provide a link in the description below qjs supports the use of a file format called spatialite that is a lightweight portable way to store an entire special database in a single file special light is a file based special database just like the s3 file database that we normally use maybe in commercial softwares like xgs one advantage of special light is that unlike shapefile specialized layers are portable so let's go to qgis and look at today's exercise so i'll open qgis and create a new project new blank project in this exercise we learn how to create a special light layer from scratch so in order for us to do that we are going to go to our layers panel and select layer then i'm going to scroll down and create a layer and we're going to be creating a new special light layer so we're going to select new special light layer and then this pop-up box appears and the first row has a database so we're going to specify the database that you're going to be creating for this case we're just going to create a new database so i'm going to click on the three dots here and then i'm going to navigate to a folder i want to create a special light layer so i'm going to create a new i'm going to go to layer my desktop gis data then i'm going to create a new folder here and i'm going to call it spa shell light layers this is where i'm going to actually be saving all my special light layers then i'm going to open the folder and i'm going to create my first specialite database which is i'm going to call it demo demo demo one then i'm going to save it as a special light layer so i'm going to click on save then now that we have demo and spatialite as our database we can actually add data here if we want or we can just click on cancel to close it and then we add import data directly to our special light layer but what i want us to do is i want us to create layers into our special light layer so there are three types of layers you can actually add you can actually add points lines and polygons so i'm going to start with the sample point for my specialized database and the geometry type is going to be i'm going to select point then i'm going to leave the projection to that then i'm going to specify the name of the fields in my point layer and i'm going to have a field called point name it's a text data i'm going to add it to list then i'm going to say maybe the type it's also text data and i can add as many more information as i want just like creating a shape file so i'm going to click on ok and the sample point has appeared in my qgis it is actually under my new special light layer so i'm also going to add another kind of layer in my spatula layer so i'm going to go back to layer again create layer new special light layer then i'm still going to select the demo database the demo and database because actually if you have several databases they could have been highlighted here but i only have the demo database so i'm going to now put my sample line the geometry type is align then i'm going to leave the projection to that then i'm going to also create new new fields in my sample line so i'm going to say name takes data i can even say length if you know the length or some information about the length it can be a whole number it can be a decimal number i'll put a decimal number so i've actually added some information in my attribute table i'm going to say okay then i now i'm going to create my last layer which is a polygon so i'm going to go to layer again create layer a new special light layer then i'm going to put the special light layer in my in my database still i'm going to say this is a sample polygon geometry type i'm going to say polygon you can actually have even some that don't have any geometries it's up to you to decide so i'm going to select a polygon then i'm going to just say the name also or the polygon it's a text data i need to add it to field then and the type text data added to field then say okay and i have created three empty layers for my points lines and polygons so the next thing we want to do is we want to digitize some information in these these layers that we have actually created you can see if i open the attribute table of any of them they're actually very empty they just have an id that is auto generated then the name and the type of the information that we wanted to put in our layer so we can just do a little bit of digitizing here do some assumptions so i'm going to select i'm going to start with the point data i'm going to select the point sample point click on the toggle edit pencil then add point features then i can just add my point features and i can call that point a name a the type i'm going to put it later on then name b then name c just like that i have my three points there so i'm going to click on save then stop editing then i'm going to go now to the line layer i'm also going to do the same thing i'm going to digitize some line features here so i'm going to select the sample line select the toggle pencil then select the add line feature then i'm going to digitize my lines here maybe say this is a pipeline or something like that pipeline we are going to now have double letters and okay then i'm going to say there's another pipeline here maybe that goes this way and call it applying bb i want to leave the length for now so i have the two pipelines here then i'm going to save my edits then stop editing then now we go to the third layer which is the polygon so i'm going to select the polygon start editing then add a polygon feature then i can actually just draw the polygons here or i can just use some of the shapes that are available in qgis so i'm going to select maybe the rectangle then i'm going to draw a very nice rectangle here for my first polygon and then i'm going i'm going to call it a a that is for the polygon it's just a demonstration i'm going to have another one here maybe there is another zone here i'm going to call it vbb and then i can change and maybe select a circle and then draw another polygon here and call it ccc then i can even select a pentagon and draw another one here and call it ddd so i'm going to click on save then i'm going to stop editing and i have actually created my points my lines and my polygons for my project when i open the attribute table actually all the information that we have actually digitized now is available in our in our layers and that is how you create your data into a spatialite database so uh the next thing i'm going to do is i'm going to remove all these layers now and select all of them i'm going to remove them so the next thing that comes in mind is you want to actually access your data how do you access your data there are two ways you can actually do this one is by just going to the database manager selecting the database manager then under the database manager you'll see this special light so i'm going to click on that and you can see there is a demo one already in my specialized data so within my demo one you can see there is a sample polygon sample line and sample point so you can see you all you have all your data that you had actually created in the new demo spatialite so we can actually look at the information of the data the tables and you can see it has a table then the preview of how you digitize your information can do the same thing for the line the preview of the lines then the preview of the points their tables and the information about the layer so this means that you've actually created a new special light layer another way you can actually access your special light data if you want to load it load it into qgi is by bringing the browser panel here so i'm going to right click on my panel and i'm going to bring the browser panel here so i already have my browser panel here so what i'm going to do is i'm going to look for spatulite select the drop down and you can see that is the demo special light i select the drop down again and now i have my data here there's the sample line sample point and the sample polygon i can just select whatever data i want and pull it and put it into the layers tab drag it to the last tab and it will be loaded so the points i can even put the lap of the points and i can also add the polygons by just dragging and dropping it into the my layer canvas and i have my data ready to do any kind of analysis that i want to do so that's how you actually create a specialized database in qgis for us to access the demo special light you can actually just go to where we saved the data in our computer so i'm going to go to my computer the desktop gis maybe you want to save it in a flash drive data and send it to someone for for them to continue working on your data then we saved it in the special light layer and you can see we have only one file here called the demo and spatialite which makes it easy for now you for for you to now work on this data on another device without having that fear of leaving out some files because all the files that you had actually created are in just one container so that's it for today's exercise if you found this video useful and you want to learn more in qgis subscribe to my channel don't forget to give this video a thumbs up otherwise i'm just happy you're here see you in my next video [Music] you
Info
Channel: WiseGIS
Views: 780
Rating: undefined out of 5
Keywords: qgis, gis, qgis tutorial, qgis tutorial for beginners, qgis3, spatialite qgis, spatialite databases
Id: hYxA_VBIiFI
Channel Id: undefined
Length: 13min 44sec (824 seconds)
Published: Mon Jan 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.