Home » Software » PostGIS: Spatially enabled Relational Database Sytem » Affine Transformation Operations in PostGIS » Case Study: Fixing Bad TIGER Line data with R and PostGIS » Comparision with output from v.transform
Comparision with output from v.transform
First the output from R:
Looking at the residuals from the regression model used to map bad coordinates (x,y) to good coordinates (nx,ny):
## we made the linear model object 'l' above## extract as dataframe## residuals are computed for x and y separatelyr <- as.data.frame(resid(l)) ## compute vector product of the (x,y) residuals:c$resid <- sqrt(r$nx^2 + r$ny^2)print(c)X
x y nx ny resid1 -2078417 -14810.570 -2078314 -14838.378 46.6176002 -2078743 -16057.955 -2078636 -16081.790 62.0412743 -2077261 -16435.348 -2077170 -16463.156 40.9051324 -2076709 -14405.369 -2076606 -14433.177 29.4063995 -2074179 -15830.248 -2074084 -15901.558 33.1119816 -2073850 -15707.435 -2073763 -15798.554 37.3627367 -2073450 -13873.171 -2073359 -13920.712 21.6232358 -2072359 -15204.613 -2072276 -15323.138 38.9976789 -2072545 -14402.596 -2072450 -14513.219 32.91888910 -2072189 -16022.434 -2072098 -16129.106 33.83407411 -2071991 -16856.058 -2071928 -16942.976 6.27755412 -2068407 -12999.396 -2068296 -13133.170 6.57928513 -2069870 -12613.813 -2069764 -12731.848 2.35763114 -2067635 -13188.253 -2067517 -13337.765 11.60451915 -2066931 -13377.110 -2066809 -13518.753 22.71962516 -2067411 -15084.692 -2067313 -15190.924 41.90727317 -2066795 -18714.093 -2066741 -18846.019 14.54135818 -2066384 -17080.538 -2066299 -17212.464 26.71749519 -2068634 -19742.339 -2068580 -19835.464 27.48365420 -2053326 -16930.710 -2053276 -17226.351 65.74607421 -2051797 -17321.500 -2051899 -17579.762 227.51694422 -2068307 2826.921 -2068066 2638.276 12.58785323 -2067543 2648.205 -2067328 2449.631 37.72974724 -2067126 4276.510 -2066904 4081.246 46.77463025 -2066748 4170.604 -2066527 4001.816 59.50984326 -2066068 2292.295 -2065860 2094.699 46.68155327 -2065337 2107.872 -2065126 1900.397 43.38695628 -2064606 1913.570 -2064378 1692.922 26.46038929 -2064199 3558.561 -2063961 3356.401 47.74269630 -2037464 6512.455 -2037076 5864.398 50.76299431 -2036722 6825.682 -2036338 6199.227 22.69946732 -2036876 6366.642 -2036498 5742.888 22.12017633 -2040225 7150.180 -2039706 6575.029 161.63119934 -2041064 7144.779 -2040732 6569.629 26.65758235 -2044702 -15548.033 -2044564 -16024.903 23.84481736 -2043992 -15723.521 -2043824 -16223.282 48.06384037 -2043790 -14907.119 -2043611 -15383.990 34.84485138 -2040616 -14820.445 -2040453 -15349.974 21.19623339 -2039595 -15081.427 -2039485 -15588.263 47.263287X
The Root-Mean-Square-Error (RMSE) for the fitted transform (in meters) is:
The output from v.transform on the same set of control points:
Transformation Matrix| xoff a b || yoff d e |-------------------------------------------5301.399323 1.002469 0.009172-28155.882288 -0.013530 0.997547-------------------------------------------X
full output including the residuals:
CHECK MAP RESIDUALSCurrent Map New MapPOINT X coord Y coord | X coord Y coord | residuals1. -2078417.36 -14810.57 | -2078314.07 -14838.38 | 46.812. -2078743.11 -16057.95 | -2078635.85 -16081.79 | 62.223. -2077261.34 -16435.35 | -2077169.97 -16463.16 | 41.054. -2076709.16 -14405.37 | -2076605.87 -14433.18 | 29.595. -2074178.76 -15830.25 | -2074083.67 -15901.56 | 33.216. -2073849.93 -15707.44 | -2073762.78 -15798.55 | 37.427. -2073449.80 -13873.17 | -2073358.68 -13920.71 | 21.628. -2072358.86 -15204.61 | -2072275.89 -15323.14 | 39.029. -2072544.55 -14402.60 | -2072449.73 -14513.22 | 32.9710. -2072188.97 -16022.43 | -2072098.11 -16129.11 | 33.8711. -2071991.43 -16856.06 | -2071928.22 -16942.98 | 6.2712. -2068406.55 -12999.40 | -2068296.38 -13133.17 | 6.6013. -2069870.19 -12613.81 | -2069763.96 -12731.85 | 2.3314. -2067635.38 -13188.25 | -2067517.35 -13337.76 | 11.6315. -2066931.10 -13377.11 | -2066809.13 -13518.75 | 22.7416. -2067411.11 -15084.69 | -2067312.75 -15190.92 | 41.9317. -2066795.16 -18714.09 | -2066740.84 -18846.02 | 14.6418. -2066383.87 -17080.54 | -2066298.50 -17212.46 | 26.7419. -2068634.37 -19742.34 | -2068580.05 -19835.46 | 27.5320. -2053326.48 -16930.71 | -2053275.51 -17226.35 | 66.0921. -2051797.30 -17321.50 | -2051899.25 -17579.76 | 227.9122. -2068307.24 2826.92 | -2068065.64 2638.28 | 12.4123. -2067542.73 2648.21 | -2067327.61 2449.63 | 37.4424. -2067125.72 4276.51 | -2066903.98 4081.25 | 46.4025. -2066748.43 4170.60 | -2066526.69 4001.82 | 59.1226. -2066067.79 2292.29 | -2065860.31 2094.70 | 46.3527. -2065336.69 2107.87 | -2065125.92 1900.40 | 43.0728. -2064605.58 1913.57 | -2064378.35 1692.92 | 26.1629. -2064199.15 3558.56 | -2063961.13 3356.40 | 47.4330. -2037464.39 6512.45 | -2037075.56 5864.40 | 50.6631. -2036721.82 6825.68 | -2036338.39 6199.23 | 22.5432. -2036875.74 6366.64 | -2036497.71 5742.89 | 21.9533. -2040224.67 7150.18 | -2039706.23 6575.03 | 161.5434. -2041064.45 7144.78 | -2040732.32 6569.63 | 26.7435. -2044701.68 -15548.03 | -2044564.34 -16024.90 | 23.6436. -2043992.10 -15723.52 | -2043824.24 -16223.28 | 47.6037. -2043789.90 -14907.12 | -2043610.60 -15383.99 | 34.3538. -2040615.94 -14820.44 | -2040453.30 -15349.97 | 20.7739. -2039594.70 -15081.43 | -2039485.02 -15588.26 | 47.85Number of points: 39Residual mean average: 57.082951X
Software
- General Purpose Programming with Scripting Languages
- LaTeX Tips and Tricks
- PostGIS: Spatially enabled Relational Database Sytem
- PROJ: forward and reverse geographic projections
- GDAL and OGR: geodata conversion and re-projection tools
- R: advanced statistical package
- GRASS GIS: raster, vector, and imagery analysis
- Generic Mapping Tools: high quality map production