From e1b4813e360bab7ca4570d6fa8575981aaa58841 Mon Sep 17 00:00:00 2001 From: Doug Wright Date: Thu, 24 Jun 2021 06:17:33 +0100 Subject: [PATCH] Fix PHP7.4 --- .../CoordinateOperationParams.php | 65 +++++++++++++++++++ src/EPSG/Import/EPSGImporter.php | 4 ++ 2 files changed, 69 insertions(+) diff --git a/src/CoordinateOperation/CoordinateOperationParams.php b/src/CoordinateOperation/CoordinateOperationParams.php index bdebd0b1b..57b50d77a 100644 --- a/src/CoordinateOperation/CoordinateOperationParams.php +++ b/src/CoordinateOperation/CoordinateOperationParams.php @@ -52657,6 +52657,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5SG1952NAD831986StGeorgeLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8547' => [ 'Latitude difference file' => [ @@ -52667,6 +52672,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5SL1952NAD831986StLawrenceLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8548' => [ 'Latitude difference file' => [ @@ -52677,6 +52687,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5SP1952NAD831986StPaulLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8549' => [ 'Latitude difference file' => [ @@ -52687,6 +52702,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5NAD27NAD831986AlaskaLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8550' => [ 'Latitude difference file' => [ @@ -52697,6 +52717,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5NAD831986NAD831992AlaskaLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8551' => [ 'Latitude difference file' => [ @@ -52735,6 +52760,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5NAD27NAD831986CONUSLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8556' => [ 'Latitude difference file' => [ @@ -52745,6 +52775,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5NAD831986NAD83HARNCONUSLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8559' => [ 'Latitude difference file' => [ @@ -52769,6 +52804,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5OHDNAD831986HawaiiLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8562' => [ ], @@ -52837,6 +52877,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5NAD831986NAD831993HawaiiLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8661' => [ 'Latitude difference file' => [ @@ -52861,6 +52906,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5AS62NAD831993ASLongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8665' => [ 'Latitude difference file' => [ @@ -52871,6 +52921,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5GU63NAD831993GuamCnMILongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8668' => [ 'Latitude difference file' => [ @@ -52881,6 +52936,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5PR40NAD831986PRVILongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8669' => [ 'Latitude difference file' => [ @@ -52891,6 +52951,11 @@ class CoordinateOperationParams 'reverses' => true, 'fileProvider' => 'PHPCoord\\CoordinateOperation\\NADCON5NAD831986NAD831993PRVILongitudeProvider', ], + 'Ellipsoidal height difference file' => [ + 'value' => null, + 'uom' => null, + 'reverses' => false, + ], ], 'urn:ogc:def:coordinateOperation:EPSG::8673' => [ 'Latitude difference file' => [ diff --git a/src/EPSG/Import/EPSGImporter.php b/src/EPSG/Import/EPSGImporter.php index 2b92f8b5f..914ee1128 100644 --- a/src/EPSG/Import/EPSGImporter.php +++ b/src/EPSG/Import/EPSGImporter.php @@ -30,6 +30,7 @@ use function min; use const PHP_EOL; use PHPCoord\CoordinateOperation; +use PHPCoord\CoordinateOperation\CoordinateOperationMethods; use PHPCoord\CoordinateReferenceSystem\Compound; use PHPCoord\CoordinateReferenceSystem\Geocentric; use PHPCoord\CoordinateReferenceSystem\Geographic2D; @@ -1567,6 +1568,9 @@ public function generateDataCoordinateOperations(SQLite3 $sqlite): void $params[$paramsRow['name']] = $paramsRow; unset($params[$paramsRow['name']]['name']); } + if (isset($operationData['method']) && $operationData['method'] === CoordinateOperationMethods::EPSG_NADCON5_2D) { // for PHP7.4 w/out named params + $params['Ellipsoidal height difference file'] = ['value' => null, 'uom' => null, 'reverses' => false]; + } $paramData[$operation] = $params; }