generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(632): - add migration script to simplify existing geomtry - simplify geometry on submission refs: #632 * feat(632): add wording in spatial submission screen for explaining the simplication algorithm, refs: #632 * fix(632): fix wording for consistancy, refs:#632 * fix(632): add style for expanded section, refs: #632 * fix(632): apply simplication algorithm before saving the submission, refs: #632 * fix(632): add comment for the 2.5m tolerance, refs: #632 * Revert back 'simplifyGeometry' as update statement. --------- Co-authored-by: Ian Liu <[email protected]>
- Loading branch information
1 parent
78b6ada
commit c5aca4f
Showing
7 changed files
with
125 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,9 @@ ol { | |
li { | ||
margin-bottom: 0.5em; | ||
} | ||
} | ||
|
||
.expand-section { | ||
margin-bottom: 16px; | ||
padding: 2px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
api/src/migrations/main/1718643595423-simplify-spatial-geometry.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { MigrationInterface, QueryRunner } = require('typeorm'); | ||
|
||
module.exports = class SimplifySpatialGeometry1718643595423 { | ||
async up(queryRunner) { | ||
console.log( | ||
'Starting geometry simplification (update geometry column in cut_block, road_section and retention_area table) migration' | ||
); | ||
await queryRunner.query(` | ||
-- update geometry column to apply the simplification algorithm in cut_block table | ||
UPDATE app_fom.cut_block SET geometry=ST_SimplifyPreserveTopology(geometry, 2.5); | ||
-- update geometry column to apply the simplification algorithm in retention_area table | ||
UPDATE app_fom.retention_area SET geometry=ST_SimplifyPreserveTopology(geometry, 2.5); | ||
-- update geometry column to apply the simplification algorithm in road_section table | ||
UPDATE app_fom.road_section SET geometry=ST_SimplifyPreserveTopology(geometry, 2.5); | ||
`); | ||
} | ||
|
||
async down(queryRunner) { | ||
console.log( | ||
'ERROR: Apply simplification algorithm on geometry cannot be reversed.' | ||
); | ||
} | ||
}; |