The Grid transformation - Practical Example
In this section we'll explain how to perform the Grid transformation with CorrMap (please refer to section Basic concepts | Grid for the concepts and the algorithm). To do so, we will follow a practical example. So let's start a new CorrMap project as explained in section Basic Operations[****]| Starting a new project and select the MAP1.PNG file from the CorrMap samples folder (see section Getting started | Samples and demo version). The map will be opened in CorrMap, we then select the Grid transformation in the menu on top as shown in Fig. TR.G1 (1) and we are ready to start.
Fig. TR.G1 – A new map ready for the Grid transformation.
This map is the same as we used in the section dedicated to the Affine transformation example (Transformations | Affine). In this case, however, we don’t want to apply the geo-referencing to the whole map because we are only interested in retrieving some points in the center-North side of the raster, needed to resolve a boundary dispute. So we zoom to that area on the map, as shown in Fig. TR.G1, where we can also see that the grid lines interval is defined as 200 meters (3).
The points that we need to retrieve from the map are of two types:
1.Some corners of the buildings present in that area (drawn in the map with a darker okra color). The purpose of these points (indicated by seven red circles in Fig. TR.G1) is to link them to their corresponding real coordinates, which have been obtained by a field survey to the buildings shown on photo of Fig. TR.G2 and in the aerial view of Fig. TR.G3 below.
2.The disputed boundary line dividing plot 5 from the three plots 3, 15, 18 (indicated by four red arrows in Fig. TR.G1).
Fig. TR.G2 – The surveyed buildings corresponding to those present in the map.
Fig. TR.G3 – The aerial view of this survey.
To start the transformation, we simply need to click the Grid-point button on CorrMap toolbar (4 on Fig. TR.G1), the cursor will then assume the form of a little cross. With this cursor we now click the grid points forming the squares which include the points we need to retrieve from the map. So let’s start by clicking the upper-left vertex of the grid square on the left indicated by a blue circle in Fig. TR.G1. As we said in the example of the Affine transformation, while clicking the grid points we must zoom in to them very precisely until we can clearly see the single pixels so that we can click them with a high degree of precision, as shown in Fig. TR.G4. In fact, we should remember from the Affine transformation example that this map pixel resolution is 25 cm, so by clicking just one pixel off will cause an error of this value.
Fig. TR.G4 – Points have to be zoomed in until we can clearly see the single pixels.
Once the grid point has been clicked, the window shown in Fig. TR.G5 appears, letting us insert its map coordinates that we can read directly from the map itself.
Fig. TR.G5 – Points have to be zoomed in until we can clearly see the single pixels.
Confirming the coordinates by clicking OK, we’ll see an X blue cross appearing exactly where we clicked the grid point. At the same time, in the Output window below, section Reference points, a row is created as shown in Fig. TR.G6 containing the following data:
•Point: a sequential number assigned to each inserted reference point.
•East/North raster: the raster coordinates, i.e. the distances in pixels for both directions between the point and the raster origin, the lower-left corner of the raster image.
•East/North map: the real map coordinates that we assigned to the reference point.
Fig. TR.G6 – The new inserted grid point is defined by an X blue cross and a row of numerical data.
Fig. TR.G7 – Here’s all the points forming the 4 grid squares that cover all the map points we need.
Fig. TR.G8 – The grid points raster and map coordinates, ready for the transformation.
What we need to do now is to identify the points we want to retrieve from the map. To do this, we simply need to press the Transforming point button in CorrMap toolbar (5 on Fig. TR.G1), then click each point on the map. As we said above, we need two different types of points: the building corners needed to link the map to the real survey points and the boundary line that we want to verify. So let’s start with the building corner points shown in Fig. TR.G1 (red spots). We click on the first one and the window shown in Fig. TR.G9 will appear asking for a name we want to assign to the point and its type. The type can be defined as Control and Tracing which have the following meanings:
•Control: means that we are inserting a control-point, i.e. a point that will be used to link the map to the survey, as for the building edge in Fig. TR.G9.
•Tracing: means that we are inserting a tracing-point, i.e. a point that we want to trace in the field, such as the boundary points that we’ll see below.
Fig. TR.G9 – The insertion of a building corner needed to link the map to the real survey point.
Once we confirm the point by clicking OK on the window, we’ll see a green X appearing on the map and the row shown in Fig. TR.G10 in the Transforming points table of the Output window. This row, at the moment, only contains East/North raster coordinates of the point, i.e. the distances in pixels between the point and the raster origin (the lower-left corner of the raster image), whereas the East/North map coordinates will be calculated by the program.
Fig. TR.G10 – The point is defined by a green X on the map and a row of data in the Transforming points table.
So we continue inserting all the remaining control-points (building corners) as shown in Fig. TR.G11.
Fig. TR.G11 – Here are all the control-points inserted.
At this stage, the remaining task is to insert the boundary points that we want to reproduce back in the field (*). As you can see in Fig. TR.G12, this operation is performed in the same way as we did for control-points, the only difference being that we need to define the points as type Tracing. This difference between control and tracing points has no particular meaning to CorrMap calculations, its purpose is merely to distinguish the two sets of points so the user can export them to separate files to be used in other topographical applications and subsequently to resolve the boundary dispute. In such applications, in fact, the two sets of points are used in different procedures. Control-points are used, for example, in a rotational-translation to link them to their correspondent surveyed points; whereas Tracing-points are used to calculate the tracing observations once the survey has been transformed into map system coordinates.
Fig. TR.G12 – The insertion of a boundary point that we need to trace back in the field.
Confirming the boundary point clicking OK, we’ll see a dark red X appearing on the map and the corresponding row in the Transforming points table as we've seen for the Control-points in Fig. TR.G10.
Once we are finished with all the boundary points, the map will appear as in Fig. TR.G13. The Transforming points table now contains all these points with their raster coordinates (the blue box in Fig. TR.G14) and so we are ready for calculation. This is simply run by clicking the Calculate button on CorrMap’s Grid toolbar (2 on Fig. TR.G1) and it produces the real map coordinates shown in the red box in Fig. TR.G14 (note the letter in the last column of the table showing the type of each point: ‘C’ for Control and ‘T’ for Tracing).
Fig. TR.G13 – Here are all the transforming points: control-points (building corners, green X) and tracing-points (boundary vertices, dark red X).
Fig. TR.G14 – Transforming points raster coordinates ready for calculation (on the left) and calculated real map values (on the right).
You might wonder why in this case we do not have a Deviation column, as we had for the Affine method. The reason is explained in section Basic concepts | Grid, i.e. the Grid transformation completely removes the deformation by rectifying the grid lines (squares), therefore there is no deviations at all. We can understand this issue better by exporting the DXF drawing of the transformation. This DXF will in fact contain the rectified raster map. To do so, we click on the DXF drawing option in the Export box in CorrMap toolbar (1 on Fig. TR.G15) and we provide the MAP1_GRID.DXF as the DXF file name. As soon as the DXF file is successfully created, you get the message from which you can directly open it in your CAD software (2 on Fig. TR.G15).
Fig. TR.G15 – You can directly open the DXF drawing containing the calibrated map in the CAD software associated to the DXF files in your Windows installation.
Once we obtain the DXF drawing opened in the CAD system (Fig. TR.G16), we can see what we mean when we say that this transformation has removed map deformation. In fact, as shown in Fig. TR.G18, examining the coordinates of a grid point, we obtain the exact absolute values with no decimals, and examining the distance between two consecutive grid lines give us the exact value of 200 meters (Fig. TR.G17).
Fig. TR.G16 – The DXF drawing containing the transformed raster map.
Fig. TR.G17 – In the transformed map, grid line intervals are exactly 200 meters.
Fig. TR.G18 – In the transformed map, grid points now match their exact absolute coordinates.
At this stage you might think that, having the rectified raster map in the CAD software, you can pick up further map points directly on the DXF drawing. Well, this is incorrect. The reason is that there are two algorithms taking place in this transformation:
1.The first is the mathematical algorithm (explained in section Basic concepts | Grid) which calculates the numerical point coordinates shown in (the red box of Fig. TR.G14. These are the real coordinates that we have to use for completing our task.
2.The second is the procedure that rectifies the map which uses a particular algorithm to generate the new rectified raster. What does it mean? Let’s say that a grid square in the original (deformed) map is larger than 200 meters, this algorithm removes some pixels while generating the rectified raster. On the contrary, if the original grid square is smaller than 200, it adds some pixels. So, if you pick a point in the DXF at a position near where a pixel has been added or removed, you introduce an error of 25 cm. This is why map points have to always be inserted in the original raster map and calculated with CorrMap.
Of course the real information that you need to proceed with your task are the coordinates calculated by the first algorithm. In our example we can use these coordinates in order to trace the boundary back in the field. You can perform this task (calculating the tracing observation points) using some topographical software to link your survey to the map via the Control-points, i.e. the building corners retrieved from the map and actually surveyed in the field, and then calculate the tracing observations.
To let you complete these operations, CorrMap exports the calculated coordinates. To do so, simply click the Points option in the Export box of CorrMap’s toolbar (3 on Fig. TR.G15), you are asked what type of points you want to export: Control, Tracing or All. After confirming your choice with OK, CorrMap creates the coordinates MAP1_GRID.XY file listed here below (for all points). It’s just a normal text file CSV (comma separated values) that you can easily import in your topographical software.
Although this is not a CorrMap issue, we just want to give you an idea on how to complete this example of boundary reconstruction using some other topographical software (*) or by simply doing the calculations yourself.
The first step is to link the map and the real survey trough the Control-points, i.e. the building corners retrieved from the map (point 1-7 in CorrMap exported file here above) and actually surveyed in the field (Fig. TR.G2 and Fig. TR.G3 at the beginning of this section). This task is usually performed by calculating a roto-translation of the survey in order to port it to the map reference system. Fig. TR.G19 shows this calculation for a normal theodolite survey (the same steps can be also applied to GPS surveys). Here are the steps for this calculations:
1.The survey (station 100 and the 7 points) is calculated "locally", i.e. the first survey station is assumed as the origin of the reference system (coordinates of 100 are assumed E = 0.000 N = 0.000) and the field survey orientation (whatever it is) is assumed as the ordinate axis.
2.Having the two coordinates (survey and map) of the 7 Control-points, the survey is roto-translated to the map, i.e. all its points are recalculated as if they are in the map's reference system (columns East r. / North r. in Fig. TR.G19). The algorithm used for this calculation is the Barycentric transformation explained in section Basic concepts | Barycentric.
3.As a result of step 2, your surveyed station 100 (and of course all your other surveyed points) assumes the new map's coordinates (indicated by the red boxes in Fig. TR.G19). Please note that the roto-translation also gives you the errors of each control points (columns East e. / North e. in Fig. TR.G19). These values (residuals of the least squares calculation) are due to the abundance of control points and are quite useful because they indicate the reliability of each point. Therefore, if you find a high error for one or more of your control points, you can easily exclude these points from the calculation (remove the point and run the calculation again). Possible reasons of a high error are that the point has been incorrectly surveyed, or incorrectly inserted in the map, or else there is no correspondence between the map point and the one surveyed.
Fig. TR.G19 – The roto-translation of the survey on the map throughout the Control-points.
Well, once you have your survey in map's coordinates, it is easy to calculate the observation data in order to trace the boundary points back in the field. In fact, all you need to do is to calculate the polar coordinates (horizontal angle and distance of Fig. TR.G21) to the boundary points exported by CorrMap (Fig. TR.G20) (*).
Fig. TR.G20 – The boundary points exported by CorrMap.
Fig. TR.G21 – Finally the observation data to trace the boundary points back in the field.
Some types of map do not contain a closed drawing but their lines are extended towards the adjacent maps, as if the map itself was the result of trimming a larger one along the edges. Fig. TR.G22 shows an example. In this situation you cannot apply the Grid transformation to a point located outside the last grid line (the red circle in Fig. TR.G22) because it is not possible to define the grid square containing that point, since the next grid line lays on the other map. CorrMap solves this problem by extending the raster map and reproducing the missing grid line. This extension is based on the reasonable assumption that the deformation between the last two grid lines contained in the map (lines 1-3 and 2-4 in Fig. TR.G22) is maintained constant in the area external to the last grid line and in the adjacent map. You will understand this assumption better with a simple example.
So let's start a new CorrMap project as explained in section Basic Operations[****]| Starting a new project and select the MAP5.JPG file from the CorrMap samples folder (see section Getting started | Samples and demo version).
Fig. TR.G22 – A map which does not contain a closed drawing.
With reference to Fig. TR.G22, in this map we need to apply the Grid transformation to a point in the red circle. First of all we insert the 4 grid points of the last grid square entirely contained in our map, as explained in the previous section. After that, we click the Extend reference button on CorrMap Grid toolbar (2 in Fig. TR.G22), you will see the help window reproduced in Fig. TR.G23 showing the instructions on how to proceed.
Fig. TR.G23 – The instructions on how to extend the map.
So, following these instructions we move the mouse cursor over the grid point 1 until a small red square appears (snap) and we click on it. We'll see an elastic line starting from point 1. With this elastic line we then select grid point 2, the warning message of Fig. TR.G24 is shown. As you can see, this message tell us that the raster map is going to be enlarged by the program which will create a new raster and save the original one with a .Original extension. This means that the original raster will be renamed to MAP5.jpg.original, whereas the file MAP5.jpg will become the enlarged one.
Fig. TR.G24 – Before creating a new enlarged raster map, CorrMap saves the original one.
So, clicking Yes on the message, the enlarging process takes place and, since it could take some time, it is indicated by the bar shown in Fig. TR.G25. As shown in Fig. TR.G26, once the image resizing is finished, we'll see a new raster white area to the right side of the original map and the window suggesting the coordinates of the new grid point. CorrMap calculates these coordinates based on those of the two internal grid points previously clicked. In this case, the Northing remains unchanged, whereas the Easting is calculated by adding the grid lines interval to the Easting of point 2.
Fig. TR.G25 – The enlarging process of the original raster.
Fig. TR.G26 – The enlarged map and the proposed coordinates for the new external grid point.
Confirming the coordinates by clicking OK, we'll see the new grid point 5 appearing on the enlarged area, as you can see in Fig. TR.G27. All we have to do now is to repeat the same operations on grid points 3 and 4 in order to create the new external grid point 6. After that we have now recreated the normal condition for the Grid transformation, i.e. we have 4 grid points forming a square on which we can apply the algorithm explained in section Basic concepts | Grid. So, clicking the Transforming point button in CorrMap Grid toolbar (5 on Fig. TR.G1), we insert the desired point inside this new square (point 1 in a red circle in Fig. TR.G27) and finally we run the calculation by clicking the Calculate button on CorrMap’s Grid toolbar (2 on Fig. TR.G1) obtaining the real map coordinates of that point in the Transforming points table of the Output window, as shown in Fig. TR.G27.
Fig. TR.G27 – The transformed point belonging to the new extended grid square.