Skip to content

Commit 562893f

Browse files
authored
Update README.md to match schema
1 parent b72c7ba commit 562893f

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,33 @@ Adds spatial methods to a model.
2424
2525
CREATE TABLE features (
2626
id integer NOT NULL,
27-
type character varying(255),
2827
spatial_model_type character varying(255),
2928
spatial_model_id integer,
3029
name character varying(255),
31-
feature_type character varying(255),
32-
geog geography,
33-
geom geometry(Geometry,4326),
34-
geom_lowres geometry(Geometry,4326),
35-
tilegeom geometry(Geometry,3857),
36-
metadata hstore,
37-
area double precision,
38-
north numeric(9,6),
39-
east numeric(9,6),
40-
south numeric(9,6),
41-
west numeric(9,6),
42-
centroid geography
30+
geog public.geography,
31+
metadata public.hstore DEFAULT ''::public.hstore NOT NULL,
32+
geom public.geometry(Geometry,3005),
33+
geom_lowres public.geometry(Geometry,3005),
34+
type character varying,
35+
source_identifier character varying,
36+
tilegeom public.geometry(Geometry,3857) GENERATED ALWAYS AS (public.st_transform(geom, 3857)) STORED,
37+
feature_type character varying GENERATED ALWAYS AS (
38+
CASE public.geometrytype(geog)
39+
WHEN 'POLYGON'::text THEN 'polygon'::text
40+
WHEN 'MULTIPOLYGON'::text THEN 'polygon'::text
41+
WHEN 'GEOMETRYCOLLECTION'::text THEN 'polygon'::text
42+
WHEN 'LINESTRING'::text THEN 'line'::text
43+
WHEN 'MULTILINESTRING'::text THEN 'line'::text
44+
WHEN 'POINT'::text THEN 'point'::text
45+
WHEN 'MULTIPOINT'::text THEN 'point'::text
46+
ELSE NULL::text
47+
END) STORED,
48+
centroid public.geography GENERATED ALWAYS AS (public.st_pointonsurface((geog)::public.geometry)) STORED,
49+
area numeric GENERATED ALWAYS AS (public.st_area(geog)) STORED,
50+
north numeric GENERATED ALWAYS AS (public.st_ymax(((geog)::public.geometry)::public.box3d)) STORED,
51+
east numeric GENERATED ALWAYS AS (public.st_xmax(((geog)::public.geometry)::public.box3d)) STORED,
52+
south numeric GENERATED ALWAYS AS (public.st_ymin(((geog)::public.geometry)::public.box3d)) STORED,
53+
west numeric GENERATED ALWAYS AS (public.st_xmin(((geog)::public.geometry)::public.box3d)) STORED
4354
);
4455
4556
CREATE SEQUENCE features_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;

0 commit comments

Comments
 (0)