Creating and editing a shapefile in QGIS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this video is going to show how to create a shape file and add data to it by tracing aerial imagery in qgis and so to do this we need an image and in other videos i've showed uh how to stream in imagery from arcgis online into qgis i'm not using that imagery in this video because it's actually against the arcgis online terms of use to digitize and trace objects off of its streaming imagery in any program that's not arcgis so we need to get imagery from somewhere else and thankfully it's easy to get that from the government so i'm going to go to the national map downloader if you search for that you'll just pop right up and this is a site from usgs where you can get all kinds of data elevation data hydrology data um and also imagery so what i'm gonna do is just zoom in to the place where i will be tracing data and where i want to get an image it's gonna be this part of ellensburg washington out by the uh this interchange with highway 97 and i can check on this imagery nape plus and search for images in this area this is a program where aerial imagery is taken during growing season um throughout the country and if you hover over these it will show you the footprints that are covered this is the one i want so you can see how it the interchange highlighted in gray that's the area covered by the image so i can just click the download link and i'm going to save this in a folder which i've created for the data here so once this image is downloaded i can go into qgis and i'm going to add through my data source manager raster data and just browse to that um data set there it is and if i was going to use this for other purposes or i had a lot of these images i might make the names a little more user-friendly but this will serve our purpose as well so here's this image and i can zoom in down here and look at this interchange uh this isn't the highest resolution but it will definitely it will do for what we're doing here today which is just practicing tracing some of these buildings and roads and making a new new shapefile data from that so uh how do i make these new vector layers that will allow me to trace this i'm going to make sure first of all in qgis if you right click make sure the digitizing toolbar is turned on you'll then see some of these tools here a lot of them are grayed out because i don't have a vector layer in here that i'm editing yet but if you click new shape file layer you can make a new shape file i'm going to dump this in that folder where i was working where i put the image so i'll just go ahead and throw some shape files in here this one i'm going to call buildings and the geometry type i'm going to set to polygon that's important here because buildings have an area and i will also be choosing the coordinate system for this i'm just going to use the same coordinate system as the nape image when i added this to qgis you can see that it's using epsg-3857 that's a coordinate system code here for this kind of pseudo mercator projection if you don't see this in your little drop down list just go to the this button with projections and filter for 3857 it will pop right up down here uh this isn't the ideal coordinate system for some things uh like measurement and analysis or visualization but it is okay for just tracing uh vector features like this so we'll go with it since that's what this image is already using now we need to decide what columns will be in the attribute table we can add some columns here so i'm going to put a couple of attributes here one of them might be the name of the building if it has a name and that's going to be text that i can fill in and but there's other data that might be numbers for example the number of floors or stories in the building and that would be a whole number maybe something like the building owner most vector datasets have a lot of fields like this and they're defined at the at the time where you set this up so that notice of the length field so if i want the owner to have a length of more than 10 characters i need to i need to boost this here the other string or text field that i added had a length of 80 that's a little more useful if there's a long name okay so now i've got this buildings shapefile here but it doesn't have anything in it i need to edit it and trace it so i click this pencil and notice that a few more of these tools become available and i'm going to choose this one to add a polygon feature let's go ahead and trace this building so i'm just going to click carefully on each corner of the roof and you might see a shape start appearing as i do that the roof kind of sticks out there and then when i'm done i'm going to right click and when i right click then all these attribute fields become available for me to fill in i'll just give this a unique identifier let's give it a name maybe it's a dentist office uh number stories let's say that it's two stories and there we go so i guess the owner one maybe didn't take i don't know if that that field saved when i created the file but this this will do for our demonstration here so there is our shape and now it has attributes in it i can trace other buildings here i'm just going to kind of generalize the roof shape just for demonstration okay maybe this is a id of one and uh this is somebody's coffee shop and maybe it's one story okay um and so i can go along uh tracing buildings like that now uh it's important here uh to know that these are not saved automatically so these edits need to be saved and you don't save them by pressing this save button this save project button up here is for the qgis project which just contains the layers and the colors and things that you're using in your project you want to actually save the edits to your shapefile you need to click this button down here save layer edits and if you don't do this you're going to lose the work you did so let's do that i'm going to stop editing now by clicking this pencil again let's make a new shape file and trace some roads here let's see how we would do that similar procedure so we click new shapefile layer um i'm going to dump it in the same place here but i'll just call it roads and this one instead of polygons is going to hold lines it's important to not forget this step here or you'll get the wrong kind of thing coming out of your um when you start digitizing i'll set this to 3857 again as the coordinate system and uh you know for roads we could add definitely want to add a name field as text data and um we could also add like a surface type maybe when i made that owner field i wonder if i forgot to click add to fields list i've had that happen before where i set it all up here and then i forget to add so don't forget to do that for the fields you want to add okay and to edit this roads shape file we're going to make sure it's highlighted on the left just to review we click the pencil and now we have this add line feature and it's sort of the same procedure i'm just going to hold down my middle mouse button here in a pan let's trace this road right here so i'm going to click along the road as it goes around a curve i'm going to click a little more often so i can capture that curve vector data is basically just connecting the dots so if you want to make a curve you got to put a lot of dots to give that impression of a curve when it's straight you don't want to put lots of dots because then your line kind of zigzags so this is a straighter area i'm just going to put fewer vertices in there and i'll right click when i'm done so i can give this a unique identifier a name if you're familiar with uh this is dollar way road and maybe we say it has a surface that's paved uh this is very hard to see so we could try to set up a style where it's easier for me to see those roads here's a bright yellow this is fine i could also um edit the symbol and make it a little thicker if i want so maybe i'll bump the width up a bit and i can see this road here now let's say that i want to digitize some unpaved roads maybe something like this little driveway you have to be careful when you're doing things that connect because no matter how closely i try to click right onto this road i'm going to miss it if i zoom in i'm either going to overshoot or undershoot and it's important when we make things like road networks to get them well connected so that eventually if we want to do things with that data set like network based routing we know where we can make turns from one road onto another so all that it goes to say that it's important to actually snap this new line onto the existing line and to do this in qgis we're going to right click and turn on the snapping toolbar and click this little magnet and this will ensure that uh when i go to add a new feature here that it will snap on to any vertex that i've placed so you can see as i hover over this turns purple that's where a vertex is i could snap onto that now i actually want to snap on it anywhere on this line so i need to go down to the open the snapping options that was right off the second button here and instead of snapping on vertex i'm going to snap on any part of the segment this will allow me to snap to more parts of this so as i hover over any part of this line i can snap my new road on there and that's what i'm gonna do here so um let me just click on this and start digitizing this little driveway right click and uh to finish i don't know the name of this road i don't think it has a name so i'm going to leave that blank and it's unpaved and then let me do another little driveway here this one kind of winds around back here right click to finish i'll give it another uh id i don't know the name of this one this is unpaved i don't think it has a name so now i've got a couple roads made and i could continue working here and digitize the whole town if i wanted to trace those roads myself i would need to know the names of the streets and their characteristics that might require some field visits to verify whether things are paved or unpaved or cross checking with other imagery and other data sources that's all part of creating new data so let me make sure i save these edits and i'm going to turn off editing now the last thing i can do let's look at the stuff i made i'm going to turn off the image and you can see the stuff i digitized let's symbolize the roads based on the pavement type so you can see now the hard work i did putting in those attributes is going to pay off so i go to the properties on these roads now i can symbolize them and categorize them based on the surface type and i'm going to click classify here and you'll see paved unpaved and unclassified so let's turn off this one with no value and i'll right click whoops and change the color of the paved roads let's make those like some kind of grayish dark grayish color and then uh unpaved i'm going to right click here and change that color let's make it like a brown okay and you can see how these attributes that i selected uh are now being used to symbolize uh the different features that i made and so this was just an overview of how to create a new shapefile in qgis and how to trace imagery to digitize or create new features uh in both polygon data types as well as line types and you can follow the same procedure for point data as well that's really easy because you just click where you want the point and you're not connecting any kind of dots
Info
Channel: CWU Geography
Views: 27,900
Rating: undefined out of 5
Keywords: QGIS
Id: YCHr2HdAbDg
Channel Id: undefined
Length: 13min 44sec (824 seconds)
Published: Tue Aug 31 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.