kopia lustrzana https://github.com/openmaptiles/openmaptiles
Add building layer
rodzic
4ec7016608
commit
217d5015c2
|
@ -78,9 +78,10 @@ docker-compose run import-osm
|
||||||
|
|
||||||
### Work on Vector Tile Schema
|
### Work on Vector Tile Schema
|
||||||
|
|
||||||
Run the `db-schema` container each time you modify SQL code inside `./schema`.
|
Build and run the `db-schema` container each time you modify SQL code inside `./schema`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
docker-compose build db-schema
|
||||||
docker-compose run db-schema
|
docker-compose run db-schema
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
37
data.yml
37
data.yml
|
@ -51,6 +51,43 @@ Layer:
|
||||||
properties:
|
properties:
|
||||||
"buffer-size": 4
|
"buffer-size": 4
|
||||||
srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over
|
srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over
|
||||||
|
- id: building
|
||||||
|
Datasource:
|
||||||
|
dbname: osm
|
||||||
|
extent: -20037508.34,-20037508.34,20037508.34,20037508.34
|
||||||
|
geometry_field: way
|
||||||
|
geometry_table: ''
|
||||||
|
host: db
|
||||||
|
key_field: ''
|
||||||
|
key_field_as_attribute: ''
|
||||||
|
max_size: 512
|
||||||
|
password: osm
|
||||||
|
port: 5432
|
||||||
|
srid: ''
|
||||||
|
table: |-
|
||||||
|
( SELECT
|
||||||
|
osm_id,
|
||||||
|
way,
|
||||||
|
least(greatest(3, COALESCE(height, levels*3.66,5)),400)^.7 AS render_height
|
||||||
|
FROM (
|
||||||
|
SELECT osm_id, ST_Simplify(way, 10) AS way, height, levels FROM building_z13
|
||||||
|
WHERE z(!scale_denominator!) = 13
|
||||||
|
UNION ALL
|
||||||
|
SELECT * FROM building_z14
|
||||||
|
WHERE z(!scale_denominator!) >= 14
|
||||||
|
) AS water
|
||||||
|
WHERE way && !bbox!
|
||||||
|
ORDER BY render_height, ST_YMin(way) DESC
|
||||||
|
) AS data
|
||||||
|
type: postgis
|
||||||
|
user: osm
|
||||||
|
description: Buildings
|
||||||
|
fields:
|
||||||
|
osm_id: Number
|
||||||
|
render_height: Number
|
||||||
|
properties:
|
||||||
|
"buffer-size": 4
|
||||||
|
srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over
|
||||||
maxzoom: 14
|
maxzoom: 14
|
||||||
minzoom: 0
|
minzoom: 0
|
||||||
name: OSM2VectorTiles v3.0
|
name: OSM2VectorTiles v3.0
|
||||||
|
|
|
@ -17,6 +17,7 @@ function exec_psql_file() {
|
||||||
function main() {
|
function main() {
|
||||||
exec_psql_file "$VT_UTIL_DIR/postgis-vt-util.sql"
|
exec_psql_file "$VT_UTIL_DIR/postgis-vt-util.sql"
|
||||||
exec_psql_file "layers/water.sql"
|
exec_psql_file "layers/water.sql"
|
||||||
|
exec_psql_file "layers/building.sql"
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
CREATE OR REPLACE VIEW building_z13 AS (
|
||||||
|
SELECT osm_id, way, height, levels FROM buildings WHERE way_area > 1400
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE OR REPLACE VIEW building_z14 AS (
|
||||||
|
SELECT osm_id, way, height, levels FROM buildings
|
||||||
|
);
|
Ładowanie…
Reference in New Issue