Skip to content

Commit

Permalink
Reduce extent descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Aug 17, 2024
1 parent 37af97c commit 1a85c99
Show file tree
Hide file tree
Showing 23 changed files with 10,811 additions and 22,847 deletions.
404 changes: 202 additions & 202 deletions docs/reflection/coordinatereferencesystem/compound.txt

Large diffs are not rendered by default.

280 changes: 140 additions & 140 deletions docs/reflection/coordinatereferencesystem/geocentric.txt

Large diffs are not rendered by default.

484 changes: 242 additions & 242 deletions docs/reflection/coordinatereferencesystem/geographic2d.txt

Large diffs are not rendered by default.

304 changes: 152 additions & 152 deletions docs/reflection/coordinatereferencesystem/geographic3d.txt

Large diffs are not rendered by default.

5,582 changes: 2,791 additions & 2,791 deletions docs/reflection/coordinatereferencesystem/projected.txt

Large diffs are not rendered by default.

112 changes: 56 additions & 56 deletions docs/reflection/coordinatereferencesystem/vertical.txt

Large diffs are not rendered by default.

554 changes: 277 additions & 277 deletions docs/reflection/datum/datum.txt

Large diffs are not rendered by default.

3,812 changes: 0 additions & 3,812 deletions src/CoordinateOperation/CoordinateOperations.php

Large diffs are not rendered by default.

981 changes: 476 additions & 505 deletions src/CoordinateReferenceSystem/Compound.php

Large diffs are not rendered by default.

437 changes: 0 additions & 437 deletions src/CoordinateReferenceSystem/CompoundSRIDData.php

Large diffs are not rendered by default.

423 changes: 202 additions & 221 deletions src/CoordinateReferenceSystem/Geocentric.php

Large diffs are not rendered by default.

205 changes: 0 additions & 205 deletions src/CoordinateReferenceSystem/GeocentricSRIDData.php

Large diffs are not rendered by default.

687 changes: 329 additions & 358 deletions src/CoordinateReferenceSystem/Geographic2D.php

Large diffs are not rendered by default.

583 changes: 0 additions & 583 deletions src/CoordinateReferenceSystem/Geographic2DSRIDData.php

Large diffs are not rendered by default.

435 changes: 208 additions & 227 deletions src/CoordinateReferenceSystem/Geographic3D.php

Large diffs are not rendered by default.

217 changes: 0 additions & 217 deletions src/CoordinateReferenceSystem/Geographic3DSRIDData.php

Large diffs are not rendered by default.

10,724 changes: 5,245 additions & 5,479 deletions src/CoordinateReferenceSystem/Projected.php

Large diffs are not rendered by default.

5,265 changes: 0 additions & 5,265 deletions src/CoordinateReferenceSystem/ProjectedSRIDData.php

Large diffs are not rendered by default.

203 changes: 96 additions & 107 deletions src/CoordinateReferenceSystem/Vertical.php

Large diffs are not rendered by default.

286 changes: 0 additions & 286 deletions src/CoordinateReferenceSystem/VerticalSRIDData.php

Large diffs are not rendered by default.

1,655 changes: 375 additions & 1,280 deletions src/Datum/Datum.php

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions src/EPSG/Import/AddNewDataVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function __construct(bool $hasExistingData, array $data)
unset($dataRow['deprecated']);
unset($dataRow['doc_help']);
unset($dataRow['method_name']);
unset($dataRow['extent_description']);
if (isset($dataRow['name'])) {
$dataRow['name'] = str_replace('_LOWERCASE', '', $dataRow['name']);
}
Expand All @@ -52,11 +53,6 @@ public function __construct(bool $hasExistingData, array $data)
$dataRow['extent_name'] = array_map(fn (string $extentName) => rtrim($extentName, '.'), $dataRow['extent_name']);
$dataRow['extent_name'] = implode(', ', $dataRow['extent_name']);
}
if (isset($dataRow['extent_description'])) {
$dataRow['extent_description'] = array_unique(explode('|', $dataRow['extent_description']));
$dataRow['extent_description'] = array_map(fn (string $extentDescription) => rtrim($extentDescription, '.'), $dataRow['extent_description']);
$dataRow['extent_description'] = implode(', ', $dataRow['extent_description']);
}
}
ksort($this->data, SORT_NATURAL);
}
Expand Down
19 changes: 19 additions & 0 deletions src/EPSG/Import/EPSGImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ public function dataFromSQLFiles(): void
*/
$sqlite->exec('UPDATE epsg_usage SET extent_code = 1262 WHERE extent_code IN (1263, 2346, 2830, 4393, 4520, 4523)');

/*
* Shorten extent names
*/
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, 'United Arab Emirates (UAE)', 'UAE')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, 'United Kingdom (UK)', 'UK')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, 'United States (USA)', 'USA')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, 'Türkiye (Turkey)', 'Turkey')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, ' All onshore and offshore.', '')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, ' - onshore and offshore', '')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, 'onshore and offshore - ', '- ')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, ', onshore and offshore.', '.')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, ', onshore and offshore', ', ')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, 'onshore and offshore.', '.')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = REPLACE(extent_description, ' onshore and offshore', '')");

$sqlite->exec("UPDATE epsg_extent SET extent_description = RTRIM(extent_description, ' ')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = RTRIM(extent_description, ',')");
$sqlite->exec("UPDATE epsg_extent SET extent_description = RTRIM(extent_description, '.') WHERE extent_description NOT LIKE '%.%.'");

/*
* Ireland TM75 Polynomial is not "reversible" but can be reversed via iteration
*/
Expand Down

0 comments on commit 1a85c99

Please sign in to comment.