|
@@ -75,7 +75,7 @@ discard block |
|
|
block discarded – undo |
|
75
|
75
|
|
|
76
|
76
|
// Iteratively calculate permutations of intermediate CRSs |
|
77
|
77
|
foreach ($this->buildTransformationPathsToCRS($source, $target) as $candidatePaths) { |
|
78
|
|
- usort($candidatePaths, static function (array $a, array $b) { |
|
|
78
|
+ usort($candidatePaths, static function(array $a, array $b) { |
|
79
|
79
|
return $a['accuracy'] <=> $b['accuracy']; |
|
80
|
80
|
}); |
|
81
|
81
|
|
|
@@ -154,7 +154,7 @@ discard block |
|
|
block discarded – undo |
|
154
|
154
|
$simplePaths = [[$sourceSRID]]; |
|
155
|
155
|
|
|
156
|
156
|
while ($iterations < $this->maxChainDepth) { |
|
157
|
|
- $cacheKey = $sourceSRID . '|' . $targetSRID . '|' . $iterations; |
|
|
157
|
+ $cacheKey = $sourceSRID.'|'.$targetSRID.'|'.$iterations; |
|
158
|
158
|
|
|
159
|
159
|
if (!isset(self::$pathCache[$cacheKey])) { |
|
160
|
160
|
$completePaths = []; |
|
@@ -199,7 +199,7 @@ discard block |
|
|
block discarded – undo |
|
199
|
199
|
do { |
|
200
|
200
|
$to = array_shift($simplePath); |
|
201
|
201
|
$wipTransformationsInPath = []; |
|
202
|
|
- foreach (static::$transformationsByCRSPair[$from . '|' . $to] ?? [] as $transformation) { |
|
|
202
|
+ foreach (static::$transformationsByCRSPair[$from.'|'.$to] ?? [] as $transformation) { |
|
203
|
203
|
foreach ($transformationsToMakePath as $transformationToMakePath) { |
|
204
|
204
|
$wipTransformationsInPath[] = array_merge($transformationToMakePath, [$transformation]); |
|
205
|
205
|
} |
|
@@ -279,13 +279,13 @@ discard block |
|
|
block discarded – undo |
|
279
|
279
|
{ |
|
280
|
280
|
if (!static::$transformationsByCRSPair) { |
|
281
|
281
|
foreach (CRSTransformations::getSupportedTransformations() as $key => $transformation) { |
|
282
|
|
- if (!isset(static::$transformationsByCRSPair[$transformation['source_crs'] . '|' . $transformation['target_crs']][$key])) { |
|
283
|
|
- static::$transformationsByCRSPair[$transformation['source_crs'] . '|' . $transformation['target_crs']][$key] = $transformation; |
|
284
|
|
- static::$transformationsByCRSPair[$transformation['source_crs'] . '|' . $transformation['target_crs']][$key]['in_reverse'] = false; |
|
|
282
|
+ if (!isset(static::$transformationsByCRSPair[$transformation['source_crs'].'|'.$transformation['target_crs']][$key])) { |
|
|
283
|
+ static::$transformationsByCRSPair[$transformation['source_crs'].'|'.$transformation['target_crs']][$key] = $transformation; |
|
|
284
|
+ static::$transformationsByCRSPair[$transformation['source_crs'].'|'.$transformation['target_crs']][$key]['in_reverse'] = false; |
|
285
|
285
|
} |
|
286
|
|
- if ($transformation['reversible'] && !isset(static::$transformationsByCRSPair[$transformation['target_crs'] . '|' . $transformation['source_crs']][$key])) { |
|
287
|
|
- static::$transformationsByCRSPair[$transformation['target_crs'] . '|' . $transformation['source_crs']][$key] = $transformation; |
|
288
|
|
- static::$transformationsByCRSPair[$transformation['target_crs'] . '|' . $transformation['source_crs']][$key]['in_reverse'] = true; |
|
|
286
|
+ if ($transformation['reversible'] && !isset(static::$transformationsByCRSPair[$transformation['target_crs'].'|'.$transformation['source_crs']][$key])) { |
|
|
287
|
+ static::$transformationsByCRSPair[$transformation['target_crs'].'|'.$transformation['source_crs']][$key] = $transformation; |
|
|
288
|
+ static::$transformationsByCRSPair[$transformation['target_crs'].'|'.$transformation['source_crs']][$key]['in_reverse'] = true; |
|
289
|
289
|
} |
|
290
|
290
|
} |
|
291
|
291
|
} |