Wiki page
[Affine Transform] by
sandro
2015-05-02 01:11:07.
0000: 44 20 32 30 31 35 2d 30 35 2d 30 32 54 30 31 3a D 2015-05-02T01:
0010: 31 31 3a 30 37 2e 36 38 32 0a 4c 20 41 66 66 69 11:07.682.L Affi
0020: 6e 65 5c 73 54 72 61 6e 73 66 6f 72 6d 0a 55 20 ne\sTransform.U
0030: 73 61 6e 64 72 6f 0a 57 20 37 34 34 32 0a 3c 61 sandro.W 7442.<a
0040: 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 href="https://w
0050: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 ww.gaia-gis.it/f
0060: 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c ossil/libspatial
0070: 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e ite/wiki?name=4.
0080: 32 2e 30 2d 64 6f 63 22 3e 62 61 63 6b 3c 2f 61 2.0-doc">back</a
0090: 3e 0d 0a 3c 68 32 3e 41 66 66 69 6e 65 20 54 72 >..<h2>Affine Tr
00a0: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 73 3c 2f 68 ansformations</h
00b0: 32 3e 0d 0a 53 74 61 72 74 69 6e 67 20 73 69 6e 2>..Starting sin
00c0: 63 65 20 76 65 72 73 69 6f 6e 20 3c 62 3e 34 2e ce version <b>4.
00d0: 33 2e 30 3c 2f 62 3e 20 53 70 61 74 69 61 4c 69 3.0</b> SpatiaLi
00e0: 74 65 20 73 75 70 70 6f 72 74 73 20 73 65 76 65 te supports seve
00f0: 72 61 6c 20 6e 65 77 20 53 51 4c 20 66 75 6e 63 ral new SQL func
0100: 74 69 6f 6e 73 20 62 61 73 65 64 20 6f 6e 20 3c tions based on <
0110: 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 65 a href="http://e
0120: 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f n.wikipedia.org/
0130: 77 69 6b 69 2f 41 66 66 69 6e 65 5f 74 72 61 6e wiki/Affine_tran
0140: 73 66 6f 72 6d 61 74 69 6f 6e 22 3e 61 66 66 69 sformation">affi
0150: 6e 65 20 74 72 61 6e 73 66 6f 72 6d 61 74 69 6f ne transformatio
0160: 6e 3c 2f 61 3e 3b 20 75 6e 64 65 72 73 74 61 6e n</a>; understan
0170: 64 69 6e 67 20 74 68 65 20 75 6e 64 65 72 6c 61 ding the underla
0180: 79 69 6e 67 20 6d 61 74 68 65 6d 61 74 69 63 73 ying mathematics
0190: 20 63 6f 75 6c 64 20 65 61 73 69 6c 79 20 62 65 could easily be
01a0: 20 72 61 74 68 65 72 20 64 69 66 66 69 63 75 6c rather difficul
01b0: 74 20 69 66 20 79 6f 75 20 68 61 76 65 20 61 62 t if you have ab
01c0: 73 6f 6c 75 74 65 6c 79 20 6e 6f 20 66 61 6d 69 solutely no fami
01d0: 6c 69 61 72 69 74 79 20 77 69 74 68 20 74 68 69 liarity with thi
01e0: 73 20 6b 69 6e 64 20 6f 66 20 6f 70 65 72 61 7a s kind of operaz
01f0: 69 6f 6e 73 2e 3c 62 72 3e 0d 0a 53 6f 20 77 65 ions.<br>..So we
0200: 27 6c 6c 20 73 74 61 72 74 20 73 6d 6f 6f 74 68 'll start smooth
0210: 6c 79 20 62 79 20 69 6e 74 72 6f 64 75 63 69 6e ly by introducin
0220: 67 20 66 69 72 73 74 20 61 20 76 65 72 79 20 73 g first a very s
0230: 69 6d 70 6c 65 20 70 72 61 63 74 69 63 61 6c 20 imple practical
0240: 65 78 61 6d 70 6c 65 20 62 61 73 65 64 20 6f 6e example based on
0250: 20 6b 69 6e 64 20 6f 66 20 61 20 6a 6f 6b 65 20 kind of a joke
0260: 61 62 6f 75 74 20 74 68 65 20 67 65 6f 67 72 61 about the geogra
0270: 70 68 79 20 6f 66 20 49 74 61 6c 79 2e 0d 0a 3c phy of Italy...<
0280: 68 32 3e 46 61 6e 63 79 20 47 65 6f 67 72 61 70 h2>Fancy Geograp
0290: 79 20 61 6e 64 20 61 6d 75 73 69 6e 67 20 4d 61 y and amusing Ma
02a0: 74 68 3c 2f 68 32 3e 0d 0a 3c 74 61 62 6c 65 20 th</h2>..<table
02b0: 62 6f 72 64 65 72 3d 22 31 22 20 63 65 6c 6c 73 border="1" cells
02c0: 70 61 63 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70 pacing="4" cellp
02d0: 61 64 64 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 adding="8">..<tr
02e0: 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 50 72 65 66 61 ><td>..<h3>Prefa
02f0: 63 65 3c 2f 68 33 3e 0d 0a 4c 6f 6f 6b 69 6e 67 ce</h3>..Looking
0300: 20 74 6f 20 61 20 6d 61 70 20 6f 66 20 49 74 61 to a map of Ita
0310: 6c 79 20 69 74 20 61 70 70 65 61 72 73 20 6f 62 ly it appears ob
0320: 76 69 6f 75 73 20 61 74 20 66 69 72 73 74 20 67 vious at first g
0330: 6c 61 6e 63 65 20 74 68 61 74 20 53 69 63 69 6c lance that Sicil
0340: 79 20 69 73 20 6c 6f 63 61 74 65 64 20 69 6e 20 y is located in
0350: 61 20 76 65 72 79 20 69 6e 63 6f 6e 76 65 6e 69 a very inconveni
0360: 65 6e 74 20 70 6f 73 69 74 69 6f 6e 2e 3c 62 72 ent position.<br
0370: 3e 0d 0a 49 74 27 73 20 64 61 6e 67 65 72 6f 75 >..It's dangerou
0380: 73 6c 79 20 63 6c 6f 73 65 20 74 6f 20 6e 6f 72 sly close to nor
0390: 74 68 20 61 66 72 69 63 61 6e 20 73 68 6f 72 65 th african shore
03a0: 73 20 61 6e 64 20 74 68 65 20 3c 61 20 68 72 65 s and the <a hre
03b0: 66 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e 77 69 6b f="http://en.wik
03c0: 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f ipedia.org/wiki/
03d0: 53 74 72 61 69 74 5f 6f 66 5f 4d 65 73 73 69 6e Strait_of_Messin
03e0: 61 22 3e 53 74 72 61 69 74 20 6f 66 20 4d 65 73 a">Strait of Mes
03f0: 73 69 6e 61 3c 2f 61 3e 20 69 73 20 65 78 61 67 sina</a> is exag
0400: 67 65 72 61 74 65 64 6c 79 20 6e 61 72 72 6f 77 geratedly narrow
0410: 2c 20 74 68 75 73 20 63 61 75 73 69 6e 67 20 6d , thus causing m
0420: 61 6e 79 20 74 72 6f 75 62 6c 65 73 20 61 6e 64 any troubles and
0430: 20 73 65 76 65 72 65 20 73 65 63 75 72 69 74 79 severe security
0440: 20 72 69 73 6b 73 20 74 6f 20 74 68 65 20 6e 61 risks to the na
0450: 76 69 67 61 74 69 6f 6e 20 6f 66 20 63 61 70 69 vigation of capi
0460: 74 61 6c 20 73 68 69 70 73 2e 3c 62 72 3e 0d 0a tal ships.<br>..
0470: 45 76 65 6e 20 77 6f 72 73 74 2c 20 66 72 6f 6d Even worst, from
0480: 20 74 69 6d 65 20 74 6f 20 74 69 6d 65 20 73 6f time to time so
0490: 6d 65 20 63 72 61 7a 79 20 70 6f 6c 69 74 69 63 me crazy politic
04a0: 69 61 6e 20 73 74 72 6f 6e 67 6c 79 20 61 64 76 ian strongly adv
04b0: 6f 63 61 74 65 73 20 74 68 65 20 76 65 72 79 20 ocates the very
04c0: 73 74 75 70 69 64 20 69 64 65 61 20 74 6f 20 62 stupid idea to b
04d0: 75 69 6c 64 20 61 6e 20 69 6e 63 72 65 64 69 62 uild an incredib
04e0: 6c 79 20 63 6f 73 74 6c 79 20 3c 61 20 68 72 65 ly costly <a hre
04f0: 66 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e 77 69 6b f="http://en.wik
0500: 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f ipedia.org/wiki/
0510: 53 74 72 61 69 74 5f 6f 66 5f 4d 65 73 73 69 6e Strait_of_Messin
0520: 61 5f 42 72 69 64 67 65 22 3e 62 72 69 64 67 65 a_Bridge">bridge
0530: 20 63 72 6f 73 73 69 6e 67 20 74 68 65 20 53 74 crossing the St
0540: 72 61 69 74 3c 2f 61 3e 20 6f 76 65 72 6c 6f 6f rait</a> overloo
0550: 6b 69 6e 67 20 74 68 65 20 76 65 72 79 20 68 69 king the very hi
0560: 67 68 20 73 65 69 73 6d 69 63 61 6c 20 72 69 73 gh seismical ris
0570: 6b 20 6f 66 20 74 68 69 73 20 64 69 73 74 72 69 k of this distri
0580: 63 74 20 61 6e 64 20 70 75 72 70 6f 73 65 6c 79 ct and purposely
0590: 20 69 67 6e 6f 72 69 6e 67 20 74 68 61 74 20 69 ignoring that i
05a0: 6e 20 31 39 30 38 20 62 6f 74 68 20 74 6f 77 6e n 1908 both town
05b0: 73 20 6f 66 20 3c 61 20 68 72 65 66 3d 22 68 74 s of <a href="ht
05c0: 74 70 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 tp://en.wikipedi
05d0: 61 2e 6f 72 67 2f 77 69 6b 69 2f 31 39 30 38 5f a.org/wiki/1908_
05e0: 4d 65 73 73 69 6e 61 5f 65 61 72 74 68 71 75 61 Messina_earthqua
05f0: 6b 65 22 3e 4d 65 73 73 69 6e 61 20 61 6e 64 20 ke">Messina and
0600: 52 65 67 67 69 6f 20 43 61 6c 61 62 72 69 61 3c Reggio Calabria<
0610: 2f 61 3e 20 77 65 72 65 20 63 6f 6d 70 6c 65 74 /a> were complet
0620: 65 6c 79 20 64 65 73 74 72 6f 79 65 64 20 62 79 ely destroyed by
0630: 20 61 6e 20 65 61 72 74 68 71 75 61 6b 65 20 66 an earthquake f
0640: 6f 6c 6c 6f 77 65 64 20 62 79 20 61 20 74 73 75 ollowed by a tsu
0650: 6e 61 6d 69 20 6b 69 6c 6c 69 6e 67 20 6d 6f 72 nami killing mor
0660: 65 20 74 68 61 6e 20 31 30 30 2c 30 30 30 20 70 e than 100,000 p
0670: 65 6f 70 6c 65 73 2c 20 6f 6e 65 20 6f 66 20 74 eoples, one of t
0680: 68 65 20 6d 6f 73 74 20 66 72 69 67 68 74 65 6e he most frighten
0690: 69 6e 67 20 6e 61 74 75 72 61 6c 20 64 69 73 61 ing natural disa
06a0: 73 74 65 72 73 20 72 65 67 69 73 74 65 72 65 64 sters registered
06b0: 20 69 6e 20 45 75 72 6f 70 65 20 64 75 72 69 6e in Europe durin
06c0: 67 20 6d 6f 64 65 72 6e 20 74 69 6d 65 73 2e 3c g modern times.<
06d0: 62 72 3e 3c 62 72 3e 0d 0a 53 6f 20 77 65 27 6c br><br>..So we'l
06e0: 6c 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 73 74 l immediately st
06f0: 61 72 74 20 61 20 63 61 73 65 20 73 74 75 64 79 art a case study
0700: 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 69 64 65 intended to ide
0710: 6e 74 69 66 79 20 61 20 70 6f 73 73 69 62 6c 65 ntify a possible
0720: 20 61 6c 74 65 72 6e 61 74 69 76 65 20 6c 6f 63 alternative loc
0730: 61 74 69 6f 6e 20 66 6f 72 20 53 69 63 69 6c 79 ation for Sicily
0740: 2e 3c 62 72 3e 0d 0a 49 6e 63 69 64 65 6e 74 61 .<br>..Incidenta
0750: 6c 6c 79 20 77 65 27 6c 6c 20 75 73 65 20 74 68 lly we'll use th
0760: 65 20 6e 65 77 20 53 51 4c 20 66 75 6e 63 74 69 e new SQL functi
0770: 6f 6e 73 20 62 61 73 65 64 20 6f 6e 20 41 66 66 ons based on Aff
0780: 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 ine Transformati
0790: 6f 6e 73 20 66 6f 72 20 74 68 69 73 20 74 61 73 ons for this tas
07a0: 6b 2e 3c 62 72 3e 0d 0a 4c 65 74 27 73 20 67 6f k.<br>..Let's go
07b0: 20 6f 6e 2e 20 20 0d 0a 3c 2f 74 64 3e 3c 74 64 on. ..</td><td
07c0: 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 >..<img src="htt
07d0: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
07e0: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 61 s.it/gaia-sins/a
07f0: 66 66 69 6e 65 2d 70 69 63 73 2f 73 69 63 69 6c ffine-pics/sicil
0800: 79 5f 30 2e 70 6e 67 22 20 61 6c 74 3d 22 77 66 y_0.png" alt="wf
0810: 73 2d 31 22 20 62 6f 72 64 65 72 3d 22 31 22 3e s-1" border="1">
0820: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 ..</td></tr>..<t
0830: 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 53 74 65 70 r><td>..<h3>Step
0840: 20 23 31 3a 20 74 72 61 6e 73 6c 61 74 69 6e 67 #1: translating
0850: 20 53 69 63 69 6c 79 20 69 6e 74 6f 20 61 20 6d Sicily into a m
0860: 6f 72 65 20 63 6f 6e 76 65 6e 69 65 6e 74 20 70 ore convenient p
0870: 6f 73 69 74 69 6f 6e 3c 2f 68 33 3e 0d 0a 54 68 osition</h3>..Th
0880: 65 72 65 20 69 73 20 70 6c 65 6e 74 79 20 6f 66 ere is plenty of
0890: 20 75 6e 75 73 65 64 20 66 72 65 65 20 72 6f 6f unused free roo
08a0: 6d 20 69 6e 20 74 68 65 20 6c 6f 77 65 72 20 54 m in the lower T
08b0: 79 72 72 68 65 6e 69 61 6e 20 53 65 61 2c 20 73 yrrhenian Sea, s
08c0: 6f 20 77 65 20 73 74 61 72 74 20 62 79 20 61 70 o we start by ap
08d0: 70 6c 79 69 6e 67 20 61 20 3c 61 20 68 72 65 66 plying a <a href
08e0: 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e 77 69 6b 69 ="http://en.wiki
08f0: 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 54 pedia.org/wiki/T
0900: 72 61 6e 73 6c 61 74 69 6f 6e 5f 25 32 38 67 65 ranslation_%28ge
0910: 6f 6d 65 74 72 79 25 32 39 22 3e 74 72 61 6e 73 ometry%29">trans
0920: 6c 61 74 69 6f 6e 3c 2f 61 3e 3a 20 74 68 69 73 lation</a>: this
0930: 20 70 72 61 63 74 69 63 61 6c 6c 79 20 6d 65 61 practically mea
0940: 6e 73 20 61 64 64 69 6e 67 20 28 6f 72 20 73 75 ns adding (or su
0950: 62 63 74 72 61 63 74 69 6e 67 29 20 61 20 63 6f bctracting) a co
0960: 6e 73 74 61 6e 74 20 76 61 6c 75 65 20 74 6f 20 nstant value to
0970: 74 68 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 the coordinates
0980: 6f 6e 20 62 6f 74 68 20 3c 62 3e 78 3c 2f 62 3e on both <b>x</b>
0990: 20 61 6e 64 20 3c 62 3e 79 3c 2f 62 3e 20 61 78 and <b>y</b> ax
09a0: 65 73 2e 3c 62 72 3e 0d 0a 41 66 74 65 72 20 61 es.<br>..After a
09b0: 20 76 65 72 79 20 71 75 69 63 6b 20 65 78 61 6d very quick exam
09c0: 69 6e 61 74 69 6f 6e 20 67 6f 69 6e 67 20 3c 62 ination going <b
09d0: 3e 31 35 30 20 6b 6d 3c 2f 62 3e 20 77 65 73 74 >150 km</b> west
09e0: 65 77 61 72 64 73 20 61 6e 64 20 3c 62 3e 31 35 ewards and <b>15
09f0: 30 20 6b 6d 3c 2f 62 3e 20 6e 6f 72 74 68 77 61 0 km</b> northwa
0a00: 72 64 73 20 73 65 65 6d 73 20 74 6f 20 62 65 20 rds seems to be
0a10: 61 6e 20 61 62 73 6f 6c 75 74 65 6c 79 20 72 65 an absolutely re
0a20: 61 73 6f 6e 61 62 6c 65 20 63 68 6f 69 63 65 2e asonable choice.
0a30: 3c 62 72 3e 0d 0a 53 6f 20 75 73 69 6e 67 20 74 <br>..So using t
0a40: 68 65 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 he Affine Transf
0a50: 6f 72 6d 61 74 69 6f 6e 20 53 51 4c 20 66 75 6e ormation SQL fun
0a60: 63 74 69 6f 6e 73 20 77 65 27 6c 6c 20 77 72 69 ctions we'll wri
0a70: 74 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 te the following
0a80: 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 3a 0d SQL statement:.
0a90: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 43 52 45 .<verbatim>..CRE
0aa0: 41 54 45 20 54 41 42 4c 45 20 73 69 63 69 6c 69 ATE TABLE sicili
0ab0: 61 5f 31 20 41 53 0d 0a 53 45 4c 45 43 54 20 63 a_1 AS..SELECT c
0ac0: 6f 64 5f 72 65 67 2c 20 0d 0a 20 20 20 41 54 4d od_reg, .. ATM
0ad0: 5f 54 72 61 6e 73 66 6f 72 6d 28 67 65 6f 6d 65 _Transform(geome
0ae0: 74 72 79 2c 0d 0a 20 20 20 20 20 20 41 54 4d 5f try,.. ATM_
0af0: 43 72 65 61 74 65 54 72 61 6e 73 6c 61 74 65 28 CreateTranslate(
0b00: 2d 31 35 30 30 30 30 2c 20 31 35 30 30 30 30 29 -150000, 150000)
0b10: 29 20 41 53 20 67 65 6f 6d 0d 0a 46 52 4f 4d 20 ) AS geom..FROM
0b20: 73 69 63 69 6c 69 61 5f 30 3b 0d 0a 53 45 4c 45 sicilia_0;..SELE
0b30: 43 54 20 52 65 63 6f 76 65 72 47 65 6f 6d 65 74 CT RecoverGeomet
0b40: 72 79 43 6f 6c 75 6d 6e 28 27 73 69 63 69 6c 69 ryColumn('sicili
0b50: 61 5f 31 27 2c 20 27 67 65 6f 6d 27 2c 20 33 32 a_1', 'geom', 32
0b60: 36 33 32 2c 20 27 4d 55 4c 54 49 50 4f 4c 59 47 632, 'MULTIPOLYG
0b70: 4f 4e 27 2c 20 27 58 59 27 29 3b 0d 0a 3c 2f 76 ON', 'XY');..</v
0b80: 65 72 62 61 74 69 6d 3e 20 0d 0a 3c 2f 74 64 3e erbatim> ..</td>
0b90: 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 <td>..<img src="
0ba0: 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 https://www.gaia
0bb0: 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e -gis.it/gaia-sin
0bc0: 73 2f 61 66 66 69 6e 65 2d 70 69 63 73 2f 73 69 s/affine-pics/si
0bd0: 63 69 6c 79 5f 31 2e 70 6e 67 22 20 61 6c 74 3d cily_1.png" alt=
0be0: 22 77 66 73 2d 31 22 20 62 6f 72 64 65 72 3d 22 "wfs-1" border="
0bf0: 31 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 1">..</td></tr>.
0c00: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 53 .<tr><td>..<h3>S
0c10: 74 65 70 20 23 32 3a 20 72 6f 74 61 74 69 6e 67 tep #2: rotating
0c20: 20 53 69 63 69 6c 79 20 73 6f 20 74 6f 20 67 65 Sicily so to ge
0c30: 74 20 61 20 6e 69 63 65 20 68 6f 72 69 7a 6f 6e t a nice horizon
0c40: 74 61 6c 20 61 6c 69 67 6e 65 6d 65 6e 74 3c 2f tal alignement</
0c50: 68 33 3e 0d 0a 41 6c 69 67 6e 69 6e 67 20 74 68 h3>..Aligning th
0c60: 65 20 73 6f 75 74 68 65 72 6e 20 73 68 6f 72 65 e southern shore
0c70: 73 20 6f 66 20 53 69 63 69 6c 79 20 74 6f 20 61 s of Sicily to a
0c80: 6e 20 61 6c 6d 6f 73 74 20 68 6f 72 69 7a 6f 6e n almost horizon
0c90: 74 61 6c 20 6c 69 6e 65 20 77 69 6c 6c 20 73 75 tal line will su
0ca0: 72 65 6c 79 20 6c 65 61 64 20 74 6f 20 61 20 6d rely lead to a m
0cb0: 6f 72 65 20 6e 69 63 65 6c 79 20 6f 72 64 65 72 ore nicely order
0cc0: 65 64 20 6c 61 79 6f 75 74 3a 20 73 6f 20 77 65 ed layout: so we
0cd0: 20 68 61 76 65 20 6e 6f 77 20 74 6f 20 61 70 70 have now to app
0ce0: 6c 79 20 61 20 3c 61 20 68 72 65 66 3d 22 68 74 ly a <a href="ht
0cf0: 74 70 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 tp://en.wikipedi
0d00: 61 2e 6f 72 67 2f 77 69 6b 69 2f 52 6f 74 61 74 a.org/wiki/Rotat
0d10: 69 6f 6e 5f 25 32 38 6d 61 74 68 65 6d 61 74 69 ion_%28mathemati
0d20: 63 73 25 32 39 22 3e 63 6f 75 6e 74 65 72 63 6c cs%29">countercl
0d30: 6f 63 6b 77 69 73 65 20 72 6f 74 61 74 69 6f 6e ockwise rotation
0d40: 3c 2f 61 3e 20 6f 66 20 61 62 6f 75 74 20 3c 62 </a> of about <b
0d50: 3e 32 35 2e 30 20 64 65 67 72 65 65 73 3c 2f 62 >25.0 degrees</b
0d60: 3e 2e 3c 62 72 3e 0d 0a 54 68 61 6e 6b 73 20 74 >.<br>..Thanks t
0d70: 6f 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f o Affine Transfo
0d80: 72 6d 61 74 69 6f 6e 73 2c 20 77 65 20 63 61 6e rmations, we can
0d90: 20 63 6f 6d 62 69 6e 65 20 62 6f 74 68 20 74 68 combine both th
0da0: 65 20 70 72 65 76 69 6f 75 73 20 74 72 61 6e 73 e previous trans
0db0: 6c 61 74 69 6f 6e 20 61 6e 64 20 74 68 65 20 63 lation and the c
0dc0: 75 72 72 65 6e 74 20 72 6f 74 61 74 69 6f 6e 20 urrent rotation
0dd0: 69 6e 74 6f 20 61 20 73 69 6e 67 6c 65 20 6d 6f into a single mo
0de0: 76 65 6d 65 6e 74 65 20 28 61 20 73 6f 20 63 61 vemente (a so ca
0df0: 6c 6c 65 64 20 3c 62 3e 72 6f 74 6f 74 72 61 6e lled <b>rototran
0e00: 73 6c 61 74 69 6f 6e 3c 2f 62 3e 29 2e 3c 62 72 slation</b>).<br
0e10: 3e 0d 0a 57 65 20 73 69 6d 70 6c 79 20 68 61 76 >..We simply hav
0e20: 65 20 74 6f 20 65 78 65 63 75 74 65 20 74 68 65 e to execute the
0e30: 20 66 6f 6c 6c 6f 77 69 6e 67 20 53 51 4c 20 73 following SQL s
0e40: 74 61 74 65 6d 65 6e 74 3a 0d 0a 3c 76 65 72 62 tatement:..<verb
0e50: 61 74 69 6d 3e 43 52 45 41 54 45 20 54 41 42 4c atim>CREATE TABL
0e60: 45 20 73 69 63 69 6c 69 61 5f 32 20 41 53 0d 0a E sicilia_2 AS..
0e70: 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 SELECT cod_reg,
0e80: 0d 0a 20 20 20 41 54 4d 5f 54 72 61 6e 73 66 6f .. ATM_Transfo
0e90: 72 6d 28 67 65 6f 6d 65 74 72 79 2c 0d 0a 20 20 rm(geometry,..
0ea0: 20 20 20 20 41 54 4d 5f 54 72 61 6e 73 6c 61 74 ATM_Translat
0eb0: 65 28 2d 31 35 30 30 30 30 2c 20 31 35 30 30 30 e(-150000, 15000
0ec0: 30 2c 0d 0a 20 20 20 20 20 20 20 20 20 41 54 4d 0,.. ATM
0ed0: 5f 54 72 61 6e 73 6c 61 74 65 28 63 78 2c 20 63 _Translate(cx, c
0ee0: 79 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 y,..
0ef0: 41 54 4d 5f 52 6f 74 61 74 65 28 32 35 2c 0d 0a ATM_Rotate(25,..
0f00: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 A
0f10: 54 4d 5f 43 72 65 61 74 65 54 72 61 6e 73 6c 61 TM_CreateTransla
0f20: 74 65 28 2d 63 78 2c 20 2d 63 79 29 29 29 29 29 te(-cx, -cy)))))
0f30: 20 41 53 20 67 65 6f 6d 0d 0a 46 52 4f 4d 20 28 AS geom..FROM (
0f40: 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 SELECT cod_reg,
0f50: 53 54 5f 58 28 63 65 6e 74 72 6f 69 64 29 20 41 ST_X(centroid) A
0f60: 53 20 63 78 2c 20 53 54 5f 59 28 63 65 6e 74 72 S cx, ST_Y(centr
0f70: 6f 69 64 29 20 41 53 20 63 79 2c 20 67 65 6f 6d oid) AS cy, geom
0f80: 65 74 72 79 0d 0a 20 20 20 20 20 20 46 52 4f 4d etry.. FROM
0f90: 20 28 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 (SELECT cod_reg
0fa0: 2c 20 53 54 5f 43 65 6e 74 72 6f 69 64 28 67 65 , ST_Centroid(ge
0fb0: 6f 6d 65 74 72 79 29 20 41 53 20 63 65 6e 74 72 ometry) AS centr
0fc0: 6f 69 64 2c 20 67 65 6f 6d 65 74 72 79 20 0d 0a oid, geometry ..
0fd0: 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d FROM
0fe0: 20 73 69 63 69 6c 69 61 5f 30 29 20 41 53 20 67 sicilia_0) AS g
0ff0: 31 0d 0a 29 20 41 53 20 67 32 3b 0d 0a 53 45 4c 1..) AS g2;..SEL
1000: 45 43 54 20 52 65 63 6f 76 65 72 47 65 6f 6d 65 ECT RecoverGeome
1010: 74 72 79 43 6f 6c 75 6d 6e 28 27 73 69 63 69 6c tryColumn('sicil
1020: 69 61 5f 32 27 2c 20 27 67 65 6f 6d 27 2c 20 33 ia_2', 'geom', 3
1030: 32 36 33 32 2c 20 27 4d 55 4c 54 49 50 4f 4c 59 2632, 'MULTIPOLY
1040: 47 4f 4e 27 2c 20 27 58 59 27 29 3b 0d 0a 3c 2f GON', 'XY');..</
1050: 76 65 72 62 61 74 69 6d 3e 20 0d 0a 3c 2f 74 64 verbatim> ..</td
1060: 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d ><td>..<img src=
1070: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 "https://www.gai
1080: 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 a-gis.it/gaia-si
1090: 6e 73 2f 61 66 66 69 6e 65 2d 70 69 63 73 2f 73 ns/affine-pics/s
10a0: 69 63 69 6c 79 5f 32 2e 70 6e 67 22 20 61 6c 74 icily_2.png" alt
10b0: 3d 22 77 66 73 2d 31 22 20 62 6f 72 64 65 72 3d ="wfs-1" border=
10c0: 22 31 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e "1">..</td></tr>
10d0: 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e ..<tr><td>..<h3>
10e0: 53 74 65 70 20 23 33 3a 20 69 6e 66 6c 61 74 69 Step #3: inflati
10f0: 6e 67 20 61 6e 64 20 72 65 73 68 61 70 69 6e 67 ng and reshaping
1100: 20 53 69 63 69 6c 79 3c 2f 68 33 3e 0d 0a 41 6e Sicily</h3>..An
1110: 20 69 6e 63 72 65 61 73 65 64 20 73 75 72 66 61 increased surfa
1120: 63 65 20 69 73 20 73 75 72 65 6c 79 20 77 65 6c ce is surely wel
1130: 63 6f 6d 65 2c 20 62 65 63 61 75 73 65 20 77 69 come, because wi
1140: 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 ll automatically
1150: 20 69 6d 70 6c 79 20 6d 6f 72 65 20 63 75 6c 74 imply more cult
1160: 69 76 61 62 6c 65 20 6c 61 6e 64 73 2c 20 74 68 ivable lands, th
1170: 75 73 20 63 65 72 74 61 6e 6c 79 20 69 6d 70 65 us certanly impe
1180: 6c 6c 69 6e 67 20 61 20 73 74 72 6f 6e 67 20 70 lling a strong p
1190: 72 6f 64 75 63 74 69 76 69 74 79 20 62 6f 6f 73 roductivity boos
11a0: 74 20 74 6f 20 74 68 65 20 73 69 63 69 6c 69 61 t to the sicilia
11b0: 6e 20 61 67 72 69 63 6f 6c 74 75 72 65 3a 20 6f n agricolture: o
11c0: 6e 20 74 68 65 20 6f 74 68 65 72 20 68 61 6e 64 n the other hand
11d0: 20 73 68 6f 72 74 65 6e 69 6e 67 20 61 20 6c 69 shortening a li
11e0: 74 74 6c 65 20 62 69 74 20 74 68 65 20 6c 65 6e ttle bit the len
11f0: 67 74 68 20 6f 66 20 74 68 65 20 73 6f 75 74 68 gth of the south
1200: 65 72 6e 20 63 6f 61 73 74 6c 69 6e 65 20 77 69 ern coastline wi
1210: 6c 6c 20 73 75 72 65 6c 79 20 66 61 63 69 6c 69 ll surely facili
1220: 74 61 74 65 20 6d 6f 62 69 6c 69 74 79 20 61 6e tate mobility an
1230: 64 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 73 d communications
1240: 2e 3c 62 72 3e 0d 0a 53 6f 20 77 65 27 6c 6c 20 .<br>..So we'll
1250: 6e 6f 77 20 61 70 70 6c 79 20 61 20 3c 61 20 68 now apply a <a h
1260: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e 77 ref="http://en.w
1270: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b ikipedia.org/wik
1280: 69 2f 53 63 61 6c 69 6e 67 5f 25 32 38 67 65 6f i/Scaling_%28geo
1290: 6d 65 74 72 79 25 32 39 22 3e 73 63 61 6c 69 6e metry%29">scalin
12a0: 67 3c 2f 61 3e 20 74 72 61 6e 73 66 6f 72 6d 61 g</a> transforma
12b0: 74 69 6f 6e 20 75 73 69 6e 67 20 74 77 6f 20 64 tion using two d
12c0: 69 66 66 65 72 65 6e 74 20 76 61 6c 75 65 73 3a ifferent values:
12d0: 20 3c 62 3e 73 78 3d 30 2e 39 3c 2f 62 3e 20 61 <b>sx=0.9</b> a
12e0: 6e 64 20 3c 62 3e 73 79 3d 31 2e 33 3c 2f 62 3e nd <b>sy=1.3</b>
12f0: 2e 3c 62 72 3e 0d 0a 4f 6e 63 65 20 61 67 61 69 .<br>..Once agai
1300: 6e 2c 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 n, Affine Transf
1310: 6f 72 6d 61 74 69 6f 6e 73 20 65 6e 61 62 6c 65 ormations enable
1320: 20 75 73 20 74 6f 20 63 6f 6d 62 69 6e 65 20 61 us to combine a
1330: 6c 74 6f 67 65 74 68 65 72 20 62 6f 74 68 20 74 ltogether both t
1340: 72 61 6e 73 6c 61 74 65 2c 20 72 6f 74 61 74 65 ranslate, rotate
1350: 20 61 6e 64 20 73 63 61 6c 65 20 69 6e 74 6f 20 and scale into
1360: 61 20 73 69 6e 67 6c 65 20 74 72 61 6e 73 66 6f a single transfo
1370: 72 6d 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 54 68 rmation.<br>..Th
1380: 69 73 20 69 73 20 74 68 65 20 63 6f 72 72 65 73 is is the corres
1390: 70 6f 6e 64 69 6e 67 20 53 51 4c 20 73 74 61 74 ponding SQL stat
13a0: 65 6d 65 6e 74 3a 0d 0a 3c 76 65 72 62 61 74 69 ement:..<verbati
13b0: 6d 3e 43 52 45 41 54 45 20 54 41 42 4c 45 20 73 m>CREATE TABLE s
13c0: 69 63 69 6c 69 61 5f 32 20 41 53 0d 0a 43 52 45 icilia_2 AS..CRE
13d0: 41 54 45 20 54 41 42 4c 45 20 73 69 63 69 6c 69 ATE TABLE sicili
13e0: 61 5f 33 20 41 53 0d 0a 53 45 4c 45 43 54 20 63 a_3 AS..SELECT c
13f0: 6f 64 5f 72 65 67 2c 20 0d 0a 20 20 20 41 54 4d od_reg, .. ATM
1400: 5f 54 72 61 6e 73 66 6f 72 6d 28 67 65 6f 6d 65 _Transform(geome
1410: 74 72 79 2c 0d 0a 20 20 20 20 20 20 41 54 4d 5f try,.. ATM_
1420: 54 72 61 6e 73 6c 61 74 65 28 2d 31 35 30 30 30 Translate(-15000
1430: 30 2c 20 31 35 30 30 30 30 2c 0d 0a 20 20 20 20 0, 150000,..
1440: 20 20 20 20 20 41 54 4d 5f 54 72 61 6e 73 6c 61 ATM_Transla
1450: 74 65 28 63 78 2c 20 63 79 2c 0d 0a 20 20 20 20 te(cx, cy,..
1460: 20 20 20 20 20 20 20 20 41 54 4d 5f 53 63 61 6c ATM_Scal
1470: 65 28 30 2e 39 2c 20 31 2e 33 2c 0d 0a 20 20 20 e(0.9, 1.3,..
1480: 20 20 20 20 20 20 20 20 20 20 20 20 41 54 4d 5f ATM_
1490: 52 6f 74 61 74 65 28 32 35 2c 0d 0a 20 20 20 20 Rotate(25,..
14a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 54 AT
14b0: 4d 5f 43 72 65 61 74 65 54 72 61 6e 73 6c 61 74 M_CreateTranslat
14c0: 65 28 2d 63 78 2c 20 2d 63 79 29 29 29 29 29 29 e(-cx, -cy))))))
14d0: 20 41 53 20 67 65 6f 6d 0d 0a 46 52 4f 4d 20 28 AS geom..FROM (
14e0: 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 SELECT cod_reg,
14f0: 53 54 5f 58 28 63 65 6e 74 72 6f 69 64 29 20 41 ST_X(centroid) A
1500: 53 20 63 78 2c 20 53 54 5f 59 28 63 65 6e 74 72 S cx, ST_Y(centr
1510: 6f 69 64 29 20 41 53 20 63 79 2c 20 67 65 6f 6d oid) AS cy, geom
1520: 65 74 72 79 0d 0a 20 20 20 20 20 20 46 52 4f 4d etry.. FROM
1530: 20 28 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 (SELECT cod_reg
1540: 2c 20 53 54 5f 43 65 6e 74 72 6f 69 64 28 67 65 , ST_Centroid(ge
1550: 6f 6d 65 74 72 79 29 20 41 53 20 63 65 6e 74 72 ometry) AS centr
1560: 6f 69 64 2c 20 67 65 6f 6d 65 74 72 79 20 0d 0a oid, geometry ..
1570: 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d FROM
1580: 20 73 69 63 69 6c 69 61 5f 30 29 20 41 53 20 67 sicilia_0) AS g
1590: 31 0d 0a 29 20 41 53 20 67 32 3b 0d 0a 53 45 4c 1..) AS g2;..SEL
15a0: 45 43 54 20 52 65 63 6f 76 65 72 47 65 6f 6d 65 ECT RecoverGeome
15b0: 74 72 79 43 6f 6c 75 6d 6e 28 27 73 69 63 69 6c tryColumn('sicil
15c0: 69 61 5f 33 27 2c 20 27 67 65 6f 6d 27 2c 20 33 ia_3', 'geom', 3
15d0: 32 36 33 32 2c 20 27 4d 55 4c 54 49 50 4f 4c 59 2632, 'MULTIPOLY
15e0: 47 4f 4e 27 2c 20 27 58 59 27 29 3b 0d 0a 3c 2f GON', 'XY');..</
15f0: 76 65 72 62 61 74 69 6d 3e 20 0d 0a 3c 2f 74 64 verbatim> ..</td
1600: 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d ><td>..<img src=
1610: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 "https://www.gai
1620: 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 a-gis.it/gaia-si
1630: 6e 73 2f 61 66 66 69 6e 65 2d 70 69 63 73 2f 73 ns/affine-pics/s
1640: 69 63 69 6c 79 5f 33 2e 70 6e 67 22 20 61 6c 74 icily_3.png" alt
1650: 3d 22 77 66 73 2d 31 22 20 62 6f 72 64 65 72 3d ="wfs-1" border=
1660: 22 31 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e "1">..</td></tr>
1670: 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e ..<tr><td>..<h3>
1680: 53 74 65 70 20 23 34 3a 20 66 69 6e 61 6c 20 74 Step #4: final t
1690: 6f 75 63 68 3a 20 72 65 66 6c 65 63 74 69 6e 67 ouch: reflecting
16a0: 20 53 69 63 69 6c 79 3c 2f 68 33 3e 0d 0a 41 6e Sicily</h3>..An
16b0: 20 69 6e 63 72 65 61 73 65 64 20 73 75 72 66 61 increased surfa
16c0: 63 65 20 69 73 20 73 75 72 65 6c 79 20 77 65 6c ce is surely wel
16d0: 63 6f 6d 65 2c 20 62 65 63 61 75 73 65 20 77 69 come, because wi
16e0: 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 ll automatically
16f0: 20 69 6d 70 6c 79 20 6d 6f 72 65 20 63 75 6c 74 imply more cult
1700: 69 76 61 62 6c 65 20 6c 61 6e 64 73 2c 20 74 68 ivable lands, th
1710: 75 73 20 63 65 72 74 61 6e 6c 79 20 69 6d 70 65 us certanly impe
1720: 6c 6c 69 6e 67 20 61 20 73 74 72 6f 6e 67 20 70 lling a strong p
1730: 72 6f 64 75 63 74 69 76 69 74 79 20 62 6f 6f 73 roductivity boos
1740: 74 20 74 6f 20 74 68 65 20 73 69 63 69 6c 69 61 t to the sicilia
1750: 6e 20 61 67 72 69 63 6f 6c 74 75 72 65 3a 20 6f n agricolture: o
1760: 6e 20 74 68 65 20 6f 74 68 65 72 20 68 61 6e 64 n the other hand
1770: 20 73 68 6f 72 74 65 6e 69 6e 67 20 61 20 6c 69 shortening a li
1780: 74 74 6c 65 20 62 69 74 20 74 68 65 20 6c 65 6e ttle bit the len
1790: 67 74 68 20 6f 66 20 74 68 65 20 73 6f 75 74 68 gth of the south
17a0: 65 72 6e 20 63 6f 61 73 74 6c 69 6e 65 20 77 69 ern coastline wi
17b0: 6c 6c 20 73 75 72 65 6c 79 20 66 61 63 69 6c 69 ll surely facili
17c0: 74 61 74 65 20 6d 6f 62 69 6c 69 74 79 20 61 6e tate mobility an
17d0: 64 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 73 d communications
17e0: 2e 3c 62 72 3e 0d 0a 53 6f 20 77 65 27 6c 6c 20 .<br>..So we'll
17f0: 6e 6f 77 20 61 70 70 6c 79 20 61 20 3c 61 20 68 now apply a <a h
1800: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e 77 ref="http://en.w
1810: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b ikipedia.org/wik
1820: 69 2f 53 63 61 6c 69 6e 67 5f 25 32 38 67 65 6f i/Scaling_%28geo
1830: 6d 65 74 72 79 25 32 39 22 3e 73 63 61 6c 69 6e metry%29">scalin
1840: 67 3c 2f 61 3e 20 74 72 61 6e 73 66 6f 72 6d 61 g</a> transforma
1850: 74 69 6f 6e 20 75 73 69 6e 67 20 74 77 6f 20 64 tion using two d
1860: 69 66 66 65 72 65 6e 74 20 76 61 6c 75 65 73 3a ifferent values:
1870: 20 3c 62 3e 73 78 3d 30 2e 39 3c 2f 62 3e 20 61 <b>sx=0.9</b> a
1880: 6e 64 20 3c 62 3e 73 79 3d 31 2e 33 3c 2f 62 3e nd <b>sy=1.3</b>
1890: 2e 3c 62 72 3e 0d 0a 4f 6e 63 65 20 61 67 61 69 .<br>..Once agai
18a0: 6e 2c 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 n, Affine Transf
18b0: 6f 72 6d 61 74 69 6f 6e 73 20 65 6e 61 62 6c 65 ormations enable
18c0: 20 75 73 20 74 6f 20 63 6f 6d 62 69 6e 65 20 61 us to combine a
18d0: 6c 74 6f 67 65 74 68 65 72 20 62 6f 74 68 20 74 ltogether both t
18e0: 72 61 6e 73 6c 61 74 65 2c 20 72 6f 74 61 74 65 ranslate, rotate
18f0: 20 61 6e 64 20 73 63 61 6c 65 20 69 6e 74 6f 20 and scale into
1900: 61 20 73 69 6e 67 6c 65 20 74 72 61 6e 73 66 6f a single transfo
1910: 72 6d 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 54 68 rmation.<br>..Th
1920: 69 73 20 69 73 20 74 68 65 20 63 6f 72 72 65 73 is is the corres
1930: 70 6f 6e 64 69 6e 67 20 53 51 4c 20 73 74 61 74 ponding SQL stat
1940: 65 6d 65 6e 74 3a 0d 0a 3c 76 65 72 62 61 74 69 ement:..<verbati
1950: 6d 3e 43 52 45 41 54 45 20 54 41 42 4c 45 20 73 m>CREATE TABLE s
1960: 69 63 69 6c 69 61 5f 32 20 41 53 0d 0a 43 52 45 icilia_2 AS..CRE
1970: 41 54 45 20 54 41 42 4c 45 20 73 69 63 69 6c 69 ATE TABLE sicili
1980: 61 5f 34 20 41 53 0d 0a 53 45 4c 45 43 54 20 63 a_4 AS..SELECT c
1990: 6f 64 5f 72 65 67 2c 20 0d 0a 20 20 20 41 54 4d od_reg, .. ATM
19a0: 5f 54 72 61 6e 73 66 6f 72 6d 28 67 65 6f 6d 65 _Transform(geome
19b0: 74 72 79 2c 0d 0a 20 20 20 20 20 20 41 54 4d 5f try,.. ATM_
19c0: 54 72 61 6e 73 6c 61 74 65 28 2d 31 35 30 30 30 Translate(-15000
19d0: 30 2c 20 31 35 30 30 30 30 2c 0d 0a 20 20 20 20 0, 150000,..
19e0: 20 20 20 20 20 41 54 4d 5f 54 72 61 6e 73 6c 61 ATM_Transla
19f0: 74 65 28 63 78 2c 20 63 79 2c 0d 0a 20 20 20 20 te(cx, cy,..
1a00: 20 20 20 20 20 20 20 20 41 54 4d 5f 59 52 6f 6c ATM_YRol
1a10: 6c 28 31 38 30 2c 0d 0a 20 20 20 20 20 20 20 20 l(180,..
1a20: 20 20 20 20 20 20 20 41 54 4d 5f 53 63 61 6c 65 ATM_Scale
1a30: 28 30 2e 39 2c 20 31 2e 33 2c 0d 0a 20 20 20 20 (0.9, 1.3,..
1a40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 54 AT
1a50: 4d 5f 52 6f 74 61 74 65 28 32 35 2c 0d 0a 20 20 M_Rotate(25,..
1a60: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1a70: 20 20 20 41 54 4d 5f 43 72 65 61 74 65 54 72 61 ATM_CreateTra
1a80: 6e 73 6c 61 74 65 28 2d 63 78 2c 20 2d 63 79 29 nslate(-cx, -cy)
1a90: 29 29 29 29 29 29 20 41 53 20 67 65 6f 6d 0d 0a )))))) AS geom..
1aa0: 46 52 4f 4d 20 28 53 45 4c 45 43 54 20 63 6f 64 FROM (SELECT cod
1ab0: 5f 72 65 67 2c 20 53 54 5f 58 28 63 65 6e 74 72 _reg, ST_X(centr
1ac0: 6f 69 64 29 20 41 53 20 63 78 2c 20 53 54 5f 59 oid) AS cx, ST_Y
1ad0: 28 63 65 6e 74 72 6f 69 64 29 20 41 53 20 63 79 (centroid) AS cy
1ae0: 2c 20 67 65 6f 6d 65 74 72 79 0d 0a 20 20 20 20 , geometry..
1af0: 20 20 46 52 4f 4d 20 28 53 45 4c 45 43 54 20 63 FROM (SELECT c
1b00: 6f 64 5f 72 65 67 2c 20 53 54 5f 43 65 6e 74 72 od_reg, ST_Centr
1b10: 6f 69 64 28 67 65 6f 6d 65 74 72 79 29 20 41 53 oid(geometry) AS
1b20: 20 63 65 6e 74 72 6f 69 64 2c 20 67 65 6f 6d 65 centroid, geome
1b30: 74 72 79 20 0d 0a 20 20 20 20 20 20 20 20 20 20 try ..
1b40: 20 20 46 52 4f 4d 20 73 69 63 69 6c 69 61 5f 30 FROM sicilia_0
1b50: 29 20 41 53 20 67 31 0d 0a 29 20 41 53 20 67 32 ) AS g1..) AS g2
1b60: 3b 0d 0a 53 45 4c 45 43 54 20 52 65 63 6f 76 65 ;..SELECT Recove
1b70: 72 47 65 6f 6d 65 74 72 79 43 6f 6c 75 6d 6e 28 rGeometryColumn(
1b80: 27 73 69 63 69 6c 69 61 5f 34 27 2c 20 27 67 65 'sicilia_4', 'ge
1b90: 6f 6d 27 2c 20 33 32 36 33 32 2c 20 27 4d 55 4c om', 32632, 'MUL
1ba0: 54 49 50 4f 4c 59 47 4f 4e 27 2c 20 27 58 59 27 TIPOLYGON', 'XY'
1bb0: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 20 );..</verbatim>
1bc0: 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d ..</td><td>..<im
1bd0: 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 g src="https://w
1be0: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 ww.gaia-gis.it/g
1bf0: 61 69 61 2d 73 69 6e 73 2f 61 66 66 69 6e 65 2d aia-sins/affine-
1c00: 70 69 63 73 2f 73 69 63 69 6c 79 5f 34 2e 70 6e pics/sicily_4.pn
1c10: 67 22 20 61 6c 74 3d 22 77 66 73 2d 31 22 20 62 g" alt="wfs-1" b
1c20: 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 2f 74 64 order="1">..</td
1c30: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
1c40: 0d 0a 3c 68 33 3e 43 6f 6e 63 6c 75 73 69 6f 6e ..<h3>Conclusion
1c50: 20 61 6e 64 20 66 69 6e 61 6c 20 63 6f 6e 73 69 and final consi
1c60: 64 65 72 61 74 69 6f 6e 73 3c 2f 68 33 3e 0d 0a derations</h3>..
1c70: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 </td><td>..<img
1c80: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 src="https://www
1c90: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 .gaia-gis.it/gai
1ca0: 61 2d 73 69 6e 73 2f 61 66 66 69 6e 65 2d 70 69 a-sins/affine-pi
1cb0: 63 73 2f 69 74 61 6c 79 2d 32 2e 30 2e 70 6e 67 cs/italy-2.0.png
1cc0: 22 20 61 6c 74 3d 22 77 66 73 2d 31 22 20 62 6f " alt="wfs-1" bo
1cd0: 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 2f 74 64 3e rder="1">..</td>
1ce0: 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d </tr>..</table>.
1cf0: 0a 0d 0a 3c 68 72 3e 3c 62 72 3e 0d 0a 3c 61 20 ...<hr><br>..<a
1d00: 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 href="https://ww
1d10: 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f w.gaia-gis.it/fo
1d20: 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 ssil/libspatiali
1d30: 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 32 te/wiki?name=4.2
1d40: 2e 30 2d 64 6f 63 22 3e 62 61 63 6b 3c 2f 61 3e .0-doc">back</a>
1d50: 0a 5a 20 39 33 66 37 62 37 35 38 31 63 39 61 34 .Z 93f7b7581c9a4
1d60: 39 35 63 33 31 31 34 37 32 33 39 64 31 61 35 65 95c31147239d1a5e
1d70: 34 32 39 0a 429.