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 8590ae6
Show file tree
Hide file tree
Showing 23 changed files with 11,875 additions and 23,939 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.

486 changes: 243 additions & 243 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.

6,628 changes: 3,314 additions & 3,314 deletions docs/reflection/coordinatereferencesystem/projected.txt

Large diffs are not rendered by default.

120 changes: 60 additions & 60 deletions docs/reflection/coordinatereferencesystem/vertical.txt

Large diffs are not rendered by default.

560 changes: 280 additions & 280 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.

690 changes: 330 additions & 360 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.

11,796 changes: 5,769 additions & 6,027 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.

213 changes: 100 additions & 113 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,663 changes: 378 additions & 1,285 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
20 changes: 20 additions & 0 deletions src/EPSG/Import/EPSGImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,26 @@ 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, 'Russian Federation', 'Russia')");
$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 8590ae6

Please sign in to comment.