Skip to content

Commit

Permalink
Add an ETRS89 test for #62 too
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Jan 26, 2024
1 parent 3f768b4 commit 529ab02
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/CoordinateOperation/AutoConversionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ public function testWGS84ToIrishTM(): void
self::assertEquals('J 18978 11611', $to->asGridReferenceWithSpaces(12));
}

public function testETRS89ToIrishTM(): void
{
$from = GeographicPoint::create(Geographic2D::fromSRID(Geographic2D::EPSG_ETRS89), new Degree(54.040039), new Degree(-6.1846184), null);
$toCRS = Projected::fromSRID(Projected::EPSG_TM75_IRISH_GRID);

/** @var IrishGridPoint $to */
$to = $from->convert($toCRS);

self::assertEqualsWithDelta(318977.528, $to->getEasting()->asMetres()->getValue(), 0.01);
self::assertEqualsWithDelta(311611.188, $to->getNorthing()->asMetres()->getValue(), 0.01);

self::assertEquals('J 18978 11611', $to->asGridReferenceWithSpaces(12));
}

public function testNoop(): void
{
$from = GeographicPoint::create(Geographic2D::fromSRID(Geographic2D::EPSG_WGS_84), new Degree(40.7127), new Degree(-74.0059), null);
Expand Down

0 comments on commit 529ab02

Please sign in to comment.