|
@@ -40,7 +40,7 @@ discard block |
|
|
block discarded – undo |
|
40
|
40
|
{ |
|
41
|
41
|
private int $maxChainDepth = 5; // if traits could have constants... |
|
42
|
42
|
|
|
43
|
|
- protected static array $methodsThatRequireCoordinateEpoch = [ // if traits could have constants... |
|
|
43
|
+ protected static array $methodsThatRequireCoordinateEpoch = [// if traits could have constants... |
|
44
|
44
|
CoordinateOperationMethods::EPSG_TIME_DEPENDENT_COORDINATE_FRAME_ROTATION_GEOCEN => CoordinateOperationMethods::EPSG_TIME_DEPENDENT_COORDINATE_FRAME_ROTATION_GEOCEN, |
|
45
|
45
|
CoordinateOperationMethods::EPSG_TIME_DEPENDENT_COORDINATE_FRAME_ROTATION_GEOG2D => CoordinateOperationMethods::EPSG_TIME_DEPENDENT_COORDINATE_FRAME_ROTATION_GEOG2D, |
|
46
|
46
|
CoordinateOperationMethods::EPSG_TIME_DEPENDENT_COORDINATE_FRAME_ROTATION_GEOG3D => CoordinateOperationMethods::EPSG_TIME_DEPENDENT_COORDINATE_FRAME_ROTATION_GEOG3D, |
|
@@ -51,7 +51,7 @@ discard block |
|
|
block discarded – undo |
|
51
|
51
|
CoordinateOperationMethods::EPSG_TIME_SPECIFIC_POSITION_VECTOR_TRANSFORM_GEOCEN => CoordinateOperationMethods::EPSG_TIME_SPECIFIC_POSITION_VECTOR_TRANSFORM_GEOCEN, |
|
52
|
52
|
]; |
|
53
|
53
|
|
|
54
|
|
- protected static array $methodsThatRequireASpecificEpoch = [ // if traits could have constants... |
|
|
54
|
+ protected static array $methodsThatRequireASpecificEpoch = [// if traits could have constants... |
|
55
|
55
|
CoordinateOperationMethods::EPSG_TIME_SPECIFIC_COORDINATE_FRAME_ROTATION_GEOCEN => CoordinateOperationMethods::EPSG_TIME_SPECIFIC_COORDINATE_FRAME_ROTATION_GEOCEN, |
|
56
|
56
|
CoordinateOperationMethods::EPSG_TIME_SPECIFIC_POSITION_VECTOR_TRANSFORM_GEOCEN => CoordinateOperationMethods::EPSG_TIME_SPECIFIC_POSITION_VECTOR_TRANSFORM_GEOCEN, |
|
57
|
57
|
]; |
|
@@ -91,7 +91,7 @@ discard block |
|
|
block discarded – undo |
|
91
|
91
|
|
|
92
|
92
|
// Iteratively calculate permutations of intermediate CRSs |
|
93
|
93
|
foreach ($this->buildTransformationPathsToCRS($source, $target) as $candidatePaths) { |
|
94
|
|
- usort($candidatePaths, static function (array $a, array $b) { |
|
|
94
|
+ usort($candidatePaths, static function(array $a, array $b) { |
|
95
|
95
|
return $a['accuracy'] <=> $b['accuracy']; |
|
96
|
96
|
}); |
|
97
|
97
|
|
|
@@ -158,7 +158,7 @@ discard block |
|
|
block discarded – undo |
|
158
|
158
|
$simplePaths = [[$sourceSRID]]; |
|
159
|
159
|
|
|
160
|
160
|
while ($iterations < $this->maxChainDepth) { |
|
161
|
|
- $cacheKey = $sourceSRID . '|' . $targetSRID . '|' . $iterations; |
|
|
161
|
+ $cacheKey = $sourceSRID.'|'.$targetSRID.'|'.$iterations; |
|
162
|
162
|
|
|
163
|
163
|
if (!isset(self::$pathCache[$cacheKey])) { |
|
164
|
164
|
$completePaths = []; |
|
@@ -203,7 +203,7 @@ discard block |
|
|
block discarded – undo |
|
203
|
203
|
do { |
|
204
|
204
|
$to = array_shift($simplePath); |
|
205
|
205
|
$wipTransformationsInPath = []; |
|
206
|
|
- foreach (static::$transformationsByCRSPair[$from . '|' . $to] ?? [] as $transformation) { |
|
|
206
|
+ foreach (static::$transformationsByCRSPair[$from.'|'.$to] ?? [] as $transformation) { |
|
207
|
207
|
foreach ($transformationsToMakePath as $transformationToMakePath) { |
|
208
|
208
|
$wipTransformationsInPath[] = array_merge($transformationToMakePath, [$transformation]); |
|
209
|
209
|
} |
|
@@ -283,13 +283,13 @@ discard block |
|
|
block discarded – undo |
|
283
|
283
|
{ |
|
284
|
284
|
if (!static::$transformationsByCRSPair) { |
|
285
|
285
|
foreach (CRSTransformations::getSupportedTransformations() as $key => $transformation) { |
|
286
|
|
- if (!isset(static::$transformationsByCRSPair[$transformation['source_crs'] . '|' . $transformation['target_crs']][$key])) { |
|
287
|
|
- static::$transformationsByCRSPair[$transformation['source_crs'] . '|' . $transformation['target_crs']][$key] = $transformation; |
|
288
|
|
- static::$transformationsByCRSPair[$transformation['source_crs'] . '|' . $transformation['target_crs']][$key]['in_reverse'] = false; |
|
|
286
|
+ if (!isset(static::$transformationsByCRSPair[$transformation['source_crs'].'|'.$transformation['target_crs']][$key])) { |
|
|
287
|
+ static::$transformationsByCRSPair[$transformation['source_crs'].'|'.$transformation['target_crs']][$key] = $transformation; |
|
|
288
|
+ static::$transformationsByCRSPair[$transformation['source_crs'].'|'.$transformation['target_crs']][$key]['in_reverse'] = false; |
|
289
|
289
|
} |
|
290
|
|
- if ($transformation['reversible'] && !isset(static::$transformationsByCRSPair[$transformation['target_crs'] . '|' . $transformation['source_crs']][$key])) { |
|
291
|
|
- static::$transformationsByCRSPair[$transformation['target_crs'] . '|' . $transformation['source_crs']][$key] = $transformation; |
|
292
|
|
- static::$transformationsByCRSPair[$transformation['target_crs'] . '|' . $transformation['source_crs']][$key]['in_reverse'] = true; |
|
|
290
|
+ if ($transformation['reversible'] && !isset(static::$transformationsByCRSPair[$transformation['target_crs'].'|'.$transformation['source_crs']][$key])) { |
|
|
291
|
+ static::$transformationsByCRSPair[$transformation['target_crs'].'|'.$transformation['source_crs']][$key] = $transformation; |
|
|
292
|
+ static::$transformationsByCRSPair[$transformation['target_crs'].'|'.$transformation['source_crs']][$key]['in_reverse'] = true; |
|
293
|
293
|
} |
|
294
|
294
|
} |
|
295
|
295
|
} |