Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 929 lines (890 sloc) 75.7 KB
#!/usr/bin/env python
# Copyright (c) 2013-2016, Maciej Sieczka. All rights reserved.
#
# This program is free software under the GNU General Public License (>=v2).
# Some time ago on http://www.geonet.net.pl/gfx/pliki/kod_korekta65.txt there was the original Roman Kadaj's Delphi
# code. It can be still reached on http://web.archive.org/web/*/http://www.geonet.net.pl/gfx/pliki/kod_korekta65.txt.
# I'm publishing it in my repository too, for comparison and archival purposes. I do not claim any rights for its
# content. This is my Python re-write of it.
# A bit of background information:
#
# https://web.archive.org/web/20130820230820/http://www.geonet.net.pl/index.php?action=site&id=3:
#
# """
# 2003-03-24 Korekty "1965" opublikowane
#
# W pliku "kod_korekta65.txt" jest podany oryginalny kod w j. DELPHI procedury korekcyjnej rzeczywistego układu "1965".
# Funkcjami korekt są wielomiany algebraiczne stopnia 12-16. Współczynniki są wyznaczone na podstawie wszystkich
# punktów I i II klasy. Dokładność transformacji pomiędzy układem rzeczywistym (empirycznym) a układem matematycznym
# jest określona błędem standardowym 0.03m. Procedura została już zaaplikowana w programie SWDE-konwertor wersja 3.0
# oraz w programie GEONET_unitrans wersja 8.0. Z chwilą publikacji nie ogranicza się jakichkolwiek zastosowań. Przed
# użyciem do przeliczeń współrzędnych zaleca się jednak skontrolować poprawność zaaplikowania procedury przez
# porównanie działania np. z programem SWDE-konwertor (przykłady transformacji dla rozproszonych grup punktów).
# """
#
# http://www.numerus.net.pl/geokonwerter/geokonwerter.pdf:
#
# """
# Przeliczenie tzw. globalnymi korektami układu "1965". Jest to aparat matematyczny, który może być zastosowany, gdy po
# stronie układu pierwotnego lub układu wtórnego występuje układ „1965” odniesiony do elipsoidy Krasowskiego, a po
# drugiej stronie układ odniesiony do elipsoidy GRS/80. Przeliczenie to jest oparte na funkcjach wielomianowych. W
# programie zaadaptowano współczynniki dotyczące korekt opracowane przez prof. Romana Kadaja, dostępne swojego czasu na
# jego stronie internetowej www.geonet.net.pl w postaci pliku pn. kod_korekta65.txt. Przeliczenie to nie zachowuje
# cechy konforemności, ale za to praktyczna zgodność ze współrzędnymi empirycznymi jest w granicach od kilku do
# kilkunastu centymetrów. Pozwala na stosunkowo dobre "zbliżenie się" do współrzędnych empirycznych, a podstawową
# zaletą jest automatyka przekształcenia niewymagająca starań i pozyskiwania punktów łącznych osnowy wyższego rzędu.
# Jest to bardzo wygodne w wielu zastosowaniach, jednakże sposób ten nie powinien być używany jako metoda ostateczna i
# skończona przy przeliczeniach osnów geodezyjnych, zwłaszcza osnów szczegółowych. W takim przypadku przeliczenie
# powinno być zakończone transformacją lokalną (...).
# """
class Transformation:
"""
Implements the theoretical -> empirical and the empirical -> theoretical PUWG 1965 planar coordinates
transformation using Roman Kadaj's "korekty globalne" algorithm, in :meth:`transform`.
Args:
zone_id (:obj:`str`) : ID of the PUWG 1965 zone the input coordinates are in: ``"zone1"``, ``"zone2"``, [...],
``"zone5"``. Used to select the so-named :obj:`dict` of transformation parameters from
the :obj:`class` specified with :attr:`trans_kind`.
trans_kind (:obj:`class`) : Name of the class to use as a source of parameters for coordinates transformation
- :class:`TheorToEmpir` or :class:`EmpirToTheor`.
"""
def __init__(self, trans_kind, zone_id):
# Maybe this "introspection" bit could be replaced with something better, and maybe it's just OK, not sure:
self.transformer = trans_kind.__dict__[zone_id]
def transform(self, x1, y1):
"""
Translates the input coordinates using theoretical -> empirical or empirical -> theoretical transformation, as
specified at :class:`Transformation` instance init.
Args:
x1 (:obj:`float`) : Input X coordinate.
y1 (:obj:`float`) : Input Y coordinate.
Returns:
(x2 , y2) (:obj:`tuple` of :obj:`float`'s) : Output coordinates.
Note:
Polish geodetic standard swaps X and Y as you know them from your geometry classes (the classes at your
school, not the Python objects).
Todo:
Implement X/Y input and output swapping.
"""
# parametry przesunięcia (współrzędne środków ciężkości) "translation parameters (centroids)"?:
# xs1, ys1 - układ pierwotny - "original coordinate system"?
# xs2, ys2 - układ wtórny - "secondary/resultant coordinate system"?
# scale: skala normująca - "normative scale"?
# a, b: polynomial coefficients
# n: polynomial degree; the order of number of polynomial coefficients +=1
# http://www.extremeoptimization.com/Documentation/Mathematics/Curves/Polynomials.aspx; "The number of
# parameters of the polynomial equals the degree plus one."
# http://docs.yeppp.info/fortran/group__yep_math___evaluate_polynomial.html: "Number of polynomial
# coefficients. Should equal the polynomial degree plus one."
x = (x1 - self.transformer['xs1']) * self.transformer['scale']
y = (y1 - self.transformer['ys1']) * self.transformer['scale']
x2 = self.transformer['xs2']
y2 = self.transformer['ys2']
p = 1
n1 = self.transformer['n'] + 1
for i1 in range(1, n1 + 1):
i = i1 - 1
nn = self.transformer['n'] - i + 1
q = 1
for j1 in range(1, nn + 1):
j = j1 - 1
x2 += p * q * self.transformer['a'][i][j]
y2 += p * q * self.transformer['b'][i][j]
q *= y
p *= x
return x2, y2
class TheorToEmpir:
"""
Parameters for theoretical to empirical coordinates transformation, divided into 5 PUWG 1965 zones.
Attributes:
zone1 (:obj:`dict`) : Parameters for zone 1.
zone2 (:obj:`dict`) : Parameters for zone 2.
zone3 (:obj:`dict`) : Parameters for zone 3.
zone4 (:obj:`dict`) : Parameters for zone 4.
zone5 (:obj:`dict`) : Parameters for zone 5.
"""
# zoneX['a'] and zoneX['b'] tuples have the following shape - "tuple(tuple([0]) * (17 - i) for i in range(17))":
#
# ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0, 0),
# (0, 0, 0, 0, 0),
# (0, 0, 0, 0),
# (0, 0, 0),
# (0, 0),
# (0,))
#
# Except for zone 5, where it's "tuple(tuple([0]) * (13 - i) for i in range(13))".
zone1 = dict(xs1=5517488.50603, ys1=4598889.1111, xs2=5517488.53158, ys2=4598889.14168, scale=3.16701285208058e-06,
n=16,
a=((0.0193539931273024, -1.38993070640004, -0.217974074707465, 15.7365307692524, 18.4878874330472,
-159.250499178406, -35.7600839490129, 744.730592762672, -592.540073317533, -1586.84042194963,
3623.92910298558, 1298.4186218815, -8551.58695465808, 149.78477795725, 9282.09849929987,
-497.232748148834, -3861.83699443616),
(315754.537279187, 0.350568082511636, -35.1215666550958, 45.8920321009011, 500.470623508292,
-163.507319422473, -2632.08200820637, -2974.54520960019, 6073.29850249791, 23561.8319450045,
-4842.18843703379, -66361.6435154913, -2331.02295398441, 82731.3024757781, 3830.0860175458,
-38550.0106313076),
(-4.59116269931439, 4.95991879260738, 192.547476021604, -33.9981989684182, -2655.01533918734,
2200.62507895884, 13974.7765004753, -17128.8018926459, -33973.1799058239, 50377.4975581512,
33424.1415883856, -63764.8814662172, 11.1516466813308, 28740.4608974713, -12717.0494491878),
(0.538592750303754, -53.5787463155414, 551.170705415396, -156.232872904695, -5108.8269633505,
7737.03640573576, 16960.5432685303, -30540.8846459221, -18461.6058349847, 18106.5031567953,
-10375.676578127, 63741.0306304707, 22244.8554413929, -71630.0247085823),
(-0.256925435854058, -4.57147912329052, -1198.14413287314, -1936.90907128037, 19298.5551468485,
-2033.17900874307, -91103.4270404925, 70794.8724841748, 183036.5329758, -196008.641205082,
-133755.088338281, 154737.732045453, 355.793090276423),
(36.6502556650364, 997.162282934864, -3795.09546354948, -6404.29246575716, 21717.5847003267,
-8950.8176555918, -25773.5065495545, 73477.3166534601, -45322.0568341088, -30217.4820195626,
84327.0902146023, -79821.4151911737),
(391.572869008019, 278.855783356959, 132.450200791389, 15271.9960224146, -47933.7334288337,
-37665.5612661627, 177388.072330839, -72924.3647720178, -213265.969380271, 175500.350791173,
46895.4463939869),
(-602.964657163217, -5533.42086457995, 17777.2372780608, 33691.5455486676, -72548.3679310854,
-37925.6376713951, 33284.0608722234, -8568.84605548402, 82086.9515357906, -68122.858917346),
(-2992.10903747903, -1917.51591543755, 14254.5743672091, -52151.2661749682, 68197.2096874146,
125690.976004458, -143582.417854914, -10601.3620149971, 11746.877344355),
(3328.33754675919, 13476.253378099, -51304.4030870194, -46206.2009324222, 161289.49014826,
34141.8198615681, -66102.0897211251, 35.3359935375642),
(10814.6378420589, 5089.29508522844, -39286.5993970231, 92794.770546936, -114106.78438995,
-124348.075829768, 111288.666392814),
(-8432.15805386266, -15003.9119406995, 74873.8032936373, -17993.884498808, -140180.188363927,
44639.7378067688),
(-21741.6163703907, -6923.92656258046, 43180.4456693856, -66961.8719115681, 106569.60726652),
(10113.4148204741, 6832.13544799134, -41035.932095631, 55954.5362263768),
(23533.1399410211, 4423.88522286802, -18508.9309067781),
(-4710.08421602814, -1559.67534025907),
(-10649.6363336597,)),
b=((0.358936079010725, 315754.558771577, -5.02315602484321, 22.3472599966765, 46.1064458174338,
-312.511755444186, -396.463966451282, 2219.89401658658, 1866.51097948984, -8865.55882994532,
-3911.63830022822, 19882.7953725625, 1985.16943604725, -23280.5951193169, 4014.41801497445,
11068.6904501941, -4266.07358481396),
(0.168909843307879, -0.190392783225318, -28.4493175693376, -2.39012905948243, 486.584146991965,
-5.77747683642958, -3936.9541694586, 1748.1061768972, 16230.0261159635, -12714.2123547622,
-34707.6773012723, 34756.7900986182, 36770.3306909389, -41952.8757312936, -15241.5619303195,
18862.1781721157),
(-0.554597346058923, 22.0926314053981, 37.8348568047849, -293.587538489588, -536.221988722237,
723.713882548206, 3697.78950971791, 5045.47894385434, -15759.2276257011, -25369.1111688255,
37909.852312028, 38905.6432578737, -45643.4253495829, -20070.6943535362, 21454.8899694382),
(-1.17104313403779, 51.2846321970359, 382.427078691876, 44.1985821497009, -3386.78737550024,
-5228.4648448392, 21262.4147572639, 18468.1039987757, -74416.4813406822, 4997.2860468303,
119323.341135491, -75978.0563722877, -70998.7894922957, 66222.8609382021),
(-39.4167786035607, -178.591715759812, -376.866070202803, 2347.02818194635, 3612.82427346537,
-9628.02201734364, -11526.681857719, -21049.0190481118, 42962.4792156036, 112974.107044575,
-99380.1654971579, -101609.462639587, 77898.4646313014),
(107.800282340135, -666.0424462653, -3494.69047078464, 5406.21775747283, 8383.31253295998,
9248.96345982255, -34120.5675996305, -80903.0489909931, 128234.12535022, 43802.2822706033,
-119562.791906641, 69201.8748971703),
(545.855553123299, 691.480182198961, 3942.17118064784, -8443.70958569897, -26656.6119495147,
66661.7596586506, 26548.3868743146, -38086.7355826498, -63249.1190465685, -81852.3162409328,
105497.134849175),
(-939.550482776314, 3345.62873447057, 18754.4637207517, -39274.1583535659, 12333.6020678057,
43777.5338658398, -67525.1772982965, 99223.8851380262, -71007.3723246741, -39408.5922619931),
(-3961.53719256913, -1858.06303055238, -18733.4353234735, 15897.2697769671, 89907.9160209246,
-198512.211856853, 25774.5873725382, 128049.599643306, 21345.2512962773),
(3133.41966513764, -8185.0818174936, -56597.891633205, 99515.5536692286, -85443.072340891,
-59274.83442851, 222263.989806022, -94748.6923691268),
(16855.7222328691, 4217.34278998919, 40052.2260911134, -15762.7255148885, -112193.9527048,
231603.176873715, -189295.985940458),
(-4094.3461238787, 9819.40601721822, 88548.2849946514, -108774.542059084, 84982.2183848667,
-84903.3518299318),
(-40917.3328197239, -6299.09710135676, -36720.3606405032, -381.956381973831, 45285.5899628273),
(536.173469850239, -3818.06637435042, -54749.919237478, 55092.7368368167),
(51869.7225634357, 4308.59671190012, 9198.71255010643),
(1834.23734881776, -2241.78778517113),
(-26370.3995541193,)))
zone2 = dict(xs1=5796241.28401, ys1=4559496.86327, xs2=5796241.21486, ys2=4559496.99075, scale=3.66728860991941e-06,
n=16,
a=((-0.228710236388213, 0.835147508736656, 4.75693918443104, -10.7926481722, -44.1246029724158,
202.386545484374, 81.0662372138493, -2045.95703368852, 1522.14537772809, 10314.3066258139,
-11613.6124513945, -25828.680618376, 34042.7520837062, 28660.3534856337, -42856.5315972234,
-8753.96398589617, 16551.9682874193),
(272681.097774881, -1.39265644510853, 39.1909440638101, 38.0504187571862, -545.567285945696,
-437.343961450099, 3452.53683792952, 2376.51554011914, -11076.2250118171, -7565.55413860755,
17467.4948371956, 16662.9090914027, -12162.5543108851, -22329.1532874026, 3481.47505248384,
11277.6356918525),
(1.44776684362705, 12.8564153278173, -153.977955045539, -259.522075325752, 2981.28328425621,
2166.95072864635, -20976.9848014502, -9175.66360560771, 72869.0549389153, 15391.5810225105,
-133669.541016681, 7298.93228535114, 109696.634245171, -33768.6095555424, -12074.4789610108),
(5.32751397249953, -22.746262292363, -801.100803341108, 817.987553850039, 7906.87774836307,
-3321.85743621122, -38234.8082636887, 12519.0758485397, 100070.40592991, -50279.9164357103,
-124525.730423706, 90832.0586735216, 53359.38842383, -47972.6339784502),
(-2.76942754629659, -258.350960088033, 1485.65708332061, 3504.24714806708, -26675.2337985544,
-20663.2531633046, 148235.525765153, 66162.5406008596, -368041.785553298, -137304.643748359,
459022.766566611, 124754.448343085, -260370.173752586),
(22.6520788933378, -116.563648799912, 5441.03993711445, -14079.5311029255, -37608.8881180621,
55068.7915242818, 119254.51528378, -99241.6688622171, -214757.47602512, 145843.954190773,
144131.762569739, -122505.847341063),
(93.3244298723096, 1813.74392018631, -4742.52541291843, -14982.7722671576, 91665.4677123947,
72112.0776131769, -413677.467581849, -81076.6042765037, 675698.630815258, 34649.1416653591,
-349939.553808055),
(-1074.69257424909, 7912.83119334552, -20264.0866645085, 69270.5167083339, 96178.9004388855,
-238836.231691681, -133698.78936968, 250709.466834313, 136329.988198903, -119790.495688377),
(-1542.11080556902, -11526.541685949, 5903.6824567222, 13653.3652836594, -137219.838347447,
-154284.279802111, 456078.618404579, 80593.637067256, -447368.642263953),
(10925.933257862, -61050.388855541, 40084.2209689126, -130693.421557493, -172699.022267298,
432697.622864416, 22552.3465077829, -207132.523342333),
(5590.93399402442, 66671.9387768293, -6767.78807308119, 69052.2189432664, 135984.606420585,
124487.992853695, -114298.819891072),
(-53796.20149442, 176573.351120242, -12100.5709357603, 31119.6998217488, 180851.315226683,
-301152.863967374),
(9304.72890077382, -210530.55295643, -14534.5522311764, -133066.029193715, -154414.588449451),
(127757.588060519, -162419.838063521, -57351.9758314922, 127614.99797538),
(-78607.3938044707, 248005.508627564, 73625.7118859324),
(-116118.022594853, -46787.2019820451),
(103488.064138051,)),
b=((0.177893946875018, 272681.317840819, -1.75237085356442, -5.85761611382844, -23.5754938376994,
101.481460807113, 366.854052003557, -901.113412911547, -1887.45799060334, 4556.66618659123,
3615.82694872379, -11706.3919394164, 201.233017099282, 12229.0398355678, -5942.24624548183,
-1694.99175905825, 1079.68040835117),
(-0.052373795085327, 3.22645115964681, -9.52029068932962, -77.9092786662106, 311.023390418955,
863.475068391299, -3263.08296069361, -4673.54448313307, 17469.4620983851, 11470.8523567293,
-51465.3313677734, -7196.01289799544, 79756.7624227741, -18317.6555781076, -51152.7521130978,
26063.5396525108),
(-2.70295409533127, 6.11863992476365, 78.9859069555546, 172.339620162246, -975.916988032705,
-2669.71859956047, 4362.14187066325, 13585.5553792447, -967.528896156235, -42128.295973796,
-30462.0399843367, 87036.7792613648, 42160.1154314852, -81468.5227586997, 7627.23089173878),
(-10.7458269927257, -76.433453802888, -117.480318763034, 475.344970262057, -818.409376123744,
-1339.21775679194, 13299.7635657329, -2319.22264181741, -56886.3320256514, 40288.6071179673,
109394.623823713, -113554.195849668, -83975.2925594228, 101682.886106374),
(55.3616598719306, -223.358971317268, -829.867829974141, 38.3249426919436, 8713.08139788361,
14628.5274814671, -62391.280930719, -45521.765741576, 175780.872760616, 26347.3195035343,
-170826.222303868, 17701.525463437, 23051.3108193913),
(180.113927629188, 796.066967214869, 4007.35199305591, -2691.75078257601, -12644.910565487,
-214.999889564939, -4770.07678575768, -6209.70546666587, 56725.5592236044, 5794.67534489615,
-44321.3204581949, 12983.9391244573),
(-551.437685530189, 2167.27366436591, 2632.49122761151, -14521.0718544169, 621.472186988522,
-31346.2319253598, 89199.0277920366, 137548.850941085, -319573.748289573, -79486.0228211832,
249285.074718025),
(-2082.12884003729, -5126.16239002271, -32555.7342762279, 19970.5105200535, 92031.2384655653,
27166.1954093892, -76442.4227739848, -55804.9752617484, -18002.5974920585, -176.012508802817),
(3355.28172827839, -7481.80641427286, 726.019053986879, 96888.8864841721, -103394.493429738,
-47167.4308047801, 123011.229507563, -105682.084494603, 72256.7235037951),
(14500.2931958827, 17867.8793690464, 121627.203752319, -120978.360603429, -218163.034893249,
7983.64368270435, 126253.802870592, 110697.438660831),
(-15765.9253980558, -2394.92326678694, -36446.7238379712, -224766.105621774, 241819.017346086,
148344.869599084, -217117.706279025),
(-55867.3083025646, -15989.4224968132, -222733.208547339, 303184.316921857, 174868.776938986,
-145753.478674002),
(55005.9121276398, 59259.442977292, 116171.353498498, 165923.045244459, -186190.85589435),
(109548.315729666, -55205.5638643104, 162455.687879257, -237876.914222948),
(-111936.67941037, -81646.5927991378, -115793.100828116),
(-85219.8921254755, 99041.0076359479),
(93259.1049263152,)))
zone3 = dict(xs1=5970419.49328, ys1=3548547.30784, xs2=5970419.3611, ys2=3548547.29359, scale=3.76506426727652e-06,
n=16,
a=((-0.0394883170273723, -0.264292175803163, 0.243105168242821, 7.88170057430862, -1.46382446050048,
-68.1867059096268, -26.7464126318646, 297.355742005548, 174.368126018716, -660.583601964863,
-358.809398824117, 651.991898993765, 161.951702270253, -126.284959073399, 295.085170230594,
-117.325029284115, -261.5429873609),
(265600.133920747, -1.27485156144421, 2.08632989307833, 46.1429725666369, -181.751149446081,
-456.52655282516, 1598.26990029129, 2473.71680121249, -6249.84887134931, -7628.14690711649,
12660.3299598274, 13508.3504470268, -12943.1108702922, -12840.387610124, 5291.56141389091,
5077.17809314059),
(7.32698298456815, 29.0760713355014, -130.893504296215, -427.910142634981, 745.025586916762,
2759.32943260768, -1091.93835274902, -9909.318215634, -3297.74664221965, 20029.0612842604,
14248.4826640672, -20710.2266248243, -18732.6365315897, 8271.46499317967, 8327.84668235186),
(-25.8585736894499, 121.482118368495, 567.200036602048, -1358.70402628023, -2133.32408116872,
9059.09744261198, 934.58161691229, -31793.075032683, 8050.5086111753, 57589.9849752506,
-15306.7401649609, -51425.2378538603, 8099.45909953357, 18057.1008744949),
(-204.983640780382, -800.445864967742, 2751.23822194063, 6729.72995976903, -15172.8708109163,
-23176.2916588307, 35614.3350959647, 42949.2039223091, -39437.3162022032, -43691.8289640606,
16858.4340295573, 20970.8107581236, 2136.94429693419),
(520.957081963439, -2331.71490822823, -10764.6866425826, 14713.1449314399, 43792.0896370141,
-55472.2195929036, -67201.1751770847, 127013.476106801, 39969.760646078, -152001.896925242,
-3190.32682417513, 69740.8876708635),
(2977.94639719078, 10215.7574618964, -27849.6267851138, -59110.9426683699, 116723.31665722,
122878.316148243, -206321.669512993, -118729.075496732, 155702.432530041, 34754.3981738149,
-45423.3142381596),
(-4610.33543551517, 22490.6538725, 77676.5453666799, -104863.13245876, -252294.643967445,
214571.423094016, 290465.671993965, -208712.276310861, -113264.663191622, 94092.3341953998),
(-23127.717599163, -64918.7016766297, 160662.462341408, 276770.864715704, -487965.243051987,
-340694.081249221, 596876.873785939, 176042.257859156, -237580.47651984),
(22835.7174198941, -114448.777734082, -275257.514551597, 433808.147553312, 592388.334953601,
-611985.280519601, -356817.951814174, 243101.503945226),
(99724.9348002265, 208531.647804608, -512444.070441085, -639756.591039851, 1013184.54753103,
331970.7484014, -623472.766029274),
(-66671.9550357091, 308341.332673291, 488622.630279455, -819096.280674866, -484358.710089454,
685737.782585664),
(-234924.486537454, -310904.899756494, 817058.034818187, 586058.05594931, -819214.900199645),
(108147.376152932, -435302.384289326, -360094.230375761, 510958.178591024),
(276095.117676924, 151010.33147911, -485758.117048791),
(-74610.4996831282, 283386.504453912),
(-121622.23412474,)),
b=((-0.158008214542041, 265599.986656736, 1.82209101790086, -5.78714591750611, -6.20820896297766,
49.4335941204011, -26.7234496531356, -226.643064472479, 294.757825212727, 630.393676634003,
-863.518608455161, -1077.60042016061, 1103.59713094573, 1020.99180699469, -581.24825772098,
-403.278668761365, 66.5434241622696),
(-0.384414331362868, 2.17456467377664, 8.83593036771103, -17.8403894507231, -75.3897227639511,
-83.1209316517998, 446.079344838967, 1098.85471950803, -1863.52034752246, -4072.61056362846,
4187.06703346426, 7321.79017949905, -4472.11489623352, -6555.1941043448, 1789.28198585008,
2328.26286747207),
(0.652860358531785, -8.83354103901584, -84.846632059412, 177.839538052264, 1000.65461227214,
-736.783054029551, -4204.00042767379, 1499.32288907455, 8437.9556847011, -2281.19735922683,
-9337.68598538341, 2920.59932775796, 6512.95089360013, -1816.2469315909, -2571.26650026944),
(20.3083623007607, 11.6420604184863, -354.152475429001, 387.64031783046, 1584.91409322871,
-1433.51181578601, -1774.10344192803, -23.0779696190324, 304.270907211127, 5365.4259367293,
-1159.88874268307, -8064.59363503661, 1624.91323468679, 3914.56771675909),
(-42.9698007148064, 252.558053900778, 773.28606138411, -1782.01702332179, -10349.1367773482,
873.10805350375, 40853.9344231376, 8178.49206957087, -63941.8685049988, -16974.2452351684,
37544.5634867065, 10077.4226512045, -4335.99237793003),
(-416.067677283501, -381.627839535659, 4690.10869960292, -3368.72742706269, -18175.4707199322,
11302.4245365584, 11510.2975331298, -202.004459590527, 15405.0028296125, -13626.5172572018,
-11877.103911476, 8951.49644936811),
(628.13635435555, -3885.35393011478, -1341.82271879793, 21826.9313500348, 38212.8285789474,
-18415.4886698287, -161366.586184931, -5690.13231588419, 223187.937405727, 9765.38744344203,
-92765.6560621971),
(4649.12293746823, 4008.82045512336, -35508.1465164785, 22635.1165479354, 124840.791516137,
-73292.8694802148, -94242.1168741523, 13705.2014746625, -3422.22342802112, 9536.7185187978),
(-4375.03426471453, 29197.1458892736, -25738.2054843659, -145114.786975318, 32682.9119450918,
114853.66787308, 130609.247867501, -21109.8047307346, -165401.233889245),
(-29867.4605798435, -18218.1491937765, 140372.239256863, -107561.111888473, -389224.106123839,
298435.180129618, 200496.129291949, -59361.0631603384),
(19210.8724065771, -105649.611480676, 171966.567992091, 430207.040091011, -418500.591760471,
-201464.782635353, 171363.918899258),
(111977.35970772, 38850.0532776693, -265304.88473417, 245253.347112107, 420647.718146146,
-441974.302372735),
(-64646.2814060035, 173346.403683989, -406566.161083122, -457994.141882737, 581501.904030716),
(-229515.377455756, -26176.6961145997, 189892.234823481, -184351.379753274),
(151060.803983114, -95742.341093708, 335271.146984537),
(198476.687744006, -20303.0187897257),
(-159889.477074577,)))
zone4 = dict(xs1=5619707.60717, ys1=3751470.35185, xs2=5619707.74836, ys2=3751470.26874, scale=3.38504778871894e-06,
n=16,
a=((-0.0204449835840226, -0.148996306207909, 1.89020753234991, 33.5164174532293, -64.3154380303997,
-696.942667885579, 561.921445649506, 7541.30280983362, -212.346833933686, -48264.4107699485,
-26080.652066685, 169232.942207034, 161181.055177741, -264338.105747113, -342442.569722036,
81183.8540197436, 158648.425507528),
(295415.190942296, -5.68425736772897, 22.0328426453188, 105.248631385024, -365.962775899547,
-1241.14039866991, 3232.50106467135, 6897.81443990214, -21352.3762836357, -9759.40779387744,
129466.357194227, -6777.98259929743, -483605.04777613, -155748.684813972, 701090.748063987,
512652.764901689),
(-0.265585749085725, 22.5176833711947, 70.654517280105, -889.732648292124, -644.164708469624,
9196.45682789927, 4089.04950716284, -43698.3962084913, -22588.6190056959, 141593.735758118,
78942.2986113432, -370707.870869616, -252051.78796749, 495157.899285992, 446963.394554127),
(11.1679294043277, 50.2552161354544, -733.87591138007, -1545.80236393476, 10089.8834447072,
17867.5404899759, -45162.4552460669, -126656.187659139, 33030.7559034595, 409362.908899836,
188548.752561696, -497563.407687307, -251939.445774061, 183572.774608535),
(8.33416269692593, -438.3618909727, -1452.71354003683, 12889.0224226343, 13453.9065932474,
-99331.7898002545, -71558.3241802827, 287862.304873666, 325148.772971138, -333683.243236233,
-678571.3148224, 180733.668591744, 568643.871719552),
(-48.9285357477842, 97.5581089443066, 8636.58814664941, 5348.07230345653, -112140.300179164,
-20343.6097946857, 462514.317212407, 192826.889223422, -677944.028102056, -637636.954475716,
193564.302952395, 454135.552236543),
(80.7818170950214, 3771.34603901184, 6505.10796081778, -95255.3634916117, -21035.5828477637,
563262.162746843, -70271.7752371679, -1118422.37802548, -60667.5468064238, 610201.109239656,
194992.684416932),
(119.258292669345, -3523.92989205537, -47022.518291185, 12176.0462623189, 497105.303993036,
-297379.538445669, -1424677.87397325, 606331.958713661, 1161323.86812184, -156325.746672409),
(-1476.18862504117, -15710.1430597003, -2418.19322562683, 335941.856011284, -159630.323926038,
-1378557.88591787, 1000832.72811526, 1436707.18553241, -795541.027373389),
(-221.44831571709, 21725.669766066, 130144.277653441, -118044.918396597, -981810.195883995,
1122884.85769046, 1438069.12293325, -1340691.82501302),
(7877.02792498856, 33441.8819088525, -46996.0210717724, -547943.242537056, 578902.342114207,
1179775.05483547, -1387566.61634617),
(601.879180434667, -63809.9910611855, -175732.59758775, 252568.753024197, 713692.813306766,
-1136567.0061333),
(-20580.6060507036, -35393.5997548136, 107823.014847056, 333968.154103229, -532477.592074131),
(-1422.29372746198, 93167.4275740437, 91047.6267152379, -173342.723520206),
(27317.9107754171, 14959.7919363647, -70766.8101724967),
(1301.92153580844, -54061.4414819471),
(-14775.8464870512,)),
b=((0.0306879938048835, 295416.483981288, -6.66493004613836, -6.5067926819272, 42.7237512776695,
110.877070200739, 1159.358759398, 1209.45227897589, -17136.0009599595, -28522.5809029068,
88552.6899493026, 190299.584468207, -175091.554592977, -558530.022044293, -21213.9988572227,
625925.196769241, 360539.196824536),
(-0.471530691472123, -7.18116159744067, 29.221349988112, 103.386170881585, -244.707395687045,
218.817231027881, 122.048728955843, -16384.4666369621, -3470.43100782465, 136883.408013409,
105630.280197355, -435531.748225624, -563750.273528836, 371873.891862807, 896352.826939763,
378559.865132107),
(-1.84667376757932, 14.5320692873794, 142.077768044047, -366.539485966596, -2667.47001064252,
-602.705273685177, 13622.8654870436, 33530.1729990809, 17921.0744094509, -160657.688829241,
-303279.217878744, 190242.961279384, 653355.204125677, 115366.470303844, -233639.480164161),
(2.43971638733686, 79.7484585355788, -808.862125790597, -2128.9483191209, 9774.99156662648,
20896.766840385, -33212.0156987959, -78946.2724749811, -43694.8073614673, 23717.1482949117,
367940.866202969, 443559.952668436, -393852.564792921, -574212.682592012),
(2.33314666297907, -137.261912839594, -604.979425645155, 10076.2869743461, 17259.9332422807,
-74530.9121871386, -120454.721745616, 138327.726413816, 299847.72812853, 173109.531526595,
-53509.6960294357, -497625.968709793, -465082.553693314),
(134.550192680787, -294.043587976664, 6748.38943213591, 6812.36634858827, -94353.5955854722,
-63317.7786583908, 423603.775644126, 279112.980878322, -609645.59223428, -481528.355710999,
66742.2360568602, 55581.0117436629),
(-6.80143302871663, -693.657016069592, -1736.58381007579, -60674.7154141196, -9571.50702812614,
468117.47711886, 70408.6211111399, -1074011.77512071, -217664.568199132, 654343.370228372,
197459.203655003),
(-1939.14454382585, 1196.3545691997, -21391.3262509215, 7915.09522744509, 332682.372163056,
-130849.434364153, -1248193.16460347, 371607.828189859, 1252532.50746617, -117344.335015856),
(902.817648577332, 11668.1409110748, 14281.1991467996, 141483.179738694, -141351.754976528,
-991157.542738038, 684824.199905379, 1364479.3359734, -815984.015933996),
(10877.9670869503, -9930.96462261369, 18087.2683424792, -53531.5330341021, -494474.042937191,
628743.484968439, 1122546.79355914, -1186677.06432852),
(-7429.7670895054, -47352.3971488072, -15538.3978118748, -118861.130924103, 317251.681881784,
704111.796883835, -949223.695490571),
(-29949.6330227436, 42553.1798510945, 30673.5373971155, 41941.9308406787, 254479.23085754,
-532931.222331871),
(24145.577326769, 79770.2751764746, -31587.1118108284, 6967.51697536771, -179878.658367406),
(40229.9785335471, -78240.3441277748, -46414.4112540437, 19538.1559381144),
(-35416.2363550561, -48939.7337152079, 50542.9647512838),
(-21070.5112219535, 51879.9493095972),
(19519.5721698865,)))
zone5 = dict(xs1=908669.91787, ys1=244104.09992, xs2=908670.18005, ys2=244104.06678, scale=4.68604484483043e-06,
n=12,
a=((0.230404078005761, -0.226763145801663, -0.942162713428633, -3.39887515375093, -2.42669419327038,
-0.470220006083768, 7.40363278079879, 105.068912299541, 38.7859647095165, -355.777109082481,
-177.031995817379, 353.620103461683, 196.91258414023),
(213399.833419461, -2.52369482171671, -0.951193174640043, 40.8566741283465, 23.9970837829309,
-163.04261900772, -46.9514509321965, 229.583035111071, -97.664573229075, 71.1281546743716,
168.486601294407, -372.38023774364),
(-0.871432334658335, -14.0343295799951, 15.9047523681152, 164.197163254421, -150.222871966325,
-665.021576744756, 323.501769559988, 1156.72963235267, 49.3316839752954, -763.22483209516,
-381.339112244741),
(-5.18118140993539, 30.4760336901556, 61.8392058575444, -557.913645658407, -605.056857547114,
2257.79059318485, 1502.67764384981, -3463.34563898795, -1107.27222591592, 2179.77105043622),
(-6.74554676160286, 93.591362937949, -248.411207777225, -662.412557191196, 2603.57036632354,
742.800477228964, -5588.36668366102, 668.749735641499, 2320.98983145499),
(10.0947700070318, -170.397813926198, -37.4185646023112, 3154.21434961898, -1181.61913872968,
-8116.17915302215, 5740.41990782121, 738.534119491783),
(63.7442891420178, -121.841780638954, 1174.51892256791, -1279.86221700205, -6532.77176778251,
10570.8380571767, -2538.36193352956),
(51.8918382377771, 396.039628329795, -1501.48103557355, -5072.35619172579, 10750.3157448418,
-4431.39300272179),
(-266.695230540108, -480.1434364848, -1021.56040268983, 6375.02711873744, -4854.22118154151),
(-225.60005416614, 23.6421682946226, 3300.7605882865, -2206.89445682368),
(562.774481972506, 1069.28537699411, -1780.55409741479),
(250.458854897369, -870.372703177761),
(-484.473582946751,)),
b=((0.063371115445086, 213400.288972192, -0.0170516477523874, -1.78420955631911, 19.5006267454886,
-1.75389821246962, -234.568835533273, 73.0677277582141, 1069.93989774103, -280.715451721134,
-2140.53252176954, 311.039747194863, 1582.9555474654),
(0.368644940394128, 2.15641385987304, -2.96942029995919, -2.90404249871083, 96.4913820668637,
-169.002050355365, -671.939341461984, 1152.67828216726, 1562.36603977085, -2810.83314513722,
-1138.09736726604, 2407.99791375794),
(-1.14085557747718, -3.14251109773702, 20.8852618703082, 57.4663016585387, -46.3476864639297,
-714.320038743878, 380.358886262689, 2439.62639698141, -2234.59294808422, -2417.64405368682,
3129.04856519342),
(-7.32651443876253, -5.99851473282974, 65.3800146094115, 27.8626381969757, -270.578738056689,
365.785513087648, 2154.87597005923, -2703.15024479162, -3710.78862375188, 3839.57375025216),
(-4.31820695944694, 29.7835411194604, -353.985339681259, 1.91901669109213, 1140.84135791842,
921.695675225697, -2019.7128447641, -2538.51534855844, 2482.88592101154),
(64.927406332437, -40.2102147261063, -509.454756311048, 565.447861591167, -993.973208646513,
-1422.01090732446, 2641.10490104699, 1327.29319782836),
(80.4381800809122, -223.055935433366, 1780.72497784613, -1351.76592408458, -3001.99258593742,
5109.13665194264, -1970.75855257784),
(-255.210046434695, 313.923590373571, 1201.26021062442, -1070.58658248181, 3738.89872291562,
-4157.04692273283),
(-337.295243433716, 709.362674625165, -3372.09692036476, 2113.63323226104, -407.703322690524),
(475.688516906835, -836.250549004738, -904.392430911646, -32.4219399682259),
(550.228238267751, -722.901170093054, 2215.78858425504),
(-349.303684468114, 788.899636524823),
(-293.228898460501,)))
class EmpirToTheor:
"""
Parameters for empirical to theoretical coordinates transformation, divided into 5 PUWG 1965 zones.
Attributes:
zone1 (:obj:`dict`) : Parameters for zone 1.
zone2 (:obj:`dict`) : Parameters for zone 2.
zone3 (:obj:`dict`) : Parameters for zone 3.
zone4 (:obj:`dict`) : Parameters for zone 4.
zone5 (:obj:`dict`) : Parameters for zone 5.
"""
zone1 = dict(xs1=5517488.53158, ys1=4598889.14168, xs2=5517488.50603, ys2=4598889.1111, scale=3.16700906695084e-06,
n=16,
a=((-0.0193726745221114, 1.3903661936672, 0.221740954389177, -15.7548278521462, -18.5870264429158,
159.615186911041, 36.6214742097188, -747.819021959363, 589.382316104747, 1599.73652291029,
-3619.67331414539, -1326.78422724778, 8554.07752117297, -118.07679395985, -9293.70614477716,
482.972598127708, 3869.86759034254),
(315755.75275317, -0.357885906382641, 35.0937555838699, -45.819702974461, -499.897481354693,
163.519358581123, 2624.48402617204, 2973.69590274968, -6031.64447309426, -23566.0975506205,
4735.25716874134, 66392.6620048989, 2460.61651312491, -82788.1062725447, -3890.08770671737,
38583.2962300329),
(4.58851569648362, -5.0147026833414, -192.403830291598, 34.4185535124681, 2655.46139942286,
-2208.11560115067, -13985.8466438027, 17195.3130646556, 34010.3508173734, -50612.3716927804,
-33441.4722149714, 64121.3980113751, -87.5535162428153, -28936.6255829526, 12796.9635242278),
(-0.748337146381928, 54.0410604776834, -550.369490000675, 150.451911698151, 5108.91161508654,
-7714.01727704737, -16915.2448778888, 30490.2757404135, 18141.5258853501, -17954.3141212575,
11059.6601949479, -64094.3475950445, -22712.9573048611, 71916.8800128459),
(0.326258161887332, 6.2596036830551, 1190.81822208583, 1938.52145119925, -19258.8032411193,
1995.60094636548, 91025.5881187128, -70898.7386791674, -182888.286676664, 196665.732102567,
133303.908900089, -155407.102896793, 133.871273688088),
(-32.2567239634742, -1005.29373292282, 3782.50966668368, 6489.33151009073, -21819.446813458,
8671.53047278963, 26155.5399913776, -73059.504720785, 45318.515948504, 29607.3630474307,
-84891.5508603432, 80486.5148102063),
(-391.584938113318, -300.498251224354, -48.5658279485361, -15309.4799626864, 47583.0123767303,
38430.1061454037, -176975.675232834, 71557.745934669, 213129.160132338, -175177.245492826,
-46555.642732203),
(561.755789394503, 5598.63508559666, -17674.0453477276, -34174.2346319001, 73242.481110179,
38734.6191523158, -35936.2654374792, 8746.76978981289, -80231.0552584683, 67655.0288200325),
(2983.98491834026, 2050.10040031654, -14688.1957717136, 52282.9874632105, -67204.9108832801,
-128427.070587456, 144157.788629847, 13911.6275596727, -13542.0194035888),
(-3128.42580148777, -13757.5265152842, 50887.805807825, 47514.3263853732, -162907.516372088,
-34288.6425007017, 69887.7461782805, -2554.40070714728),
(-10747.5118369222, -5500.44912700422, 40463.5473769818, -92901.7441250552, 113111.753481282,
127178.836475272, -113681.362921168),
(7910.50083507054, 15681.7663633903, -74082.7343883493, 16220.6269850917, 141398.109888673,
-45729.2229281636),
(21509.6072209441, 7546.00291594942, -44836.910047128, 66897.1790453006, -106334.928677763),
(-9418.28731693988, -7689.58010911986, 40471.9367784758, -54940.4468185503),
(-23157.9166121166, -4787.66075582605, 19465.9270846565),
(4338.89257211347, 2000.30831210149),
(10416.1403803619,)),
b=((-0.359050173874956, 315755.725269754, 5.0383261508078, -22.1500882470058, -46.5910061217033,
308.478311168878, 403.203891758982, -2183.19573655375, -1916.17444791397, 8694.13399885335,
4118.59226110004, -19454.361124626, -2472.41272337544, 22735.6226573452, -3411.99853875011,
-10791.4223814069, 3962.6315187231),
(-0.168964497118843, 0.207555627840787, 28.4558296046485, 1.75269977107007, -486.972752004295,
14.1972222707799, 3945.18165138827, -1804.92311597638, -16294.7963238582, 12938.4382517666,
34936.8560632273, -35279.9809333111, -37143.3119564404, 42615.2253829933, 15469.3464821173,
-19209.6601936326),
(0.565668684263799, -22.0905409279563, -38.4091710509871, 293.511446251903, 545.275057815115,
-720.44354068828, -3760.88424709001, -5089.99918489096, 16003.3924874616, 25589.698766999,
-38493.3441095934, -39356.6096286768, 46450.8254497365, 20395.9136498291, -21933.4124142929),
(1.16532761198991, -51.7391215234427, -381.755269178615, -32.7101894641581, 3369.55450426777,
5127.23437436548, -21136.6503135923, -18073.6377914781, 74062.0526429, -5789.13822668946,
-118940.080211014, 76845.1222746708, 70895.2988028299, -66662.7992068086),
(39.1264277228431, 178.852280249333, 385.861525271805, -2360.37274408206, -3709.74958470655,
9799.07281464002, 11922.1884857091, 20300.9164939639, -43546.9245140387, -111688.519154645,
99530.5395913908, 100870.215611039, -77741.3513312641),
(-107.688727209167, 671.1616987735, 3486.8365998403, -5490.54295998705, -8201.14433317617,
-8747.44484729223, 32953.9780537025, 79947.5538043892, -125545.837087359, -43630.6630486991,
117564.612074341, -68587.9778438351),
(-542.579395513657, -694.127070436048, -4002.76795570424, 8545.21848982909, 27090.8364557096,
-67721.4602183697, -27499.9973537989, 41458.4472367383, 62915.6016285334, 78670.2566925482,
-103823.64818823),
(938.566153782214, -3376.81887612043, -18714.5599644279, 39560.8563013042, -13069.8869131867,
-44730.0660108939, 70903.6879127463, -99393.2686117748, 66857.8449340984, 41664.741398192),
(3941.80927257479, 1871.44102977765, 18939.373722078, -16227.7207059114, -90680.8665931097,
200946.339273588, -25772.7440592024, -132163.002627868, -18734.6396183739),
(-3128.73580771816, 8298.01834882369, 56491.5279189711, -99958.1848838483, 86766.5262251444,
59483.7133013607, -225491.497475353, 97005.4924970518),
(-16787.1133679894, -4255.2020389011, -40431.2681894557, 16260.3110033012, 112561.978014488,
-233509.481879504, 190745.217911921),
(4082.17512694295, -10064.989027259, -88404.940239357, 109020.041841863, -85839.4160958866,
85576.6225847427),
(40779.0290256032, 6355.31113927979, 37088.9582233323, 100.760623963155, -45127.7122665389),
(-519.98688910179, 4114.04015854696, 54672.0399574955, -55082.2044967924),
(-51719.6086992777, -4342.43017871399, -9349.62841373934),
(-1842.82171081824, 2090.67663266304),
(26302.4860889623,)))
zone2 = dict(xs1=5796241.21486, ys1=4559496.99075, xs2=5796241.28401, ys2=4559496.86327, scale=3.66728281183833e-06,
n=16,
a=((0.228731583493221, -0.83507502512335, -4.75075686000639, 10.8038914670929, 43.8829085153604,
-202.534986003563, -77.7296366311854, 2045.56887502864, -1543.70034988768, -10301.3986475727,
11683.4155001934, 25759.9343361219, -34145.9786653603, -28511.2495687144, 42889.133129524,
8636.04493018048, -16507.5473691662),
(272681.374403635, 1.39106522968638, -39.1994853459564, -38.2172392121751, 545.188370675789,
441.620721665037, -3448.92091221744, -2412.11683272502, 11072.4879328657, 7699.82685793002,
-17517.1696526752, -16895.5954484799, 12334.3444729398, 22462.2087464689, -3644.53496996008,
-11239.5082188017),
(-1.46406132057298, -12.9095929000533, 154.093262354127, 259.333842984576, -2979.27186480526,
-2155.22875666815, 20935.0590121171, 9090.85242770349, -72609.1132063263, -15145.5654466028,
132937.237649498, -7598.19077884084, -108749.38025809, 33873.2487846931, 11643.4807395938),
(-5.35260152992147, 23.041269152846, 802.741484721726, -820.521411069936, -7906.64262200607,
3303.75239512937, 38157.7883736082, -12284.5266367827, -99740.9703569738, 49462.5310876064,
124023.569516367, -89671.1961159561, -53119.4299490336, 47409.3630490257),
(3.49355671619877, 260.520132389398, -1491.62462704938, -3518.79660480521, 26705.0443356283,
20643.8589713638, -148190.195974774, -65815.9114269092, 367408.36720726, 136453.07142972,
-457529.502607321, -124091.685690323, 259231.993418847),
(-22.6396721478248, 110.594710435516, -5474.87568889888, 14143.7689356105, 37726.9214017,
-55225.1292815242, -119181.020473803, 98914.9616796737, 214041.294077696, -144354.457998075,
-143426.218763131, 121214.334050684),
(-105.735131253011, -1842.42261357162, 4813.6192481545, 15168.7705497808, -92028.622317962,
-72447.6169805044, 414219.380932978, 80906.793658665, -675454.664623944, -34143.4235788143,
349207.354309134),
(1083.35285686214, -7857.39946015319, 20517.9801937215, -69721.8378182892, -97029.4163502617,
240119.771472591, 134344.1278388, -251480.927056388, -136115.475432122, 119252.345806415),
(1645.50028107547, 11708.814086942, -6320.66917064327, -14486.5472967527, 138833.416967521,
155661.513128572, -458114.577049222, -80962.0228539236, 447821.212756065),
(-11040.3369172076, 60753.1643301252, -40973.1332733948, 132173.106854139, 174857.981434494,
-435869.947107508, -23697.4696234044, 208701.197806923),
(-6029.41920596692, -67296.1280675679, 8081.03148285185, -67455.4541362549, -139323.627030419,
-126021.583768614, 116565.264108946),
(54416.0311349274, -175619.109854777, 13567.0698400514, -33471.0869886115, -182730.003051412,
303868.046609383),
(-8439.77821159702, 211657.644126192, 12444.7011589329, 131982.322979299, 157043.189307837),
(-129310.898964625, 160719.55404193, 56443.1306900499, -126188.583290023),
(78173.164005933, -248857.952944732, -72327.715709864),
(117603.94526439, 48078.9153621264),
(-103986.474138087,)),
b=((-0.17790390278591, 272681.153975298, 1.75924764736615, 5.88858766532695, 23.294593592258,
-102.086269214779, -362.851280352144, 905.299408659417, 1859.97793849185, -4567.22436064054,
-3516.28150607974, 11699.3899721707, -385.030339748609, -12154.8349522739, 6078.7207035075,
1605.61275533977, -1079.68929086334),
(0.0538636572929119, -3.22567879802384, 9.54443307242862, 77.6644330440756, -312.573094066126,
-858.316336271597, 3282.0965388489, 4628.32862975327, -17573.8956831237, -11264.7907202593,
51755.6821704897, 6685.8131514927, -80148.7416364156, 18959.6542275829, 51351.3686777859,
-26376.9656956979),
(2.69943310487417, -6.24055476443341, -78.8690577021475, -172.414900894466, 978.035965710725,
2686.52403002248, -4404.7687689219, -13717.6279416115, 1230.77017835036, 42591.0364834091,
29669.3262135633, -87834.942483855, -40945.1363284082, 82021.0354306714, -8398.195714527),
(10.5890028870228, 76.6769700246652, 119.58787191307, -475.676109326281, 820.566689726829,
1308.07947794481, -13405.6747025547, 2590.50969756053, 57401.1013320855, -41276.9176515614,
-110444.927574863, 115292.582443249, 84779.5512682162, -102896.030496197),
(-55.2741826622288, 228.244831848701, 824.013422754034, -65.9469361428355, -8687.3823450972,
-14645.4556593353, 62490.8860587348, 45885.5524543271, -176545.200271277, -27188.8799570159,
172421.531643634, -17067.8721999173, -24192.1412553827),
(-176.245972927429, -802.632184407917, -4055.86956575965, 2741.64404292142, 12780.161227794,
171.391738670898, 4801.36448549249, 5780.53296556223, -57249.6891558347, -4553.47547133654,
44869.9977294406, -14035.7094420162),
(550.063115339258, -2232.71353880275, -2558.43707402751, 14872.2198918242, -1007.7859797974,
30952.5866512858, -88838.1226975073, -137814.472186586, 320163.012036582, 80017.8613154015,
-250180.228834704),
(2039.67146860776, 5198.95907574643, 32959.881720952, -20473.9308561911, -93012.7549101258,
-26292.4294051939, 77019.2589639956, 55712.1466202591, 18134.9093228193, -333.69917805311),
(-3338.46388443148, 7893.74348619949, -1196.5779974879, -98650.2209808857, 105298.383566519,
48855.7975248435, -124808.809052216, 105452.113037432, -72095.8741337613),
(-14254.443735446, -18289.3733332739, -123244.5566694, 123250.592619467, 220861.283335322,
-10869.7965805172, -127246.521470703, -109980.010471928),
(15642.0283285456, 1070.49657798658, 38115.3974929019, 228756.551036186, -246146.536787096,
-150384.103063359, 219284.061964766),
(55085.5531882077, 17305.1609885236, 225865.542264588, -308105.703028341, -177493.708757484,
148921.629372764),
(-54515.1090178363, -57175.623462914, -119291.283056678, -169311.433508862, 189994.944251932),
(-108256.746561107, 53147.5393926198, -164816.480965274, 242000.558160495),
(110969.98169961, 80396.4148191858, 118170.451470773),
(84353.6839967164, -97810.7600994012),
(-92515.8553624398,)))
zone3 = dict(xs1=5970419.3611, ys1=3548547.29359, xs2=5970419.49328, ys2=3548547.30784, scale=3.76507921820784e-06,
n=16,
a=((0.0394317490691277, 0.264694417207604, -0.243661058513688, -7.89171810052402, 1.47678082534451,
68.2724196142012, 26.6765384566112, -297.699021068841, -174.187583786804, 661.292515832534,
358.524560615767, -652.728234802165, -161.612558704139, 126.596726115602, -295.389470651247,
117.316089964754, 261.678155330029),
(265598.243625884, 1.27835439529902, -2.11079048290442, -46.2632718720796, 182.07409341776,
457.622560352644, -1600.35151510111, -2478.64938881438, 6257.07643333071, 7640.92220073705,
-12673.7676941763, -13527.6715960227, 12955.6666382403, 12856.1620776727, -5296.18209837134,
-5082.51233179912),
(-7.30604410928229, -29.0960175819597, 130.767067632568, 428.351445779459, -745.074801947559,
-2762.75049484088, 1092.78199319907, 9921.24305399027, 3298.80772324941, -20050.0056083652,
-14256.4742974145, 20728.3461021051, 18743.2816013784, -8277.55617202204, -8332.22261577794),
(25.8692558784825, -121.450103245404, -566.466351559889, 1361.10236319158, 2127.70158876493,
-9077.81425985432, -916.892003051674, 31850.793485917, -8084.86594491156, -57682.9621118425,
15345.1440114766, 51504.4900843883, -8117.28354937371, -18085.820553153),
(203.956392189848, 800.916858152298, -2744.22359826371, -6735.01270233565, 15160.581507868,
23206.4804787997, -35614.723196171, -43026.2008444467, 39446.4150625021, 43780.2251585707,
-16846.6114218276, -21008.9845238279, -2152.99012392852),
(-521.543242365521, 2327.95192531639, 10755.9966880761, -14724.535751895, -43731.3367374824,
55597.9305846778, 67096.7771583739, -127303.158627194, -39892.3653132886, 152283.656013153,
3165.78977473953, -69842.7509160329),
(-2958.93721070821, -10222.0769156904, 27733.7359267114, 59139.0630623259, -116503.156654674,
-122972.864205834, 206185.846125843, 118888.320109139, -155724.884093941, -34844.0030501017,
45453.9291403869),
(4616.80703523765, -22430.7212959598, -77639.5604228108, 104805.127244844, 251957.577781749,
-214906.429045688, -290063.433038098, 209313.424522975, 113129.336369939, -94394.3892831857),
(22955.4676103835, 64966.9045685972, -159794.337132397, -276856.476212465, 486581.065411791,
340774.804258374, -596002.401196304, -176117.495137156, 237426.160563491),
(-22848.4950197044, 114030.971012745, 275261.816056998, -433142.2424538, -591564.565656148,
612175.690551669, 356261.090805626, -243434.448422892),
(-98895.1448829442, -208731.884500511, 509142.314431255, 639938.443722338, -1009562.93514131,
-331921.2647578, 622116.695189644),
(66526.8724272669, -306863.860299171, -488984.216202453, 817095.05126695, 483659.513467691,
-685473.12985755),
(232844.952724818, 311317.32048804, -810795.890138876, -586272.626015655, 815840.680797824),
(-107359.913612218, 432714.336094858, 360686.953144565, -508939.422401942),
(-273807.647243785, -151332.144497873, 481017.620714703),
(73493.7675544037, -281614.912325802),
(121134.062484301,)),
b=((0.158016496734093, 265598.39076651, -1.8189529303753, 5.76055382045113, 6.11704640977707,
-48.9455195738583, 27.6408407855172, 223.198732888009, -299.448874178793, -618.280942734813,
877.202720852586, 1054.80417758375, -1126.73626859378, -998.958258846427, 602.392288392793,
394.665096441229, -74.6195867668332),
(0.385158902821457, -2.1765923662043, -8.86460062732879, 17.8672029409063, 75.7080448619011,
83.1900325247942, -447.752699189373, -1100.21080781135, 1868.56282515073, 4077.88434623136,
-4195.98982684793, -7331.51693503329, 4480.66094159628, 6564.3047701056, -1792.68258083141,
-2331.78051719899),
(-0.65903901752414, 8.92247203142325, 84.9161513269786, -178.883723081001, -999.944638288182,
738.821193747988, 4195.47802975247, -1490.85595407381, -8403.78142169709, 2244.10476335045,
9269.54225731019, -2871.21727956723, -6444.83069690472, 1793.64362136494, 2544.08981176638),
(-20.3609764333141, -11.4581989774317, 355.814388292435, -391.129275446767, -1597.81540138042,
1447.04661909132, 1815.24263811904, 10.5609085821693, -370.575359646311, -5384.19865645293,
1215.81587468389, 8104.65468187712, -1645.01733905702, -3934.14608568389),
(43.2310304549134, -255.739801531042, -776.895006661254, 1819.37468022625, 10351.5049665987,
-1004.08956795243, -40813.5728939664, -8005.05458286162, 63821.3610399805, 16903.7742048267,
-37401.2531816369, -10085.9857441038, 4270.62299855401),
(417.184152041619, 378.429916805791, -4720.2117763894, 3439.18559660644, 18358.646143302,
-11593.2979829704, -11917.908497092, 627.618987252587, -15025.3784697864, 13403.555671533,
11749.0365076031, -8932.24804069065),
(-632.448667264149, 3927.10666664886, 1387.2296303115, -22223.2185199211, -38212.7290613659,
19548.4498727085, 161039.437504698, 4495.35027861952, -222717.138216446, -9369.53753590134,
92566.8305090767),
(-4659.4894764635, -3988.82787946153, 35749.9351885047, -23199.6769600546, -125978.437012817,
75345.5068659074, 95944.9009399249, -16068.5681275769, 2641.83154115468, -8711.59821399842),
(4411.10035829565, -29465.7192038468, 25469.9289583946, 146996.336422272, -32959.5091902216,
-118563.656592513, -128934.184611265, 23187.2078261822, 164339.566810191),
(29913.3133004414, 18186.7991663188, -141322.707282564, 109698.82884215, 392363.333687737,
-304424.659728467, -202919.595782643, 63159.5359534668),
(-19374.7626286957, 106561.626275796, -171133.949473897, -434362.985892606, 419703.32829859,
205648.516051347, -174064.81073325),
(-112062.380471308, -39000.0574488394, 267079.697308767, -249024.489004279, -423792.573917383,
448165.500864483),
(65038.6140768267, -174914.594735147, 405273.357248304, 461474.444407145, -582897.352956424),
(229520.94869571, 26793.4697118364, -191130.932223595, 186787.97767923),
(-151476.314752477, 96814.6552439394, -334512.662185077),
(-198359.381272105, 19680.6442535534),
(159976.528575583,)))
zone4 = dict(xs1=5619707.74836, ys1=3751470.26874, xs2=5619707.60717, ys2=3751470.35185, scale=3.38505646756076e-06,
n=16,
a=((0.0204540343240172, 0.146476681163776, -1.87256017564703, -33.1212688309607, 62.8475577270195,
673.616959380744, -551.665626863721, -7078.59012946101, 591.317561348168, 44454.1274758934,
20146.9691812488, -156720.564798369, -131379.787861285, 259150.430207571, 292935.793224739,
-113990.493397462, -161616.896314175),
(295417.655245046, 5.67780378592694, -22.1723054225227, -106.559871607833, 376.939041490336,
1332.35827193303, -3280.33969655172, -8381.63945937525, 19751.7871965764, 19244.1134916069,
-110899.675409493, -15569.0548720212, 411023.33586251, 150336.508051628, -603955.744437522,
-448989.747745394),
(0.266681393273026, -22.0942414637153, -67.6617131494065, 899.156511530243, 610.25868423774,
-9583.0997236414, -4632.38505679995, 46823.5800882069, 31755.8061427381, -146228.251860286,
-120233.184770457, 339498.961459187, 301510.104651843, -408288.483551702, -408886.444120634),
(-10.7417445149641, -49.043538779508, 721.74629700642, 1466.65826843912, -10213.1384054431,
-17104.7474501801, 48581.5016610254, 126362.444870091, -53998.3320854527, -429647.823813412,
-143495.535633072, 565398.175176551, 231746.530991258, -229723.290357521),
(-8.89394065884397, 419.45214076664, 1397.66120736812, -12661.7875527113, -12172.031983997,
100119.112062537, 63212.879137356, -306128.725206416, -311452.756580354, 405611.216647949,
710587.887780257, -264018.733382589, -644975.219105233),
(40.3416019529026, -102.551200847831, -8309.72379386936, -4626.32678060001, 109892.409177561,
11913.958327257, -462548.354225605, -158348.093082701, 711629.518420645, 597384.086724301,
-259391.312459085, -475134.49929998),
(-68.7617998859722, -3546.48442591939, -6333.25733171985, 91846.647107402, 16014.7644138906,
-548896.077624946, 103120.233851932, 1108087.3420194, -17293.6705174939, -637040.284098711,
-153268.418245483),
(-46.4899372130174, 3438.76907750638, 44507.052254577, -13248.166609868, -478253.561763578,
310846.793229086, 1379923.75061195, -660791.746416363, -1137031.8534407, 220892.309344653),
(1375.71868761237, 14513.9221102723, 3115.85053094465, -320313.139781786, 158846.165599261,
1320463.1382316, -1008828.8065733, -1377389.99120043, 825979.546035765),
(-92.6740642938488, -20925.6684962154, -121575.470120746, 112350.055235288, 933258.372821566,
-1097481.66628526, -1367783.5673407, 1316535.11398493),
(-7450.52065127814, -30231.6502492622, 41942.1783906582, 517793.944280073, -549574.579513799,
-1117714.72677115, 1333941.71930995),
(124.665298990635, 61109.0208893179, 162252.945432621, -233184.416982572, -672550.537255878,
1084250.11201824),
(19603.6978278722, 31156.146870089, -97698.302363219, -313040.469916658, 498602.022718624),
(564.032798980809, -89066.0209314543, -83078.4945236301, 156949.711634442),
(-26168.2333393948, -12773.1987526824, 63945.5199728465),
(-894.751204108209, 51710.9878218922),
(14230.7854765801,)),
b=((-0.0304947711180302, 295416.356978541, 6.63651763827379, 7.96200032772045, -40.4750649713769,
-165.628041368287, -1255.73776472927, -407.047840133986, 18838.645986275, 23397.432239245,
-102314.844302167, -178732.52409473, 225973.448048727, 570645.130222507, -45647.258154817,
-687422.363043845, -373992.043959041),
(0.473577860775177, 7.16478003080618, -29.1003384550884, -104.207636171005, 218.644464839587,
-193.110752627344, 601.082101288506, 16501.1774095042, -4190.2633902753, -142515.181156576,
-69318.5948685002, 475281.717324643, 491982.850411882, -469977.699608368, -860133.96122966,
-316753.91062453),
(1.82423398658708, -14.8296151870063, -140.556546206177, 376.245945551595, 2691.94214646786,
685.01311344957, -14449.6055884011, -37334.7768211023, -12726.1514342108, 194804.1501905,
302377.930802829, -310318.737694354, -720632.280396714, 31191.497580247, 362799.614341676),
(-2.5064627163788, -77.7834650682999, 821.406273039275, 2088.48197612861, -10036.4480346444,
-21054.6906921509, 34468.4227616837, 84376.7252073482, 50132.2113055323, -47115.4867543176,
-430456.772666687, -440308.950492899, 513580.480164424, 659911.32611059),
(-1.89336277087358, 141.899977012171, 548.017712592498, -10297.16934801, -16581.1669969149,
77396.2524321472, 119658.04086666, -152707.184863969, -315742.467903365, -153193.660771471,
104518.033637697, 516327.441331218, 452943.589418941),
(-134.531845279448, 264.227594821306, -6820.84998744046, -6008.11602609008, 96012.0222184547,
57612.6697445171, -438333.643464504, -269951.589130893, 660451.520854841, 508460.36200969,
-117914.426048098, -110571.805640977),
(4.47683122337017, 682.762707565456, 2195.5112017912, 61148.6082579874, 3637.80700551875,
-474094.687796072, -44744.6442230922, 1108139.17331228, 186049.318094723, -714531.523429283,
-217650.406028746),
(1943.67129688726, -1031.43224858038, 21363.7274988913, -11623.4796009532, -332207.574703903,
154574.112422974, 1254515.77392174, -430403.463214368, -1282361.9746875, 152659.117941869),
(-902.57773595235, -11716.6328059824, -15749.7900441116, -139955.687309638, 154684.322176797,
981665.151924003, -728262.091152075, -1358769.95946293, 868908.129782147),
(-10905.9946417969, 9497.81134470591, -17222.3974428106, 59638.5769419576, 483062.290930296,
-647613.231717776, -1099791.46998906, 1214069.98597467),
(7462.02906326583, 47605.7428706419, 17616.5908923865, 112971.300245285, -322549.394271768,
-682834.145141876, 946696.137179195),
(30023.1969806917, -41975.6381068202, -32489.5835695015, -44507.763109882, -241548.020596188,
522325.068395097),
(-24251.0703767501, -80155.633759083, 30410.4965944266, -2034.78372551399, 173901.908240068),
(-40323.0111289238, 77874.4358868488, 47539.9109376033, -20540.6105174761),
(35555.884858645, 49132.6508986424, -50405.7981710473),
(21117.7214878747, -51805.8159439036),
(-19589.6113390362,)))
zone5 = dict(xs1=908670.18005, ys1=244104.06678, xs2=908669.91787, ys2=244104.09992, scale=4.6860488749539e-06,
n=12,
a=((-0.230398038123317, 0.226662587128039, 0.941858005334338, 3.40165051388657, 2.4295171983081,
0.444811596952778, -7.4135475265052, -104.962983549537, -38.7601831525559, 355.566482595998,
176.963176163799, -353.457222568284, -196.83092676068),
(213399.142272135, 2.52298125804754, 0.957152868513868, -40.8408670405506, -24.0828594558215,
162.96785132633, 47.3915957877667, -229.519630617248, 96.7149141024427, -70.9615919225919,
-167.747997087565, 372.173900856009),
(0.870880291516432, 14.0397512262457, -15.8748752481587, -164.347926026472, 149.993773934325,
666.112675466837, -323.241635043409, -1159.58734113412, -48.3036925706717, 765.674823729184,
379.714031440476),
(5.18144137959836, -30.4531459753734, -61.9836206910632, 557.519316040317, 606.844093457991,
-2256.81234910624, -1509.03743921533, 3465.06748275629, 1113.83401359767, -2184.12296098602),
(6.75376339709904, -93.6634192519636, 248.02546078631, 664.318541819564, -2601.76122875056,
-753.024729062476, 5590.2363188659, -655.03290876623, -2329.85393233233),
(-10.0937913929906, 170.216983343877, 38.6346136946603, -3152.24711377335, 1170.03481582047,
8117.61263659066, -5718.36072241703, -753.4028699459),
(-63.7871473815282, 122.254817065802, -1173.15246957151, 1270.94424077749, 6533.32692920741,
-10544.3171101135, 2518.26390630371),
(-51.9015154918366, -395.565035888363, 1497.22998632336, 5072.1438363884, -10727.3657500614,
4410.60273333083),
(266.788269040781, 479.064604272793, 1021.00419736666, -6361.34421714572, 4838.7655790132),
(225.620174836955, -23.8619422080611, -3295.61908646449, 2199.0928378665),
(-562.850760808871, -1068.25719087714, 1778.19184138931),
(-250.471850812113, 869.974960769008),
(484.483757206335,)),
b=((-0.0633650327433464, 213398.686655655, 0.0166594895853337, 1.78692598125613, -19.4963962724919,
1.73108631022754, 234.552331618276, -72.9876696801173, -1069.91201142195, 280.596822813205,
2140.51748655277, -310.984528206946, -1582.96629881821),
(-0.368705856503215, -2.1573275255208, 2.97535766811737, 2.92386839736555, -96.5734399090614,
168.89161211651, 672.353368650412, -1152.45753959194, -1563.24150386905, 2810.68374153912,
1138.7567802567, -2407.98348063233),
(1.14033581971448, 3.14881879278394, -20.8484580635096, -57.6322267815159, 46.0531958884688,
715.504256419437, -379.854904878596, -2442.78048853158, 2235.13082207094, 2420.45678012233,
-3130.2510580095),
(7.32835046183752, 6.02900004224543, -65.5484752083356, -28.3326034480797, 272.537360023463,
-364.637215882468, -2161.74413844023, 2704.88209968377, 3717.91811195764, -3844.09742887803),
(4.32560931707826, -29.8797186055018, 353.515287049345, 0.304566853255295, -1138.72369616618,
-932.871605218691, 2021.76962857847, 2552.88259449191, -2492.37532143793),
(-64.9467792841881, 39.9588266353888, 511.014826397263, -563.094433523491, 980.812561989761,
1423.65545346639, -2617.86524224399, -1342.89403142206),
(-80.4698714284484, 223.677069994556, -1779.06743250939, 1340.8015054971, 3002.65489041932,
-5079.86177606707, 1949.55666179232),
(255.304915453624, -313.250403092031, -1207.13420254279, 1070.56511971342, -3711.82611819885,
4133.77477108104),
(337.316280113908, -711.14142631117, 3371.80030458375, -2095.98039298347, 388.860905563902),
(-475.900728998441, 836.023524954295, 911.911934764994, 21.7681733213367),
(-550.111842397697, 724.71563984009, -2219.70803920797),
(349.475805495426, -789.684049078998),
(293.063936563975,)))
if __name__ == '__main__':
from sys import argv as sys_argv, exit as sys_exit
def usage():
me = sys_argv[0]
print('\nUsage:')
print(' ', me, 'x y n r\n')
print("Where:"
"\n x: source PUWG 1965 x coordinate"
"\n y: source PUWG 1965 y coordinate"
"\n n: PUWG 1965 zone number (1, 2, 3, 4 or 5)"
"\n r: source coordinates type - \"T\"heoretical, \"E\"mpirical\n"
"\nExample:"
"\n Converting theoretical coordinates to empirical in zone 1:")
print(' ', me, '5467000 4637000 1 T\n')
if (len(sys_argv) < 5) or 'h' in ''.join(sys_argv[1:]):
usage()
sys_exit()
# sys.argv provides numbers as strings. Convert as needed:
x1 = float(sys_argv[1])
y1 = float(sys_argv[2])
zone = 'zone' + sys_argv[3]
it = sys_argv[4]
if it == 'E':
transformer = Transformation(EmpirToTheor, zone)
if it == 'T':
transformer = Transformation(TheorToEmpir, zone)
# Why does "'{[0]:.5f} {[1]:.5f}'.format(transformer.transform())" return "IndexError: tuple index out of range"?
# "'{[0]:.5f}'.format()" and "'{[1]:.5f}'.format()" individually work fine... Unpacking the tuple with "*" until
# that's sorted out.
print('{:.5f} {:.5f}'.format(*transformer.transform(x1, y1)))