Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
database-obmtiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Global Dynamic Exposure
OpenBuildingMap
database-obmtiles
Commits
4dd887d0
Commit
4dd887d0
authored
6 months ago
by
Laurens Oostwegel
Browse files
Options
Downloads
Patches
Plain Diff
Add table 'obm_buildings' and change 'storeys' to 'height' in all building tables
parent
7502c2df
No related branches found
No related tags found
1 merge request
!45
Resolve "Translate `storeys` to the `height` tag from the GEM Taxonomy"
Pipeline
#75480
passed
6 months ago
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
migrations/00026_add_obm_buildings_and_height_column.sql
+55
-0
55 additions, 0 deletions
migrations/00026_add_obm_buildings_and_height_column.sql
with
55 additions
and
0 deletions
migrations/00026_add_obm_buildings_and_height_column.sql
0 → 100644
+
55
−
0
View file @
4dd887d0
-- Copyright (c) 2024:
-- Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
--
-- This program is free software: you can redistribute it and/or modify it
-- under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or (at
-- your option) any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
-- General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. If not, see http://www.gnu.org/licenses/.
-- Create table `obm_buildings`.
CREATE
TABLE
public
.
obm_buildings
(
id
bigint
PRIMARY
KEY
,
geometry
public
.
GEOMETRY
(
GEOMETRY
,
4326
),
floorspace
double
precision
,
occupancy
text
,
height
text
,
relation_id
integer
,
quadkey
text
,
last_update
timestamp
);
-- Add index on `geometry`.
CREATE
INDEX
obmbuildings_geom_idx
ON
public
.
obm_buildings
USING
gist
(
geometry
);
-- Add index on `last_update`.
CREATE
INDEX
obmbuildings_lastupdate_idx
ON
public
.
obm_buildings
USING
btree
(
last_update
);
-- Add index on `quadkey`.
CREATE
INDEX
obmbuildings_quadkey_idx
ON
public
.
obm_buildings
USING
btree
(
quadkey
);
-- Create trigger to set the `last_update` timestamp.
CREATE
TRIGGER
set_timestamp
BEFORE
UPDATE
ON
public
.
obm_buildings
FOR
EACH
ROW
EXECUTE
FUNCTION
public
.
trigger_set_timestamp
();
-- Drop column storeys and add column height to the `microsoft_buildings` table.
ALTER
TABLE
public
.
microsoft_buildings
DROP
COLUMN
storeys
,
ADD
COLUMN
height
text
;
-- Drop column storeys and add column height to the `google_buildings` table.
ALTER
TABLE
public
.
google_buildings
DROP
COLUMN
storeys
,
ADD
COLUMN
height
text
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment