From 2e2b27c50e8f6926ab0fa4c16d2b940b116be16d Mon Sep 17 00:00:00 2001 From: Jona Date: Wed, 2 Aug 2023 15:57:51 +0100 Subject: [PATCH] Add new concept of "linearity" to the view --- alembic/versions/39277f6278f4_add_view.py | 1 + alembic/versions/7cd715196b8d_add_index.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/alembic/versions/39277f6278f4_add_view.py b/alembic/versions/39277f6278f4_add_view.py index 5594f860..c6547757 100644 --- a/alembic/versions/39277f6278f4_add_view.py +++ b/alembic/versions/39277f6278f4_add_view.py @@ -24,6 +24,7 @@ def upgrade() -> None: definition=""" SELECT slick.*, + slick.length^2 / slick.area / slick.polsby_popper as linearity, sentinel1_grd.scene_id AS s1_scene_id, sentinel1_grd.geometry AS s1_geometry, cls.short_name AS cls_short_name, diff --git a/alembic/versions/7cd715196b8d_add_index.py b/alembic/versions/7cd715196b8d_add_index.py index bb2d240b..7944a8ca 100644 --- a/alembic/versions/7cd715196b8d_add_index.py +++ b/alembic/versions/7cd715196b8d_add_index.py @@ -47,6 +47,7 @@ def upgrade() -> None: op.create_index("idx_slick_hitl", "slick", ["hitl_cls"]) op.create_index("idx_slick_confidence", "slick", ["machine_confidence"]) + op.create_index("idx_slick_length", "slick", ["length"]) op.create_index("idx_slick_polsby_popper", "slick", ["polsby_popper"]) op.create_index("idx_slick_fill_factor", "slick", ["fill_factor"]) op.create_index("idx_slick_orchestrator_run", "slick", ["orchestrator_run"]) @@ -78,6 +79,7 @@ def downgrade() -> None: op.drop_index("idx_slick_hitl", "slick") op.drop_index("idx_slick_confidence", "slick") + op.drop_index("idx_slick_length", "slick") op.drop_index("idx_slick_polsby_popper", "slick") op.drop_index("idx_slick_fill_factor", "slick") op.drop_index("idx_slick_orchestrator_run", "slick")