File: cache_geometries.sql

package info (click to toggle)
postgis 2.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 75,792 kB
  • sloc: ansic: 139,314; sql: 136,281; xml: 48,954; sh: 4,906; perl: 4,509; makefile: 2,897; python: 1,198; yacc: 441; cpp: 305; lex: 132
file content (22 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- This script adds a the_geom column to the feature tables
-- created by load_topology.sql and stores there the SFS Geometry
-- derived by the TopoGeometry column

-- Add geometry columns, for caching Geometries from TopoGeometries

SELECT AddGeometryColumn('features','land_parcels','the_geom',-1,'MULTIPOLYGON',2);
SELECT AddGeometryColumn('features','city_streets','the_geom',-1,'MULTILINESTRING',2);
SELECT AddGeometryColumn('features','traffic_signs','the_geom',-1,'MULTIPOINT',2);

--ALTER TABLE features.city_streets ADD the_geom geometry;
UPDATE features.city_streets set the_geom =
  st_multi(topology.Geometry(feature));

--ALTER TABLE features.traffic_signs ADD the_geom geometry;
UPDATE features.traffic_signs set the_geom =
  st_multi(topology.Geometry(feature));

--ALTER TABLE features.land_parcels ADD the_geom geometry;
UPDATE features.land_parcels set the_geom =
  st_multi(topology.Geometry(feature));