Georeferencing a scanned map and digitizing vectors in QGIS3

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this exercise we are going to georeference a scanned map we will use this dereference map as a backdrop to digitize factors that is points lines and polygons you can find the course data at our OpenCourseWare website OCW UN - ihe dark it's the data from exercise 1 depending on your browser you can save it to your hard disk you put it in the folder of exercise one it automatically saves it there now and you can find it in the folder and we're going to inspect it because it's just a jpg it's not a GIS file format so depending on your computer it opens in your picture viewer and we can have a look around what it mentions and we see already very nice grid on top of the map monk Marcy New York Essex County we see coordinates in degrees we see something in them in meters we see also that it increases to the right and we also see a projection in feet not normally there are some extra information printed on the map so it's always good to read and interpret that information so here we find projection and thousand meter grid zone 18 Universal transfer macit are in 1927 North American datum we can go to spatial reference arc to find the epsg code remember that epsg codes are Standardization of projections in a number so UTM for universal transverse market or zone 18 and for North these are keywords and nad27 as a datum and we here find the code two six seven one eight check that it's in the right location in North America and we copy this to the memory because later we need it to define the projection okay let's go to QGIS for dereferencing we need a plug-in is called geo-referencer G dal plug-in it's an interface to G dog or plug-in so it's already installed you just need to activate it by checking the box and then we find the tool under the raster menu the tier reference or tool is opened in a new window it's best to maximize this now we can open the JPEG that we are going to georeference there it is and when we want to load it it asks for the coordinate reference system since it doesn't have one we have to press cancel that's very important so it uses only the D values from the J pack itself now we can set the transformation settings in this dialog first we have to set the transformation type a linear transformation is the most simple one it's a rotation and a scaling of the image based on our ground control points of GCPs if that doesn't result in high accuracy we can increase to a higher-order transformation such as a polynomial first-order or second-order so here we first start with a linear transformation type now we have to set the resembling method the nearest neighbor method will preserve the pure pixel values as much as possible while the cubic convolution method will take an average of surrounding pixels in this case we want to use the map as a backdrop therefore we need a smooth image and we don't need the pure pixel values therefore we choose here the cubic resampling methods obviously we also need to define the target projection so here we can choose by pressing this button with the epsg code that we have copied the right projection UTM zone 18 north on the datum nad27 this will be the target projection after geo referencing now we choose the output file name you see here it goes to the right folder and if we keep it check to load in QGIS when done the result will be loaded in the map canvas so now let's collect our ground control points or GCPs at the nodes of the grid now with this button we can add a DCP it asks us to give the coordinates which we read from the site so first the easting 580 1,000 meters east and the northen that's four eight eight five zero zero zero meters north' and we see that the GCP is placed in the table below we see the file coordinates and then the destination coordinates in UTM let's go to the second point the minimum is about four points which would be well spread over the map the more points more accurate it will be so it plays here our second point I plays it on purpose a bit of the note to show you later how to move it I'll read the coordinates from the site then it's five hundred ninety nine thousand meters east you see the meter zeroes and four eight eight five thousand north the red line shows the error which is very large but we only have two point so it cannot really determine it with this button we can move to GCP to the right position if we have haven't connected immediately at the right position let's play the third point let's take a nice spot this one is clearer than the others let's add the GCP read it from the side so that 600,000 if we extrapolate easting and now the northing for 8 73000 eaters north now we'll do a fourth point place the last GCP and we'll read the coordinates from the sides so that's 580 1000 meters east and 487 3,000 meters north okay now we have four points and the red line gives us the error in pixels it's displayed here in the table and we also get it in the status so we're about 41 pixels wrong which is quite a lot so the solution can be to remove points and add other points or to use a higher-order transformation so let's go to a polynomial first-order transformation and see what happens and we see that the error is drastically reduced the number of pixels when we zoom in we see the error is within one pixel and the mean error is zero point two pixels so that's acceptable what is acceptable but it depends on your purpose and when I press the play button it does the transformation and the output will be shown in the map canvas so I can remove this window for the dereferencing I don't need to save the GPS it has been okay and we see that the projection of the map canvas has been changed also to epsg two six seven one eight and we see that the map is here now we can verify the coordinates in a very simple way using the coordinate capture tool let's that button and then let's just sample a coordinate so we have to click start capture and then click on a pixel it will report in latitude longitude that's in the first field and in the UTM coordinates Canfield and if you read it from the sides we can see that the value that we get the X and the y are pretty close so that confirms that the reprojection was quite successful let's take another point and also there when we read the coordinates from the sides it's pretty close so that's one way to confirm what we can also do is use a background map that is already referenced so if we use the quick map services plug-in we get access to a lot of Internet resources base maps such as Google and Open Street Map and under the web menu we can find an equipment map services and if we go to settings the first time when you install it and more services you can get a contributed pack and with that you can get the list as big as the one that I show here and let's load here the Google satellite image in the background and let's see how good our map fits with the background we can do it by toggling we zoom into Lake we can check if and we toggle on and off with it as it could fit but as you can expect our also better methods if we press f7 we get the layer styling panel and then we can set the transparency we see it changes life that's a way of verifying but a better way is to use blending mode put it to multiply this will blend the two different layers here we can check now how good the short shores of the lake fit with the satellite image there could be a time difference between acquisition of both but we see that this is reasonably nice so the dereferencing compared to the satellite image have been has been very nice we can also blend it with another layer like the OpenStreetMap and there are also we don't see any difference which means that it has been done very well a bit of toppling you can see that the dam even is in the right position there so now this means that we are quite confident that this scanned map which is now georeference is a good backdrop for digitizing so we are going to create a Geo package with points lines and polygons you'll first start to create a layer with points with all the peaks we go to the layer menu choose create layer and new geo package laid because this is the first layer that we create we also need to create the database did your package database so let's call it mount Marcy and then the name of the table in this case there will be Peaks because it will contain the mountaintops it has a geometry the point geometry you will not use the Z dimensional just directly use the values for elevation and we check that the right projection is chosen which is the case and we add an attribute with the name elevation which can be a decimal number or real number and then we can add it to the list of attributes by default there will be a ID number and then the attributes that we add so we can also add other ones text data or date and time if you want to works on for at the name of the mountain peak we add text so we see the peaks layer is added when we hover our mouse over it we see the location in the Geo package and we can toggle editing and then we can add the points so here's our first point it auto generates the feature ID so we only have to fill in the attribute for elevation so that's 764 meters and let's look for another point here we have another point we add another point how to generates the feature idea and we have to only type 738 meters and let's take a third one for you space in editing mode we can pan by just dragging the mouse here's a third point again it outer generates feature ID and we type 66 meters so these are three elevation points and what we can do is we can save it we can still edit it by moving the vertices here it's highlighted and then we can move it or we select it and move it back and there's a undo button so we can save once it saves it stored in the attribute table and let's open the attribute table and there we see our three elevation points with outer generated feature IDs so our first layer in the Geo package a point layer is ready let's create a new one select the same database and we create a new table that will be the one of the rivers so we call it rivers or river and it's a line projection is the same name is the name of the river so we call it name in this case it's text and we limit the length to hundred characters and then we add it to the field list again automatically feature ID will be created and this will be added now this layer is a new layer so we choose add layer to the database when we hover our mouse we can see in the information of the layer in the database let's choose a nice river for digitizing so here we have the slide book we toggle editing and we start from the upstream to downstream because with lines also the direction is important with this button we can add notes for the line and we trace the river from the backdrop to its it downstream you clearly see the effects of the resolution approximate if you make a mistake you can press backspace it goes one note back every every left click you add a note now we're almost at the point where a tributary joins we place a note there because we need it later if you want to add the tributaries in that way the tributary will be accurately joined to the the other river at the right spot I'll stop here if you click right it will finalize this feature F ID will be automatically generated and with a name we type slight Brook press ok and we see the thin line which has a random color in this case not very visible later we will style it let's do the tributary again we start from the upstream and we go to the downstream first of all we need to activate the snapping toolbar and set the snapping because we want really that the tributary snaps to the vertex that we have placed we can change it from pixels to meters and we put it for example at 25 meters that's the tolerance if we are within that distance we can test it here resume to the junction if I come close within 25 meters to highlight and we will snap lines that we digitized to that point let's start digitizing tracing the river from the upstream to the downstream until we hit the tributary where the tributary enters the other river there we go we see that the other tributary joins there so he plays a note exactly at the point where we want to snap the other one we see if we come closer that it will snap to the dot to the vertex click right to finish it and then we type slight brook again because it is still the slight book and let's do the last one similar way upstream to the downstream and try to connect or snap to the vertex that we place at the junction so again when we come within 25 meters to snap we click there and we finalize it by clicking right and we also call it slight brook okay so we save it if you do this card it means undo everything that you did and that's in emergencies and let's open the attribute table and we see here three feature IDs and three times slide book now if we consider want to consider the slide book as one we need to use the dissolve function which is a factor geoprocessing tool there we go dissolve we choose the rivers layer and we click these three dots on the side unique ID fields and we check the box and name then it will join every feature with the same name in our case every feature with slide brook will be joined to one we add this to our Geo package that we already have so we have all the layers together and it asks for a layer name so this is rivers but then dissolved okay and then I run it it's quickly done let's check the result from the attribute table and we see indeed that now there is only one feature and when I select a feature I see the whole river including all the tributary becoming yellow that means that it worked let's rename the layer to some something that makes more sense a river is dissolved and let's remove the other one okay and turn off the selection now let's do polygons we're going to digitize the legs I choose some small ones just for demonstration purposes again the same procedure layer create layer and create layer and then we choose a new job package layer we choose the existing database of Marcy change the table name to lakes and for the geometry we will choose polygons the projection is still the same and here we also use the name of the lake text data and its characters add it to the fields list to the attribute list and we press ok we click add new layer to add this layer also to the database so go editing and there we can trace the perimeter of the polygon if we place the nodes too close by it gives these warnings that's not so problematic you can just continue and when you want to place the last note you click right and it will be connected to the first note to complete the polygon F ID is automatically generated and the name in this case we just make it lake one check in a street map if there's the name of a lake now even there there's no name of the lake so let's keep it lake one now let's move to another lake zoom in well and the same we just trace remember when we do backspace we go one note back when we talk of editing we can select this card if we are not happy that's complete undo also some undo and redo buttons that you can use its space we can pan when this one is completed let's call it lake 2 and let's also do a third one and we give the original name leg three togo editing we save it and now we also can check this at three table click write open attribute table and indeed we see the three polygons and let's stop here to editing in the attribute table and we are going to add a column I want to add a column for the surface area the surface area in square meters which can be calculated using an internal geometry function which I will show you and that will be a decimal number click OK we choose hair surface as output equals and then name of the function under geometry we find these functions area will calculate the area using the map units we see a preview so surface equals dollar area when I update it I get here the surface area in square meters in the same way we can calculate for the rivers the lengths of segments and we can also add coordinates already but I can choose their categorized and we choose the name column there choose classify and now every lake will get a random color a unique color per lake for a rivers let's give them a simple blue color you okay to zoom to the lair clicking right see the layer there and now nicely in blue and we can also change the style of the peaks we can use f7 to see the life changes I choose there all symbols and give it a triangle and let's make the triangle red we can also change the outline let's make it black so if red triangles a black outline just some simple styling we'll focus more on styling in another video that would also be nice to have some labels so let's label the peaks with the number of their elevation there we are we see now the numbers printed next to the peaks it's better to make them more visible create a little bit bigger distance from the triangle and you can use a text buffer or even clearer to read and what we can also do play a bit around the labels if we add things we can concatenate text so we add meters to it and for the river it would also be nice to have the name of the river next to the river so we use also the label with the name we see there in black slight brook next to the river let's change the positioning and make it curved especially nice with rivers it will follow the and the flow of the river and there are all other kinds of options that we can set so you can play around to see the effect change the font type and the color let's also make it blue and there it is this labeling is depending on the zoom level so we see that it moves a bit and if we remove the background layers we see here our digitized points lines and polygons they're all stored now in the Geo package also save the styles to the database you can save it as a layer star as a diamond we can save it also to the deal package and give the style a name and a description and we can check the box to use it as a default style for the layer and it will be automatically added when we load the layer and let's do the same for the rivers you also save the style in the Geo package to have everything together and that's of course a big difference with a shapefile we can have now points lines and polygons together in one file to do database including the styling and for Peaks same and there it is not to prove that everything is stored in the database I'm going to remove these three layers and add them again so in the browser I go to the right folder there I see the Mount Marcy geo package and I have the three layers that I want to use be sure to use the dissolved and there are this including the styling that we previously gave so in this exercise we learn to georeference a scanned map and to use that as a backdrop for digitizing points lines and polygons that are stored in a geo package including styling
Info
Channel: Hans van der Kwast
Views: 16,211
Rating: 4.9477124 out of 5
Keywords: QGIS, georeferencing, digitizing, vectors, GeoPackage
Id: m12ZXpGBoDc
Channel Id: undefined
Length: 32min 39sec (1959 seconds)
Published: Wed Aug 22 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.