Advertisement
BobTheHunted

QGIS Transformation Matrix

Aug 24th, 2018
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. What values to use to transform and translate a polygonized raster layer to overlay TB heightfield
  2.  
  3. Raster Resolution: 4096px
  4. Heightfield Scale: 16,384m
  5. Cell Size: 4
  6.  
  7. Cell * Raster = Scale (at 1px/m)
  8. Scale รท Raster = Cell
  9.  
  10. To calculate the necessary scaling for the vector at 1px/m simply multiply the cell times the resolution of the raster (not the heightfield)
  11. For position, x + 200,000, and y + Heightfield Scale.
  12.  
  13. To check if it is aligned, import your heightfield (exported from TB) and apply transformation to the shapes. They should overlay properly.
  14.  
  15.  
  16. Parameters:
  17.  
  18. a: Scale X
  19. e: Scale Y
  20.  
  21. d: Rotation X
  22. b: Rotation Y
  23.  
  24. c: Translation X
  25. f: Translation Y
  26.  
  27. //////////////////////////////////////////
  28. // Transformation Matrix //
  29. // x = [a] x + [b] y + [c] //
  30. // y = [d] x + [e] y + [f] //
  31. //////////////////////////////////////////
  32.  
  33.  
  34. Calculations: (In This Order!)
  35.  
  36.  
  37. 16,384m heightfield with 4096 mask rasters:
  38.  
  39. Mirror-y: (Only if shapes if flipped)
  40.  
  41. e = -1.00000
  42.  
  43. (Everything else at default values)
  44.  
  45.  
  46. Scale + Position:
  47.  
  48. a = 4.00000
  49. e = 4.00000
  50. c = 200000.0
  51. f = 16384.0
  52.  
  53. (Everything else at default values)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement