Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions geodepy/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,9 @@ def geo2grid(lat, lon, zone=0, ellipsoid=grs80, prj=utm):
north = prj.cmscale * y + falsenorth

# Point Scale Factor and Grid Convergence
psf, grid_conv = psfandgridconv(xi1, eta1, degrees(lat), lon, cm, conf_lat)
psf, grid_conv = psfandgridconv(
xi1, eta1, degrees(lat), lon, cm, conf_lat, ellipsoid, prj
)

return (
hemisphere,
Expand Down Expand Up @@ -583,7 +585,9 @@ def f1tn(tn, ecc1, ecc1sq):
long = cm + long_diff

# Point Scale Factor and Grid Convergence
psf, grid_conv = psfandgridconv(xi1, eta1, lat, long, cm, conf_lat)
psf, grid_conv = psfandgridconv(
xi1, eta1, lat, long, cm, conf_lat, ellipsoid, prj
)

return (
hemisign * round(lat, 11),
Expand Down
10 changes: 10 additions & 0 deletions geodepy/tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ def test_geo_grid_transform_interoperability_isg(self):
decimal=3,
)

def test_isg_scale_and_convergence(self):
# ANNA from the ISG fixtures. Reference factors from PROJ (ESRI:102078),
# with the opposite sign convention for grid convergence.
forward = geo2grid(-32.786387375840, 152.085197007870, ellipsoid=ans, prj=isg)
inverse = grid2geo(562, 214306.617, 1370776.835, ellipsoid=ans, prj=isg)
for result in (forward, inverse):
with self.subTest(result=result):
self.assertAlmostEqual(result[-2], 1.00003051, 8)
self.assertAlmostEqual(result[-1], -0.495403765, 8)

def test_llh2xyz(self):

# Test of single point
Expand Down