QGIS Exporting to CAD(dxf)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so so I'm going to be creating this video for a student who's asked me a question with regards to how to you to export contours or to to source contours and then export them to CAD to using a CAD package and and that's that's pretty much what I'm gonna go through you know there's a couple steps and that I will be covering ultimately it's quite a simple process to export to CAD but since I'm going to be sourcing the the elevation data there's a few other steps that I want to go through first so let's let's crack on with that video and yeah hopefully you find it really useful Cheers okay so we're going to start by creating some project folders and I'll create in the usual desktop place so my project is called Issel weenie and then I'll just create a few extra folders inside that project folder for my cutest projects as well as the data and then inside the data fall that I'll have spatial and I think I'm gonna leave it there possibly inside spatial I'll create a new one called rest I can see that I might need a rest rest a folder as well okay so we can open up a new session of QGIS and we just want to locate the position of our project so our study area so I'm going to turn on a layer from the quick map services and this quick map services is a plugin that you can turn on via your your manager install plug-ins so if you go and search for quick map services I'll show you where it is quick map services so you just go type it's quick map services in your search bar here and you're going to look for this one quick map services turn it on or install it and then it'll give you a new option under the web menu with a quick map services option and you'll see I've got quite a few options here I think the default by default is not that many so what you can do to access all these extra ones let's just go to settings and then select more services and then just click on get contribution pack and install that and what that'll do is then give you access to all these other services so the layer I'm going to turn on to locate my study area is open topo map so it's turn that one on and then zoom into our study area which is in Swaziland and study area is called is all we need right so what I want to do is I want to create a grid that will be used later when we export the DXF that can be used to reference the contours in that DXi package so I'm going to start off by creating that grid and before I do that I'll just need to make sure that I have got the right projection selected for this particular project and also I'll just get on to down here and my projection is the is 303 ID 10 25 68 okay so it's hard abuse took 94 LS 81 so let's say I apply okay and then you'll see the ID has changed and my coordinates are now in meters I think there probably were in meters because the previous coordinate system was a pseudo Mercator but anyway this is where we are so what I'm going to do is create a grid and I I want to start off it's just a little bit and see Shino I want to zoom in down yeah okay so this is my study area area down here and I want to start off using these meters as my coordinates which I will then create in an Excel spreadsheet so it is it's going to start off with about 1/5 okay and then I'm gonna increase it in thousands so I'm gonna go 1,500 one six one seven one eight about 18 so my last point will be here somewhere and then also let's start off on that latitude there is - what is it is that 29 dead 29 million how many nodes are there 2.9 million yeah 2.9 million so so we're also gonna go up in thousands there so it's gonna be - 9 - 0 0 0 and then - 9 - 1 0 0 0 and so we'll create that grid so let's go and quickly do that in an Excel spreadsheet so let's go into our project folder spatial I'll create a new folder here will just call it tables and then I'll just go inside there I'm going to right-click and create a new spreadsheet Microsoft spreadsheet I'll just call the chords for coordinates let's open up that one ok so we're gonna go point X Y so point a first point now this was the first point it was 15,000 and then that first one was minus 2 9 2 and then 4 notes 1 2 3 4 ok so now that is the first point and we need to repeat that or the remaining points so then this one's going to be minus 2 9 2 and that was one thousand and then this one's gonna stay 15000 so we're running down the latitudinal points now so that is B C D these will all be 15 and then the next one is gonna be 16 and then these you just increment those in thousands so that is perfect so now we can copy this I'm gonna do that another three times then we go 16 so 16 then I was 17 repeat that in the last one 18 a PC all right to pee all right so let's save this and now we just need to make sure we save it as an Excel spreadsheet I beg your pardon it has a comment delimited text file so it's a CSV so we're gonna go save as save it in the same place but now just make sure we choose the right CSV so you see there's a couple options there we want to choose comma delimited and we can say save yes and now let's close this down okay so back in QGIS now I want to bring in those points so we're gonna add the CSV so we go to open data source manager select our delimited text layer I'll go find that new CSV that we've just created which was in tables it is not that one okay that brings it in that looks good okay just make sure that the user can see your table here and there are separate columns for the the three different fields and then make sure that you got the right coordinate reference system so this needs to be the same as the coordinate reference system you chose when you first set out your project okay so that should be good so now we can say add and close and let's see that those will come through there they are okay let's just zoom out slightly so let's make this 1525 not that much trying to be good okay so what I maybe could do is change the color of that just so we can see it a bit better so choose something a little easier to see I don't know maybe the size would be better if I change that size up to three that's pretty big but that should work okay so now we've got our points so now this is going to be the grid that we use to reference the DXF at the end of the day so the next thing I want to do is I want to create a sort of a study area of polygon which is the full extent of this grid and then I also want to put in the longitudinal attitudinal lines and the last thing I will then do is once I have that I'll go and extract the DM and then then create the contours from a Artyom that I'm going to download so let's create the other layers and I'm going to create in this example I want to create a I'm going to create a Geo package so let's create that Geo package okay so let's do that in browser so I'm gonna add a new directory to my favorites in the browser and it is we need they're just there I'm just rename this so it it's a little easier to read oops supposed to delete that there we go so now I've got a is all we need fall down and that's just a direct the directory pointing us to the fall that we create on their desktop so this is what all our date will be and I'm going to create a new geo package in the spatial folder so I'm just going to right click on spatial folder and then I'm gonna go through to new and choose JIRA package and this jer package is going to be called Halloween well and the new table so the first table will be grid lines grid lines and it is aligned and we can give it a a column and just call it 20 and then just make sure that it's got the same projection as the project and then say okay okay so what that what we've now done is we've created this Geo package and so we can create new layers in their geo package and also save existing vector layers to that package so I'm going to go in and get my coordinates and I'm going to export them to that geo package so now I want to go and select your package choose the file name it's all we need okay there it is in the layer name is these are my coordinates okay there's my coordinates and it's got the same projection as the project etc and so we can say okay now if we go back to our browser and then refresh this window we should not have to two layers in the Geo package I'm just right click and have a look at the layer properties you can see what it looks like it's good oops otherwise I'm not seeing that maybe I need to wait longer let's just try that again so I'm gonna go layer properties preview attributes okay so it's got the the columns that I created in that Excel spreadsheet except this is no longer there linking to the CSV this is linking to the coordinates layer or the chords layer in my geo package okay so what we can maybe just quickly do is we can delete this one and then just wreak out of that one so what I'll do is I'll just go to Styles I'm gonna copy the symbology just dump it onto the new layer and then we can delete this one okay good next dip I want to create those latitudinal lines and then also to create a polygon that goes around the outskirts so let's create a polygon layer so let's create a new Geo package layer we're going to select the database and it is what we need and this one we're gonna call study area study area it's a polygon and we will give it a new field just one new field and also make sure they've got the right projection and then say okay and then add so now this is asking us do we want to overwrite and create a whole new geo package and if we clicked selects that overwrite it would have a bit of conflicting issues here so we just want to make sure we're adding a new layer to an existing geo package so select add new layer and there we go so there's our new layer I'm just going to quickly style this and possibly make it transparent so we're gonna make it 50% opacity so we just so we can see through it now yeah there's not a great color because yellow is the same as a selection color but it's not important at this stage let's leave it as yellow okay but there's nothing there obviously because we haven't captured anything so then we're gonna start editing okay and then I'm just gonna set some snapping options so that we can snap to our existing grid so I'm going to say advanced configuration okay yes I was clicking the wrong button it so I want to click on the little eyeball that allows me to edit the advanced configuration and then set the the Ezell weenie coordinates as the layer to snap to okay we can close that done so now we can add a new feature so we'll just add a full extent and this is going to be called our study area and a right-click to finish and we'll just give it that same name underneath and just save it and we can do the same thing for some longitudinal longitudinal and latitudinal lines so we'll do that same thing again so we need create a new layer it is gonna be saved inside the Geo package it is gonna be okay we're gonna name it what are we gonna call this let's just call this lines or grid lines grid lines it is lines line same coordinate reference system as the project I'll also give it a name I might not actually name anything in here but just having this field might be used for later later stage say okay and once again adding to a new layer we're not overwriting an existing one a table oh okay so I've already got those lines that I create those re yes I did when I first created the Geo package ok so that was silly so I'm just gonna say no and cancel and then just go and add that layer from the Geo package so that's probably a good thing so I can show you that you can overwrite layers that are already inside Giorgio package but what we did is when we first initially created the Geo package in the browser it gave us the option to to create a new layer called grid lines and that's what we did or any-any layer really inside the Geo package so now we're gonna add this to our project so you can select it and you should be able to drag it across but I'm going to use the data source manager go to jeer package and I'm going to create a new connection so I got new I go and find the Geo package that we're using use that one and then connect to it and yes want a new connection right and then connect there we go so I was connecting to one that I created previously but we want to make sure we connect to the right one so just make sure that your your path name is the correct one and you're pointing to the right to your package and gridlines is the layer we want to add so you can select that click Add and then close obviously nothing's showing yet because it's a brand new layer we haven't actually captured anything so we all just start capturing this layer but before I do that I'm just going to change this color to black okay and we don't actually need to have our open topo map open in the background it's just kind of confusing us a little bit so we're gonna create those new lines we can also actually turn off our study area map and let's create those new lines so I'm a toggle editing now we've already set the snap settings so we just need to create new lines okay so that is our first line or I click to finish name we're not going to worry with names and every time we get close enough to to a point you'll see the little pink box will pop up to indicate that you have snapped to that closest point and then we'll do the longitudinal lines as well this was 15 this was 16 thousand meters etc right so we can save that here we go okay so now what we have is a little project with a grid and a study area that we're gonna use to clip our 30 meter srtm from the data we are going to download Nick so that is the next step but before I do that I just want to save this project so I want to click on save go and find my project folder and we'll just call this little weeny there we go okay so happy with it that's been saved now we're gonna go download these or to you right so let's go online and download so first thing I wanna do is just have a look what we've got sure this is a little text file that I've got just remind me where the what the link is to the 30-meter srtm and that's what it is so the the SRT M stands for the shuttle radar topography mission and this is a little description downloaded from from Wikipedia and that's the link to Wikipedia and then this is the link to the actual server where you're going to download your your 30 meter grids from and then this is a little sort of a third link where you actually need to register before you can download so if you went straight to this link it's gonna say what is your login if you don't have it you won't be able to download so just make sure you go and log in before and create a little account before you actually start downloading so I'm going to copy this open up Google Chrome or any browser I'll just paste this in there that should take me straight to the server right so now we wanting to download the block corresponding to Swaziland so we can just scroll in here and see there's the whole is the sort of the interior of Swaziland is covered by one block so that's gonna cover kind of our study area so if we wanted to to do or to download all the s Artyom's for the whole of Swaziland we'd need to go get that one this one so we probably need to download but looks up at one two three four five six would have a Swaziland bit at the end of the day but we just are concerned with this area so we're gonna click on this one to download it right so yes we want to download that digital elevation model shouldn't take too long that's going quite quickly right so what I'm gonna do next is go and grab that srtm and it's not that download folder it's a different one this one here the road is there so I'm gonna cut that I'm going paste it in my project folder under the raster folder and then I'm gonna just extract it extract there we go so now we've got this hg h GT file which is a raster file and I'm gonna put it in the parent folder okay so what is I cut it out of that folder and then I'm just deleting deleting the zip folder and then also that follow that it extracted too right so there we go that is our our DM which we can now add to queue just so let's go back to QGIS we can turn off shut down ha Rosa back in queue just want to add a new layer and it's a raster layer and it is in the rest of folder and there it is there and close ok there we go so now if we zoom to the full extent of this and turn on our topographical map again you'll see it is the 30-meter diem for the whole well most of swaziland in this instance but we're just interested in this area here so we are going to use the study area shape to cut out the DM for that particular area and that's what we will use to then create the contours so let's do that so we'll go to raster extract and we're going to clip press to buy a mask layer so the input layer is the HG T so that's the new srtm and study area is the only polygon so it's it's automatically choosing the mask layer for us because there is only one polygon layer we're gonna use the the source CRS which i think is wgs84 let's see yeah look it's that one and then target one we want it to be I think it's this one I think we just go source will be hard to bear stock so let's just see if this works and then so what I'll do is I'm not going to create a permanent resting I'll just run this to see if that works I left something out let's just try that odessa optional is optional their study area maybe it is because I got the wrong CRS let's just try this and see if that works okay so that was the issue I had I need to set the actual CRS from the original raster and in the new one so now let's just double check that that is the case this is the output this is the new rest of those old ones so if I got an output properties the information here should give me this CRS which is hello 31 perfect okay so that's temporary there let's just create a permanent layer by exporting it so I'm going to say save as geo TIFF is fine I'm gonna go and put it in the folder there we go let's finally say okay so it adds it to the map so I can remove that I can also remove the original I like to remove layers if I'm not if I know I'm not gonna use layers are gonna try and remove them as often as possible so there - my my layers panel doesn't get too cluttered so now what that it's not TM is is it's an elevation file these are these all each cell is an elevation value and they're 30 by 30 meters so if we have a look at the cells you can sort of see them here so there should be 30 meters maybe 30 meters by 30 meters and then each one of these will be an elevation so the bands are elevation above sea level in meters okay there we go right so that was easy enough now what we can do is create the contours so we've got a raster again and we're gonna extract the contours so from the DM the interval of let's just say 5 meters it's gonna create a new vector layer with an elevation column and the elevation column title is 11 so you could have call this alt or contour what if you like I'm just gonna leave the default there I'm happy with that and there we go it's gonna create a temporary one let's just see actually if we can save save to file and choose to geo package select that your package ok so I'm not gonna do that that wants to create a brand new one so I would rather import it so I want to create a template layer to start there we go those contours look good and then I'm gonna export this to geo package which is that one okay the layer name is gonna be conscious there we go anything else that let's say ok and then remove the temporary layer and let's just have a quick look at the attribute table so we go back to our Isel in browse you can get back to is all we need and you could have also done this through the the work the windows panel at the layers panel and then just open up the layer properties oh it's good it's got the same projection and then the attribute table has got that new column that i was talking about so there we go there's a field or the new column and with the elevation value for each of those features ok great so now that's something you can export as a DXF and then load in package so that's actually quite simple and we're gonna use the option we're gonna export a bunch of layers so what I'm gonna do is I'm just gonna remove everything that I'm not using anymore okay save my project once again and now we can export all of those to a DXF so under project select import/export so export project to DXF so that's gonna export everything that's in our project and I'm gonna save as so let's just call it a vector layer and what should we call it these means the DXF so let's just go contours countries use the extension DXF okay save alright this is all good okay now there's a couple of options down here you can first of all choose no symbology as your default option and it's not going to export any labels now I've tried this before I wanted to pull through text from the the grids that I could then use for geo referencing and scaling in a CAD package but I haven't been able to pull those through I'm not sure if there's a bug in the system as of the 18th of May 2020 what is this Karuna 3.10 version actually don't know but anyway at this point in time i wasn't able to pull through the labels now it could be something I'm doing wrong so just fiddle with that and see if you can figure it out so the other thing I want to do is support features into 6:00 news we're just gonna export features intersecting the current map extent so if there was anything sitting outside of our extent that wouldn't come through but it's not important because we are the full extent of all our features in these layers right that's it so now we click OK and that was quick export completed okay now it's completed so what we should have now is a DXF in our project folder which is which is here somewhere okay and spatial we should not have a DXF contours okay so now and it's 902 kilobytes so you should we then be able to go into your care package whatever that is and then add that layer and since you know what the coordinates are from that excel spreadsheet you should be able to import points if necessary and if you do need to scale the the vector data you can use that grid that that's been exported with these contours as well as or just the Excel spreadsheet data that we century-- earlier so I don't I'm not going to show you that part of of how to to import that into a CAD package but that if you're working in CAD should be easy enough especially if you're proficient at cat what we can do is a last step just to show you that did work is just added to a new cutest project so if I go an arrow DXF there we go to a new project click add we'll select all of those ok close there we go that's what it looks like now the the Caird hasn't got a coordinate reference system assigned to it so this is because these are cared entities you might need to come in here if you were gonna use this in QGIS and then just assign the correct coordinate reference system something like that and then you would do that for the others but not I don't think that's going to be an issue if you're going to be using cared okay and that's how you do it it's fairly straightforward well let's disappeared here we go so that's pretty straightforward and if I just make sure that that's working properly I can too Google imagery here we go my date is there somewhere just change these contour colors to something that will stand out on top of a satellite image and then just double check the the attributes that have come through now here we go we've got our layer so we can turn off the grid lines if necessary so for instance in that example so now this is if we were still working in in QGIS obviously you can go ahead and then turn your layers on and off so for instance if you were bringing a layer in from a DXF this is what you would do if you just wanted to us to show show a certain layer and not others and that's it pretty straightforward I hope that's been useful give me a shout if you have any questions just
Info
Channel: Q-tips
Views: 9,691
Rating: 4.8709679 out of 5
Keywords: QGIS SRTM Download, QGIS Export to dxf, QGIS Export to CAD, QGIS Clipping a Raster, QGIS Extracting contours, QGIS Geopackage, QGIS Coruna 3.10, QGIS Save a layer to a geopackage
Id: PGzY28df50Y
Channel Id: undefined
Length: 34min 29sec (2069 seconds)
Published: Mon May 18 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.