Skip to content

Commit

Permalink
Drop transformations that copy NZGD2000 over to WGS84 (can work that …
Browse files Browse the repository at this point in the history
…out at runtime)
  • Loading branch information
dvdoug committed Oct 22, 2021
1 parent 8c19309 commit a95fb8d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 93 deletions.
24 changes: 0 additions & 24 deletions src/CoordinateOperation/CRSTransformations.php
Original file line number Diff line number Diff line change
Expand Up @@ -19303,30 +19303,6 @@ class CRSTransformations
'accuracy' => 8.0,
'reversible' => true,
],
[
'operation' => 'urn:ogc:def:coordinateOperation:EPSG::1564',
'name' => 'NZGD49 to WGS 84 (2)',
'source_crs' => 'urn:ogc:def:crs:EPSG::4272',
'target_crs' => 'urn:ogc:def:crs:EPSG::4326',
'accuracy' => 4.0,
'reversible' => true,
],
[
'operation' => 'urn:ogc:def:coordinateOperation:EPSG::15975',
'name' => 'NZGD49 to WGS 84 (4)',
'source_crs' => 'urn:ogc:def:crs:EPSG::4272',
'target_crs' => 'urn:ogc:def:crs:EPSG::4326',
'accuracy' => 5.0,
'reversible' => true,
],
[
'operation' => 'urn:ogc:def:coordinateOperation:EPSG::1670',
'name' => 'NZGD49 to WGS 84 (3)',
'source_crs' => 'urn:ogc:def:crs:EPSG::4272',
'target_crs' => 'urn:ogc:def:crs:EPSG::4326',
'accuracy' => 1.0,
'reversible' => true,
],
[
'operation' => 'urn:ogc:def:coordinateOperation:EPSG::1653',
'name' => 'NGO 1948 to ETRS89 (1)',
Expand Down
54 changes: 0 additions & 54 deletions src/CoordinateOperation/CoordinateOperationParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -5625,43 +5625,6 @@ class CoordinateOperationParams
'reverses' => true,
],
],
'urn:ogc:def:coordinateOperation:EPSG::1564' => [
'xAxisTranslation' => [
'value' => 59.47,
'uom' => 'urn:ogc:def:uom:EPSG::9001',
'reverses' => true,
],
'yAxisTranslation' => [
'value' => -5.04,
'uom' => 'urn:ogc:def:uom:EPSG::9001',
'reverses' => true,
],
'zAxisTranslation' => [
'value' => 187.44,
'uom' => 'urn:ogc:def:uom:EPSG::9001',
'reverses' => true,
],
'xAxisRotation' => [
'value' => -0.47,
'uom' => 'urn:ogc:def:uom:EPSG::9104',
'reverses' => true,
],
'yAxisRotation' => [
'value' => 0.1,
'uom' => 'urn:ogc:def:uom:EPSG::9104',
'reverses' => true,
],
'zAxisRotation' => [
'value' => -1.024,
'uom' => 'urn:ogc:def:uom:EPSG::9104',
'reverses' => true,
],
'scaleDifference' => [
'value' => -4.5993,
'uom' => 'urn:ogc:def:uom:EPSG::9202',
'reverses' => true,
],
],
'urn:ogc:def:coordinateOperation:EPSG::1565' => [
'xAxisTranslation' => [
'value' => 0.0,
Expand Down Expand Up @@ -74829,23 +74792,6 @@ class CoordinateOperationParams
'reverses' => true,
],
],
'urn:ogc:def:coordinateOperation:EPSG::15975' => [
'xAxisTranslation' => [
'value' => 54.4,
'uom' => 'urn:ogc:def:uom:EPSG::9001',
'reverses' => true,
],
'yAxisTranslation' => [
'value' => -20.1,
'uom' => 'urn:ogc:def:uom:EPSG::9001',
'reverses' => true,
],
'zAxisTranslation' => [
'value' => 183.1,
'uom' => 'urn:ogc:def:uom:EPSG::9001',
'reverses' => true,
],
],
'urn:ogc:def:coordinateOperation:EPSG::15977' => [
'xAxisTranslation' => [
'value' => 0.0,
Expand Down
15 changes: 0 additions & 15 deletions src/CoordinateOperation/CoordinateOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -1320,11 +1320,6 @@ class CoordinateOperations
'method' => 'urn:ogc:def:method:EPSG::9603',
'extent_code' => ['1346'],
],
'urn:ogc:def:coordinateOperation:EPSG::1564' => [
'name' => 'NZGD49 to WGS 84 (2)',
'method' => 'urn:ogc:def:method:EPSG::9607',
'extent_code' => ['3285'],
],
'urn:ogc:def:coordinateOperation:EPSG::1565' => [
'name' => 'NZGD2000 to WGS 84 (1)',
'method' => 'urn:ogc:def:method:EPSG::9603',
Expand Down Expand Up @@ -1550,11 +1545,6 @@ class CoordinateOperations
'method' => 'urn:ogc:def:method:EPSG::9606',
'extent_code' => ['2340'],
],
'urn:ogc:def:coordinateOperation:EPSG::1670' => [
'name' => 'NZGD49 to WGS 84 (3)',
'method' => 'urn:ogc:def:method:EPSG::9615',
'extent_code' => ['3285'],
],
'urn:ogc:def:coordinateOperation:EPSG::1682' => [
'name' => 'South Yemen to WGS 84 (1)',
'method' => 'urn:ogc:def:method:EPSG::9603',
Expand Down Expand Up @@ -13660,11 +13650,6 @@ class CoordinateOperations
'method' => 'urn:ogc:def:method:EPSG::9603',
'extent_code' => ['3558'],
],
'urn:ogc:def:coordinateOperation:EPSG::15975' => [
'name' => 'NZGD49 to WGS 84 (4)',
'method' => 'urn:ogc:def:method:EPSG::9603',
'extent_code' => ['3285'],
],
'urn:ogc:def:coordinateOperation:EPSG::15977' => [
'name' => 'Slovenia 1996 to ETRS89 (1)',
'method' => 'urn:ogc:def:method:EPSG::9603',
Expand Down
21 changes: 21 additions & 0 deletions src/EPSG/Import/EPSGCodegenFromDataImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -1183,13 +1183,15 @@ public function generateDataCoordinateOperations(): void
$etrs89CopiesFromWGS84 = $this->determineOperationsToETRS89CopiedFromWGS84();
$wgs84CopiesFromGDA94 = $this->determineOperationsToWGS84CopiedFromGDA94();
$wgs84CopiesFromSIRGAS = $this->determineOperationsToWGS84CopiedFromSIRGAS();
$wgs84CopiesFromNZGD = $this->determineOperationsToWGS84CopiedFromNZGD2000();

$blackListedOperations = array_merge(
self::BLACKLISTED_OPERATIONS,
$wgs84CopiesFromETRS89,
$etrs89CopiesFromWGS84,
$wgs84CopiesFromGDA94,
$wgs84CopiesFromSIRGAS,
$wgs84CopiesFromNZGD,
);

$sql = "
Expand Down Expand Up @@ -1595,4 +1597,23 @@ private function determineOperationsToWGS84CopiedFromSIRGAS(): array

return $data;
}

private function determineOperationsToWGS84CopiedFromNZGD2000(): array
{
$sql = "
SELECT DISTINCT wgs84.coord_op_code
FROM epsg_coordoperation wgs84
JOIN epsg_coordoperation nzgd ON nzgd.source_crs_code = wgs84.source_crs_code AND nzgd.target_crs_code IN (4167, 4958, 4959)
JOIN epsg_usage u ON wgs84.coord_op_code = u.object_code AND u.object_table_name = 'epsg_coordoperation' AND u.scope_code = 1252
WHERE wgs84.target_crs_code IN (4978,4326,4979)
";

$result = $this->sqlite->query($sql);
$data = [];
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
$data[] = $row['coord_op_code'];
}

return $data;
}
}

0 comments on commit a95fb8d

Please sign in to comment.