From c88cb140ce7742ca43d900f7d5a7ede60530cc01 Mon Sep 17 00:00:00 2001 From: Jonathon Smith Date: Thu, 10 Feb 2022 16:00:36 +1100 Subject: [PATCH 1/6] define ISG as an instance of a Projection object --- geodepy/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/geodepy/constants.py b/geodepy/constants.py index 00302fa..dcab5d7 100644 --- a/geodepy/constants.py +++ b/geodepy/constants.py @@ -66,6 +66,7 @@ def __init__(self, falseeast, falsenorth, cmscale, zonewidth, initialcm): utm = Projection(500000, 10000000, 0.9996, 6, -177) +isg = Projection(300000, 5000000, 0.99994, 2, -177) # Helmert 14 parameter transformation From 740537b710764ed49d7737d833954ba8c26938d8 Mon Sep 17 00:00:00 2001 From: Jonathon Smith Date: Thu, 10 Feb 2022 16:10:50 +1100 Subject: [PATCH 2/6] add prj as a parameter to: - def psfandgridconv() - def geo2grid() - def grid2geo() replace all references to 'proj' with function parameter 'prj' in the above functions. add exception if ISG selected as projection without ANS as ellipsoid. add to 'Invalid Zone' exceptions to include ISG zones. add zone and CM calculations for ISG to def geo2grid add CM calculations for ISG to def grid2geo --- geodepy/convert.py | 72 ++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/geodepy/convert.py b/geodepy/convert.py index 82bf8b7..ae36ff7 100644 --- a/geodepy/convert.py +++ b/geodepy/convert.py @@ -8,7 +8,7 @@ from math import (sin, cos, atan2, radians, degrees, sqrt, cosh, sinh, tan, atan, log) import datetime -from geodepy.constants import utm, grs80 +from geodepy.constants import utm, isg, grs80, ans from geodepy.angles import (DECAngle, HPAngle, GONAngle, DMSAngle, DDMAngle, dec2hp, dec2hpa, dec2gon, dec2gona, dec2dms, dec2ddm, @@ -19,11 +19,6 @@ dd2sec, angular_typecheck) -# Universal Transverse Mercator Projection Parameters -# TODO: Add this part into functions: geo2grid, grid2geo, psfandgridconv -proj = utm - - def polar2rect(r, theta): """ Converts point in polar coordinates to corresponding rectangular coordinates @@ -240,7 +235,7 @@ def beta_coeff(ellipsoid): return b2, b4, b6, b8, b10, b12, b14, b16 -def psfandgridconv(xi1, eta1, lat, lon, cm, conf_lat, ellipsoid=grs80): +def psfandgridconv(xi1, eta1, lat, lon, cm, conf_lat, ellipsoid=grs80, prj=utm): """ Calculates Point Scale Factor and Grid Convergence. Used in convert.geo2grid and convert.grid2geo @@ -270,7 +265,7 @@ def psfandgridconv(xi1, eta1, lat, lon, cm, conf_lat, ellipsoid=grs80): p += 2*r * a[r-1] * cos(2*r * xi1) * cosh(2*r * eta1) q += 2*r * a[r-1] * sin(2*r * xi1) * sinh(2*r * eta1) q = -q - psf = (float(proj.cmscale) + psf = (float(prj.cmscale) * (A / ellipsoid.semimaj) * sqrt(q**2 + p**2) * ((sqrt(1 + (tan(lat)**2)) @@ -289,7 +284,7 @@ def psfandgridconv(xi1, eta1, lat, lon, cm, conf_lat, ellipsoid=grs80): return psf, grid_conv -def geo2grid(lat, lon, zone=0, ellipsoid=grs80): +def geo2grid(lat, lon, zone=0, ellipsoid=grs80, prj=utm): """ Takes a geographic co-ordinate (latitude, longitude) and returns its corresponding Hemisphere, Zone and Projection Easting and Northing, Point @@ -314,8 +309,12 @@ def geo2grid(lat, lon, zone=0, ellipsoid=grs80): lon = angular_typecheck(lon) # Input Validation - UTM Extents and Values zone = int(zone) - if zone < 0 or zone > 60: - raise ValueError('Invalid Zone - Zones from 1 to 60') + if prj == isg: + if zone not in (0, 541, 542, 543, 551, 552, 553, 561, 562, 563): + raise ValueError('Invalid Zone - Choose from 541, 542, 543, 551, 552, 553, 561, 562, 563') + else: + if zone < 0 or zone > 60: + raise ValueError('Invalid Zone - Zones from 1 to 60') if lat < -80 or lat > 84: raise ValueError('Invalid Latitude - Latitudes from -80 to +84') @@ -323,14 +322,27 @@ def geo2grid(lat, lon, zone=0, ellipsoid=grs80): if lon < -180 or lon > 180: raise ValueError('Invalid Longitude - Longitudes from -180 to +180') + if prj == isg and ellipsoid != ans: + raise ValueError('Invalid ellipsoid for chosen projection') + A = rect_radius(ellipsoid) a = alpha_coeff(ellipsoid) lat = radians(lat) # Calculate Zone if zone == 0: - zone = int((float(lon) - ( - proj.initialcm - (1.5 * proj.zonewidth))) / proj.zonewidth) - cm = float(zone * proj.zonewidth) + (proj.initialcm - proj.zonewidth) + if prj == isg: + amgzone = (float(lon) - (prj.initialcm - (4.5 * prj.zonewidth))) / (prj.zonewidth * 3) + subzone = int((amgzone - int(amgzone)) * 3 + 1) + amgzone = int(amgzone) + zone = int(f'{amgzone}{subzone}') + else: + zone = int((float(lon) - (prj.initialcm - (1.5 * prj.zonewidth))) / prj.zonewidth) + if prj == isg: + amgzone = int(str(zone)[:2]) + subzone = int(str(zone)[2]) + cm = float((amgzone - 1) * prj.zonewidth * 3 + prj.initialcm + (subzone - 2) * prj.zonewidth) + else: + cm = float(zone * prj.zonewidth + prj.initialcm - prj.zonewidth) # Conformal Latitude sigx = (ellipsoid.ecc1 * tan(lat)) / sqrt(1 + (tan(lat) ** 2)) @@ -357,14 +369,14 @@ def geo2grid(lat, lon, zone=0, ellipsoid=grs80): y = A * xi # Hemisphere-dependent UTM Projection Co-ordinates - east = proj.cmscale * x + proj.falseeast + east = prj.cmscale * x + prj.falseeast if y < 0: hemisphere = 'South' - north = proj.cmscale * y + proj.falsenorth + north = prj.cmscale * y + prj.falsenorth else: hemisphere = 'North' falsenorth = 0 - north = proj.cmscale * y + falsenorth + north = prj.cmscale * y + falsenorth # Point Scale Factor and Grid Convergence psf, grid_conv = psfandgridconv(xi1, eta1, degrees(lat), lon, cm, conf_lat) @@ -375,7 +387,7 @@ def geo2grid(lat, lon, zone=0, ellipsoid=grs80): round(psf, 8), grid_conv) -def grid2geo(zone, east, north, hemisphere='south', ellipsoid=grs80): +def grid2geo(zone, east, north, hemisphere='south', ellipsoid=grs80, prj=utm): """ Takes a Transverse Mercator grid co-ordinate (Zone, Easting, Northing, Hemisphere) and returns its corresponding Geographic Latitude and Longitude, @@ -393,8 +405,12 @@ def grid2geo(zone, east, north, hemisphere='south', ellipsoid=grs80): """ # Input Validation - UTM Extents and Values zone = int(zone) - if zone < 0 or zone > 60: - raise ValueError('Invalid Zone - Zones from 1 to 60') + if prj == isg: + if zone not in (541, 542, 543, 551, 552, 553, 561, 562, 563): + raise ValueError('Invalid Zone - Choose from 541, 542, 543, 551, 552, 553, 561, 562, 563') + else: + if zone < 0 or zone > 60: + raise ValueError('Invalid Zone - Zones from 1 to 60') if east < -2830000 or east > 3830000: raise ValueError('Invalid Easting - Must be within' @@ -407,15 +423,18 @@ def grid2geo(zone, east, north, hemisphere='south', ellipsoid=grs80): if h != 'north' and h != 'south': raise ValueError('Invalid Hemisphere - String, either North or South') + if prj == isg and ellipsoid != ans: + raise ValueError('Invalid ellipsoid for chosen projection') + A = rect_radius(ellipsoid) b = beta_coeff(ellipsoid) # Transverse Mercator Co-ordinates - x = (east - float(proj.falseeast)) / float(proj.cmscale) + x = (east - float(prj.falseeast)) / float(prj.cmscale) if hemisphere.lower() == 'north': - y = -(north / float(proj.cmscale)) + y = -(north / float(prj.cmscale)) hemisign = -1 else: - y = (north - float(proj.falsenorth)) / float(proj.cmscale) + y = (north - float(prj.falsenorth)) / float(prj.cmscale) hemisign = 1 # Transverse Mercator Ratios @@ -463,7 +482,12 @@ def f1tn(tn, ecc1, ecc1sq): lat = degrees(atan(t)) # Compute Longitude - cm = float((zone * proj.zonewidth) + proj.initialcm - proj.zonewidth) + if prj == isg: + amgzone = int(str(zone)[:2]) + subzone = int(str(zone)[2]) + cm = float((amgzone - 1) * prj.zonewidth * 3 + prj.initialcm + (subzone - 2) * prj.zonewidth) + else: + cm = float((zone * prj.zonewidth) + prj.initialcm - prj.zonewidth) long_diff = degrees(atan(sinh(eta1) / cos(xi1))) long = cm + long_diff From 5de454ee9f7adcbb84a2fa0c3e071d27f9eefd94 Mon Sep 17 00:00:00 2001 From: Jonathon Smith Date: Thu, 17 Feb 2022 08:51:44 +1100 Subject: [PATCH 3/6] use the warnings module to warn about mismatch between ISG projection and chosen ellipsoid, instead of raising an exception add zone 572 (Lord Howe Island) to the allowable zones for ISG --- geodepy/convert.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/geodepy/convert.py b/geodepy/convert.py index ae36ff7..040e12f 100644 --- a/geodepy/convert.py +++ b/geodepy/convert.py @@ -8,6 +8,7 @@ from math import (sin, cos, atan2, radians, degrees, sqrt, cosh, sinh, tan, atan, log) import datetime +import warnings from geodepy.constants import utm, isg, grs80, ans from geodepy.angles import (DECAngle, HPAngle, GONAngle, DMSAngle, DDMAngle, dec2hp, dec2hpa, dec2gon, dec2gona, @@ -310,8 +311,8 @@ def geo2grid(lat, lon, zone=0, ellipsoid=grs80, prj=utm): # Input Validation - UTM Extents and Values zone = int(zone) if prj == isg: - if zone not in (0, 541, 542, 543, 551, 552, 553, 561, 562, 563): - raise ValueError('Invalid Zone - Choose from 541, 542, 543, 551, 552, 553, 561, 562, 563') + if zone not in (0, 541, 542, 543, 551, 552, 553, 561, 562, 563, 572): + raise ValueError('Invalid Zone - Choose from 541, 542, 543, 551, 552, 553, 561, 562, 563, 572') else: if zone < 0 or zone > 60: raise ValueError('Invalid Zone - Zones from 1 to 60') @@ -323,7 +324,7 @@ def geo2grid(lat, lon, zone=0, ellipsoid=grs80, prj=utm): raise ValueError('Invalid Longitude - Longitudes from -180 to +180') if prj == isg and ellipsoid != ans: - raise ValueError('Invalid ellipsoid for chosen projection') + warnings.warn(message='ISG projection should be used with ANS ellipsoid', category=UserWarning) A = rect_radius(ellipsoid) a = alpha_coeff(ellipsoid) @@ -406,8 +407,8 @@ def grid2geo(zone, east, north, hemisphere='south', ellipsoid=grs80, prj=utm): # Input Validation - UTM Extents and Values zone = int(zone) if prj == isg: - if zone not in (541, 542, 543, 551, 552, 553, 561, 562, 563): - raise ValueError('Invalid Zone - Choose from 541, 542, 543, 551, 552, 553, 561, 562, 563') + if zone not in (541, 542, 543, 551, 552, 553, 561, 562, 563, 572): + raise ValueError('Invalid Zone - Choose from 541, 542, 543, 551, 552, 553, 561, 562, 563, 572') else: if zone < 0 or zone > 60: raise ValueError('Invalid Zone - Zones from 1 to 60') @@ -424,7 +425,7 @@ def grid2geo(zone, east, north, hemisphere='south', ellipsoid=grs80, prj=utm): raise ValueError('Invalid Hemisphere - String, either North or South') if prj == isg and ellipsoid != ans: - raise ValueError('Invalid ellipsoid for chosen projection') + warnings.warn(message='ISG projection should be used with ANS ellipsoid', category=UserWarning) A = rect_radius(ellipsoid) b = beta_coeff(ellipsoid) From 4aa33ab538ba998e8f656f642ad0748a57224120 Mon Sep 17 00:00:00 2001 From: Jonathon Smith Date: Thu, 17 Feb 2022 10:14:32 +1100 Subject: [PATCH 4/6] add def test_geo_grid_interoperability_isg() to test ISG functionality add tests to def test_geo2grid() and def test_grid2geo() to test: - ValueError raised for incorrect ISG zone - UserWarning raised for prj/ellipsoid combination for ISG that isn't recommended --- geodepy/tests/test_convert.py | 36 ++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/geodepy/tests/test_convert.py b/geodepy/tests/test_convert.py index f0b68c1..8f96ae2 100644 --- a/geodepy/tests/test_convert.py +++ b/geodepy/tests/test_convert.py @@ -3,6 +3,7 @@ import datetime import numpy as np from geodepy.fileio import read_dnacoord +from geodepy.constants import grs80, ans, isg from geodepy.convert import (dec2hp, hp2dec, DMSAngle, DDMAngle, dec2dms, dec2ddm, hp2dms, hp2ddm, dd2sec, yyyydoy_to_date, date_to_yyyydoy, grid2geo, @@ -80,6 +81,28 @@ def test_geo_grid_transform_interoperability(self): np.array(test_grid_coords[['east', 'north']].tolist()), decimal=3) + def test_geo_grid_transform_interoperability_isg(self): + abs_path = os.path.abspath(os.path.dirname(__file__)) + test_geo_coords = np.genfromtxt(os.path.join(abs_path, 'resources/Test_Conversion_ISG_Geo.csv'), + delimiter=',', + dtype='S4,f8,f8', + names=['site', 'lat', 'lon']) + + test_grid_coords = np.genfromtxt(os.path.join(abs_path, 'resources/Test_Conversion_ISG_Grid.csv'), + delimiter=',', + dtype='S4,i4,f8,f8', + names=['site', 'zone', 'east', 'north']) + + geoed_grid = np.array(list(grid2geo(*x, ellipsoid=ans, prj=isg) for x in test_grid_coords[['zone', 'east', 'north']])) + np.testing.assert_almost_equal(geoed_grid[:, :2], np.array(test_geo_coords[['lat', 'lon']].tolist()), + decimal=8) + + gridded_geo = np.stack(geo2grid(*x, ellipsoid=ans, prj=isg) for x in np.array(test_geo_coords[['lat', 'lon']].tolist())) + np.testing.assert_almost_equal(gridded_geo[:, 2:4].astype(float), + np.array(test_grid_coords[['east', 'north']].tolist()), + decimal=3) + + def test_llh2xyz(self): # Test of single point @@ -197,6 +220,12 @@ def test_geo2grid(self): geo2grid(0, -181, 0) with self.assertRaises(ValueError): geo2grid(0, 181, 0) + # test ValueError raised if not a valid ISG zone + with self.assertRaises(ValueError): + grid2geo(zone=530, east=300000, north=1500000, ellipsoid=ans, prj=isg) + # test UserWarning raised if prj/ellipsoid combination isn't recommended + with self.assertWarns(UserWarning): + grid2geo(zone=551, east=300000, north=1500000, ellipsoid=grs80, prj=isg) def test_grid2geo(self): abs_path = os.path.abspath(os.path.dirname(__file__)) @@ -233,7 +262,12 @@ def test_grid2geo(self): grid2geo(0, 0, 10000001) with self.assertRaises(ValueError): grid2geo(0, 0, 500000, 'fail') - + # test ValueError raised if not a valid ISG zone + with self.assertRaises(ValueError): + grid2geo(zone=530, east=300000, north=1500000, ellipsoid=ans, prj=isg) + # test UserWarning raised if prj/ellipsoid combination isn't recommended + with self.assertWarns(UserWarning): + grid2geo(zone=551, east=300000, north=1500000, ellipsoid=grs80, prj=isg) if __name__ == '__main__': unittest.main() From b1006190a0a97c357b0e1487deff898baac905cf Mon Sep 17 00:00:00 2001 From: Jonathon Smith Date: Fri, 18 Feb 2022 12:43:37 +1100 Subject: [PATCH 5/6] test data for ISG<>AGD66 interoperability --- .../resources/Test_Conversion_ISG_Geo.csv | 212 ++++++++++++++++++ .../resources/Test_Conversion_ISG_Grid.csv | 212 ++++++++++++++++++ 2 files changed, 424 insertions(+) create mode 100644 geodepy/tests/resources/Test_Conversion_ISG_Geo.csv create mode 100644 geodepy/tests/resources/Test_Conversion_ISG_Grid.csv diff --git a/geodepy/tests/resources/Test_Conversion_ISG_Geo.csv b/geodepy/tests/resources/Test_Conversion_ISG_Geo.csv new file mode 100644 index 0000000..fc1b523 --- /dev/null +++ b/geodepy/tests/resources/Test_Conversion_ISG_Geo.csv @@ -0,0 +1,212 @@ +ALBU,-36.079078850050,146.914301020650, +ANNA,-32.786387375840,152.085197007870, +ARD2,-30.522463664480,151.673569431060, +ARDL,-34.352400821090,146.902223561530, +ARMD,-30.516201910320,151.664711111400, +ASHF,-29.325939194990,151.092033399130, +BALN,-28.874270142210,153.563020333320, +BANK,-33.916653008040,151.035165581320, +BARR,-34.565756130890,150.857174374750, +BATH,-33.431260053750,149.566032786600, +BBDH,-32.343426762120,146.652773125790, +BDST,-27.988693001490,152.994004422590, +BEGA,-36.677477042550,149.840791166900, +BERM,-36.432192532390,150.074756654240, +BIGG,-36.282304606530,148.024989032530, +BING,-32.413362673700,151.651193214890, +BJCT,-30.103225969580,148.963030107990, +BKNL,-31.997804118910,141.468816141530, +BLCK,-31.655869939440,150.243563220700, +BLKT,-33.773325128960,150.907625503660, +BLRN,-34.647376511190,143.566122032320, +BNDC,-37.149042056380,148.883670791220, +BOMB,-36.913603745640,149.235862495550, +BOOR,-34.439875740910,148.700493741500, +BORA,-31.513812898990,150.639630095520, +BRBA,-30.381927466300,150.606159279950, +BRDW,-35.448057820140,149.783983323290, +BRWN,-29.969962049740,146.859629830410, +BUND,-30.186693592420,151.088547277780, +BURK,-30.096818183800,145.933090647440, +CANR,-37.566417946260,149.156254776660, +CARG,-33.289969788060,146.364698024680, +CBAR,-31.515200953450,145.834937112410, +CBLE,-30.955106664800,148.377054074800, +CBRA,-35.913536753510,145.642887120900, +CBRM,-35.913730019200,145.644123289160, +CESS,-32.836839479180,151.355424238120, +CHCC,-30.296949944770,153.116452056710, +CHIP,-33.888468395020,151.200058446270, +CHSM,-35.419814372640,149.119590268640, +CKWL,-34.457633734950,149.471319973730, +CLAH,-31.832023492750,149.713778172590, +CLBI,-29.544125834720,148.584346163510, +CMDN,-34.047855394520,150.690349966570, +CNBN,-31.334889140090,149.268408606510, +CNDA,-30.466878337590,147.686954814500, +CNDO,-33.086709612700,147.149791898160, +CNWD,-35.207947226360,149.031553277260, +COBH,-30.808623541220,146.779606564930, +COFF,-30.301715186760,153.137240133770, +COLE,-34.808511810850,145.878982178890, +COMA,-36.236931036870,149.126002278100, +COPS,-29.582469259810,152.772422029060, +CRDX,-34.326381899560,150.766395626120, +CSNO,-28.867168234440,153.046492333440, +CTMD,-34.640854520510,148.024428846600, +CWN2,-33.595280843160,151.170401310160, +CWRA,-33.832803699280,148.701112901410, +DBBO,-32.250934874890,148.600941240150, +DKSN,-35.252310013350,149.134522098020, +DLQN,-35.533143342320,144.963344877280, +DORR,-30.351968626410,152.711936850130, +DUNE,-32.013429920710,149.387007128460, +DWHY,-33.752851019060,151.285837551170, +ECHU,-36.141836503430,144.752294114480, +ECOR,-34.377194893520,150.909653507890, +EDEN,-37.073313317370,149.908099186570, +EMMD,-31.667875248990,144.284531118480, +FLGP,-31.106188458550,141.726864221780, +FORB,-33.386823485560,148.005764467050, +FORS,-32.202710872290,152.521279912290, +FTDN,-33.856641888470,151.224090214610, +GABO,-37.569690473100,149.913973093290, +GERR,-34.747858820360,150.826503806750, +GFEL,-33.894580785140,148.159517594830, +GFTH,-34.287847702910,146.035544915810, +GFTN,-29.694628189700,152.931812918630, +GILG,-31.712549375050,148.661286333990, +GLB2,-34.747981834810,149.709950157180, +GLBN,-34.757258766220,149.716521170260, +GLIN,-29.745140339400,151.750555070350, +GNGN,-35.186526813120,149.129325278390, +GNOA,-37.478456864560,149.588255913920, +GONG,-34.428798726090,150.897673735630, +GOOL,-33.986013365380,145.705699947480, +GUNN,-30.979748133500,150.255136195760, +GURL,-29.736374729300,149.794397024980, +GWAB,-30.607217796500,148.970055985540, +HAY1,-34.507065605300,144.851186647770, +HERN,-30.328217372130,152.485758066980, +HILL,-33.486454175090,145.530098471910, +HLB2,-35.712778654860,147.316222432940, +HLBK,-35.725922870950,147.316155284490, +HNSB,-33.701901431810,151.096493086520, +IHOE,-32.865662241970,143.490795121490, +INVL,-29.778008344970,151.113275953640, +IRYM,-34.221226895810,142.189912111170, +IVH2,-32.884967999620,144.307617640270, +JERI,-35.356857921110,145.724204898170, +KIRR,-34.044934188350,151.071899350910, +KNCB,-33.482823083220,151.390789830280, +KRNG,-35.736914809100,143.921006923710, +KTMB,-33.697374117700,150.317020257580, +KULW,-32.327731173920,145.008613436410, +KURJ,-33.555848060380,150.664437736660, +LGOW,-33.482521885170,150.158662459500, +LIPO,-34.106879828990,141.009902661120, +LIRI,-29.431299550670,147.981730153680, +LKHT,-35.228801969070,146.704570180350, +LORD,-31.521522180960,159.060201939740, +LOTH,-30.535051650830,145.115609446820, +MACK,-30.712034649050,152.917284371330, +MENA,-34.127673092760,150.742585967250, +MENO,-34.273855325240,141.805322115080, +MGRV,-33.628099764890,150.829824546440, +MHOP,-32.921796300530,145.910784251350, +MNDE,-32.394328297570,142.416650264410, +MNPK,-33.173075032630,151.549959133970, +MOGO,-35.748958806400,150.190785610250, +MOUL,-35.092564428440,144.034741161740, +MREE,-29.459300454610,149.824413821780, +MRWA,-32.141340244110,150.354104895070, +MSV2,-34.550684444020,150.372985351130, +MSVL,-34.552112656670,150.372214490690, +MTHR,-32.617018805550,151.097961971100, +MTLD,-32.738569519450,151.559156812120, +MUDG,-32.591572907010,149.583509963220, +MWAL,-35.994674877580,145.987190855910, +NBRI,-30.331701161640,149.785211166790, +NBRK,-29.678703399780,145.812838240400, +NDRA,-34.753444164790,146.536290015360, +NEWE,-32.925559065750,151.787608326110, +NGAN,-31.565459310400,147.193360053320, +NMBN,-28.599434985970,153.230499970500, +NOWE,-31.515142575740,151.715151497200, +NRMN,-32.236010961490,148.237516634800, +NSTA,-29.047129217410,150.442979523360, +NWCS,-32.931168819540,151.764092098380, +NWRA,-34.875343194560,150.603631645820, +NYMA,-32.067701391520,146.314409977290, +OBRN,-33.705521182240,149.856428172010, +ORNG,-33.286762296710,149.096837893300, +OVAL,-32.755411057210,148.644863619150, +OXLY,-34.194693908940,144.100428423170, +PARK,-33.000328312300,148.263413990430, +PBOT,-33.975609862890,151.210895108160, +PCTN,-34.159189725940,150.603976898820, +PERI,-36.412841838130,148.408734116770, +PIAN,-35.055844182060,143.326428977960, +PMAC,-31.463504548720,152.896574077270, +POON,-33.384043016550,142.565575120360, +PRCE,-35.365137141950,149.087785486010, +PRKS,-33.136292183010,148.175265584150, +PTKL,-34.477127766480,150.912527248830, +PUTY,-32.954620895850,150.658359913800, +QUAM,-30.934558432890,147.868825445340, +RAND,-35.595319266520,146.577251067320, +RANK,-33.843527001430,146.260407837020, +RAYM,-32.764467134990,151.744289410730, +RBVL,-34.591834001070,142.768576347670, +RGLN,-33.417233215590,149.653804409750, +ROBI,-28.078561956330,153.380185071210, +RUUS,-34.043990798410,141.267661676860, +RYLS,-32.794022742730,149.975508128490, +SCON,-32.052935807700,150.868499000200, +SLTC,-28.273328280410,153.573806707950, +SNGO,-32.559818166330,151.174604604680, +SPPT,-32.961843433420,151.622519349880, +SPWD,-33.700119179160,150.562771606160, +STR1,-35.317094613710,149.008840791660, +STR2,-35.317722240160,149.008942882160, +SYDN,-33.782461034370,151.149221129830, +SYM1,-35.344075493330,149.159851516890, +TAMW,-31.094437232860,150.929780603990, +TARE,-31.913796793190,152.462679874520, +TBOB,-29.451682888950,142.056174284850, +TID1,-35.400765396740,148.978784924650, +TLPA,-30.868502342240,144.412558269720, +TMBA,-35.779238740370,148.010291213980, +TMRA,-34.448001871050,147.533182888470, +TMUT,-35.302643610120,148.218953584450, +TNTR,-29.056362484200,152.018821126120, +TOTT,-32.254926544980,147.368539197360, +TULL,-32.633765292060,147.568499137660, +TURO,-36.036714128190,150.120994043860, +ULLA,-35.363540535700,150.464154105420, +UNSW,-33.919253347720,151.230686636390, +UNW2,-33.919775931790,151.231539899560, +VLWD,-33.882216612320,150.976004844000, +WAKL,-35.456861348640,144.379706933050, +WALW,-35.967558982930,147.732940588930, +WARI,-29.542163135120,150.573076304270, +WARW,-28.215068628490,152.029299479150, +WCHP,-31.462664673680,152.733164012130, +WDBG,-28.395031300420,152.606047728950, +WEEM,-29.014858731570,149.253381412470, +WFAL,-34.135791767390,150.993806632310, +WGBA,-33.888008907390,150.596577774240, +WGGA,-35.108730522160,147.368062957900, +WLCA,-31.556825338460,143.373845848210, +WLGT,-30.024952808760,148.115771853170, +WLMD,-35.596106671330,149.136499948870, +WLWN,-30.932237460500,152.624354982030, +WRRN,-31.702371232160,147.835254676800, +WTCF,-30.854815949200,143.091762732270, +WTON,-32.575358672460,148.955422027630, +WWLG,-33.704981792290,147.320457917690, +WYNG,-33.284131475860,151.422832003760, +YARO,-31.237928944550,151.921103512690, +YASS,-34.846467014510,148.912040492890, +YMBA,-29.449038838130,153.356815424290, +YUNG,-34.305317631760,148.281535497920, diff --git a/geodepy/tests/resources/Test_Conversion_ISG_Grid.csv b/geodepy/tests/resources/Test_Conversion_ISG_Grid.csv new file mode 100644 index 0000000..c976176 --- /dev/null +++ b/geodepy/tests/resources/Test_Conversion_ISG_Grid.csv @@ -0,0 +1,212 @@ +ALBU,552,292281.220,1005905.150 +ANNA,562,214306.617,1370776.835 +ARD2,561,364644.161,1621965.911 +ARDL,552,291004.923,1197458.933 +ARMD,561,363798.077,1622665.123 +ASHF,561,308938.855,1754784.046 +BALN,562,354923.721,1804716.254 +BANK,561,303251.751,1245795.225 +BARR,561,286893.939,1173787.678 +BATH,553,352636.112,1299487.589 +BBDH,552,267314.084,1420214.430 +BDST,562,299410.236,1902986.383 +BEGA,553,375151.681,939181.052 +BERM,561,217037.816,966330.115 +BIGG,553,212407.462,982918.356 +BING,561,361252.742,1412325.836 +BJCT,553,296436.811,1668631.437 +BKNL,542,344298.687,1458495.244 +BLCK,561,228259.335,1496255.546 +BLKT,561,291443.882,1261688.919 +BLRN,543,351898.345,1164597.262 +BNDC,553,289666.169,887174.639 +BOMB,553,321017.077,913282.045 +BOOR,553,272475.124,1187719.572 +BORA,561,265770.883,1512198.160 +BRBA,561,262148.115,1637672.078 +BRDW,553,371172.813,1075636.885 +BRWN,552,286452.884,1683395.603 +BUND,561,308527.081,1659376.430 +BURK,551,389939.846,1668975.033 +CANR,553,313803.877,840849.918 +CARG,552,240826.807,1315120.511 +CBAR,551,379304.940,1511798.470 +CBLE,553,240480.955,1574030.215 +CBRA,551,358025.394,1024084.934 +CBRM,551,358136.827,1024062.755 +CESS,561,333274.752,1365496.460 +CHCC,562,311201.795,1647152.054 +CHIP,561,318505.448,1248903.846 +CHSM,553,310860.515,1079046.123 +CKWL,553,343305.639,1185689.685 +CLAH,553,367566.789,1476750.894 +CLBI,553,259715.164,1730532.419 +CMDN,561,271410.659,1231200.110 +CNBN,553,325542.749,1532060.684 +CNDA,552,365966.313,1628120.268 +CNDO,552,313984.044,1337832.468 +CNWD,553,302872.973,1102556.791 +COBH,552,278910.734,1590415.164 +COFF,562,313200.812,1646621.587 +COLE,551,380423.731,1146516.237 +COMA,553,311326.114,988386.594 +COPS,562,277951.725,1726332.914 +CRDX,561,278502.590,1200324.629 +CSNO,562,304535.686,1805632.764 +CTMD,553,210558.026,1165033.639 +CWN2,561,315815.872,1281426.708 +CWRA,553,272334.909,1255055.656 +DBBO,553,262396.732,1430453.571 +DKSN,553,312241.775,1097627.410 +DLQN,551,296675.857,1066479.011 +DORR,562,272305.967,1641023.705 +DUNE,553,336562.250,1456793.220 +DWHY,561,326481.822,1263926.873 +ECHU,551,277707.221,998916.868 +ECOR,561,291690.899,1194709.339 +EDEN,553,380750.136,895199.071 +EMMD,551,232153.561,1494950.609 +FLGP,542,369338.553,1557219.926 +FORB,553,207496.429,1304117.410 +FORS,562,254866.357,1435770.263 +FTDN,561,320736.091,1252429.268 +GABO,553,380739.642,840105.536 +GERR,561,284114.307,1153582.943 +GFEL,553,222259.745,1247925.918 +GFTH,552,211204.150,1204202.577 +GFTN,562,293401.204,1713920.877 +GILG,553,267896.157,1490169.877 +GLB2,553,365005.055,1153353.451 +GLBN,553,365599.390,1152320.065 +GLIN,561,372599.564,1708088.050 +GNGN,553,311778.354,1104925.923 +GNOA,553,352029.038,850460.901 +GONG,561,290594.904,1188984.216 +GOOL,551,365203.570,1237878.192 +GUNN,561,228850.364,1571226.764 +GURL,553,376847.119,1709031.324 +GWAB,553,297128.726,1612763.033 +HAY1,551,286334.902,1180297.188 +HERN,562,250549.258,1643579.698 +HILL,551,349263.269,1293383.716 +HLB2,552,328613.242,1046503.761 +HLBK,552,328602.469,1045045.455 +HNSB,561,308945.009,1269610.275 +IHOE,543,345933.407,1362249.345 +INVL,561,310953.205,1704675.443 +IRYM,543,225358.060,1211716.480 +IVH2,551,235213.808,1360002.632 +JERI,551,365819.908,1085796.453 +KIRR,561,306638.533,1231565.043 +KNCB,561,336318.419,1293843.837 +KRNG,543,383312.771,1043480.888 +KTMB,561,236683.179,1269907.206 +KULW,551,300810.957,1422007.813 +KURJ,561,268840.426,1285762.716 +LGOW,561,221808.367,1293628.845 +LIPO,542,300913.656,1224696.476 +LIRI,552,395255.967,1742708.837 +LKHT,552,273107.515,1100203.663 +LORD,572,305717.692,1511398.112 +LOTH,551,311093.780,1620757.769 +MACK,562,292077.111,1601140.774 +MENA,561,276255.806,1222360.243 +MENO,542,374156.628,1205882.171 +MGRV,561,284211.076,1277786.819 +MHOP,551,385187.404,1355763.042 +MNDE,543,245117.356,1414473.413 +MNPK,561,351292.296,1328129.781 +MOGO,561,226811.053,1042233.778 +MOUL,551,211986.171,1114931.232 +MREE,553,379969.217,1739723.371 +MRWA,561,239064.024,1442493.008 +MSV2,561,242452.690,1175290.205 +MSVL,561,242382.924,1175131.336 +MTHR,561,309193.692,1389924.837 +MTLD,561,352405.958,1376311.718 +MUDG,553,354778.051,1392600.549 +MWAL,551,389011.109,1014822.766 +NBRI,553,375505.790,1643044.280 +NBRK,551,378676.064,1715411.605 +NDRA,552,257544.411,1152879.134 +NEWE,561,373663.082,1355438.560 +NGAN,552,318355.825,1506512.045 +NMBN,562,322544.469,1835283.514 +NOWE,561,367927.077,1511885.400 +NRMN,553,228138.849,1431923.223 +NSTA,561,245751.775,1785560.759 +NWCS,561,371459.102,1354832.623 +NWRA,561,263763.411,1139383.030 +NYMA,552,235267.062,1450635.364 +OBRN,553,379389.581,1268883.713 +ORNG,553,309019.917,1315652.117 +OVAL,553,266721.881,1374526.593 +OXLY,551,217086.765,1214590.462 +PARK,553,231167.027,1347181.057 +PBOT,561,319487.984,1239236.530 +PCTN,561,263483.831,1218823.523 +PERI,553,246971.241,968712.689 +PIAN,543,329777.221,1119382.340 +PMAC,562,290171.034,1517827.566 +POON,543,259580.520,1304783.145 +PRCE,553,307977.566,1085115.129 +PRKS,553,223047.896,1332040.974 +PTKL,561,291964.763,1183624.626 +PUTY,561,268058.024,1352439.092 +QUAM,552,383029.975,1576151.041 +RAND,552,261691.659,1059499.280 +RANK,552,231551.040,1253660.429 +RAYM,561,369737.348,1373332.988 +RBVL,543,278770.566,1170879.875 +RGLN,553,360808.018,1300995.416 +ROBI,562,337366.605,1892969.331 +RUUS,542,324713.753,1231639.696 +RYLS,553,391372.298,1369879.261 +SCON,561,287581.897,1452470.660 +SLTC,562,356294.993,1871310.923 +SNGO,561,316396.991,1396258.658 +SPPT,561,358198.653,1351517.912 +SPWD,561,259467.492,1269726.316 +STR1,553,300803.889,1090448.496 +STR2,553,300813.165,1090378.866 +SYDN,561,313820.031,1260669.464 +SYM1,553,314530.392,1087443.537 +TAMW,561,293300.743,1558747.835 +TARE,562,249182.021,1467780.022 +TBOB,543,208440.323,1740479.825 +TID1,553,298072.913,1081165.813 +TLPA,551,243822.670,1583649.988 +TMBA,553,210519.786,1038724.367 +TMRA,552,348995.385,1186729.918 +TMUT,553,228966.488,1091771.923 +TNTR,562,204449.814,1784268.097 +TOTT,552,334725.875,1430021.231 +TULL,552,353343.841,1387929.314 +TURO,561,220785.833,1010251.587 +ULLA,561,251303.450,1085164.002 +UNSW,561,321330.899,1245483.404 +UNW2,561,321409.667,1245425.263 +VLWD,561,297780.283,1249615.012 +WAKL,551,243693.925,1074765.803 +WALW,552,366108.519,1018033.680 +WARI,561,258622.089,1730746.004 +WARW,562,204713.156,1877518.980 +WCHP,562,274641.281,1517894.493 +WDBG,562,261394.358,1857894.378 +WEEM,553,324684.328,1789238.858 +WFAL,561,299428.771,1221489.639 +WGBA,561,262683.071,1248899.572 +WGGA,552,333553.475,1113502.088 +WLCA,543,335492.840,1507424.933 +WLGT,553,214708.573,1676979.046 +WLMD,553,312369.095,1059485.606 +WLWN,562,264100.858,1576671.486 +WRRN,552,379176.527,1491044.974 +WTCF,543,308776.488,1585311.429 +WTON,553,295814.439,1394547.932 +WWLG,552,329705.776,1269226.711 +WYNG,561,339385.792,1315868.311 +YARO,561,387746.951,1542475.799 +YASS,553,291955.820,1142654.457 +YMBA,562,334614.540,1741090.708 +YUNG,553,233866.318,1202452.127 From d7db0ec14b13981d3ff38c928790caece1638697 Mon Sep 17 00:00:00 2001 From: Jonathon Smith Date: Mon, 21 Feb 2022 13:02:04 +1100 Subject: [PATCH 6/6] add comments with info and links for ISG --- geodepy/constants.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/geodepy/constants.py b/geodepy/constants.py index dcab5d7..fcd4d41 100644 --- a/geodepy/constants.py +++ b/geodepy/constants.py @@ -66,6 +66,10 @@ def __init__(self, falseeast, falsenorth, cmscale, zonewidth, initialcm): utm = Projection(500000, 10000000, 0.9996, 6, -177) + +# Integrated Survey Grid - used in NSW as the projection for AGD66 +# Spatial Services projections page - https://www.spatial.nsw.gov.au/surveying/geodesy/projections +# ISG Technical Manual - https://www.spatial.nsw.gov.au/__data/assets/pdf_file/0017/25730/ISG.pdf isg = Projection(300000, 5000000, 0.99994, 2, -177)