Start region work

This commit is contained in:
WQY\qiong
2023-03-31 09:55:06 +08:00
parent 55e52ff4fc
commit e0b6ce7559
8 changed files with 89 additions and 5 deletions

View File

@@ -3,10 +3,9 @@
create table coordinates
(
node varchar(32) primary key references _node(id)
, coord point not null
, coord geometry
);
-- delete when delete node
create index coordinates_spgist on coordinates using spgist(coord);
create index coordinates_gist on coordinates using gist(coord);

View File

@@ -0,0 +1,9 @@
create table virtual_district
(
id text primary key
, center varchar(32) references _node(id) not null unique
, boundary geometry unique
, nodes varchar(32)[]
);
create index virtual_district_gist on virtual_district using gist(boundary);

View File

@@ -2,6 +2,4 @@
drop index if exists coordinates_gist;
drop index if exists coordinates_spgist;
drop table if exists coordinates;

View File

@@ -0,0 +1,3 @@
drop index if exists virtual_district_gist;
drop table if exists virtual_district;