Skip to content

Commit

Permalink
Create separed table for simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Dec 18, 2024
1 parent ddfc1d5 commit 5a91a98
Show file tree
Hide file tree
Showing 6 changed files with 477 additions and 272 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chartpress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- 'main'
- 'staging'
- 'development'
- 'imposm_transport'
- 'refactor/imposm'
jobs:
build:
runs-on: ubuntu-20.04
Expand Down
51 changes: 31 additions & 20 deletions compose/tiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,47 @@ services:
dockerfile: Dockerfile
ports:
- "5432:5432"
volumes:
- ../data/tiler-db-data2:/var/lib/postgresql/data
# volumes:
# - ../data/tiler-db-data2:/var/lib/postgresql/data
env_file:
- ../envs/.env.tiler
restart: always
networks:
- tiler_network

imposm:
image: rub21/tiler-imposm:v15
image: rub21/tiler-imposm:v16
build:
context: ../images/tiler-imposm
dockerfile: Dockerfile
volumes:
- ../data/tiler-imposm-data2:/mnt/data
- ../images/tiler-imposm:/app
# - ../data/tiler-imposm-data2:/mnt/data
- ../images/tiler-imposm:/osm
command:
- sh
- -c
- "sleep 20 && ./start.sh"
env_file:
- ../envs/.env.tiler
tiler:
image: ohm-tiler-server:v1
build:
context: ../images/tiler-server
dockerfile: Dockerfile
volumes:
- ../data/tiler-server-data:/mnt/data
- ../images/tiler-server:/app
ports:
- "9090:9090"
- "./start.sh"
env_file:
- ../envs/.env.tiler
restart: always

networks:
- tiler_network

# tiler:
# image: ohm-tiler-server:v1
# build:
# context: ../images/tiler-server
# dockerfile: Dockerfile
# volumes:
# - ../data/tiler-server-data:/mnt/data
# - ../images/tiler-server:/app
# ports:
# - "9090:9090"
# env_file:
# - ../envs/.env.tiler
# restart: always
# networks:
# - tiler_network

networks:
tiler_network:
driver: bridge
164 changes: 96 additions & 68 deletions images/tiler-imposm/config/layers/admin_areas.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,95 +8,123 @@
]
},
"generalized_tables": {
"admin_boundaries_lines_z0_2": {
"admin_areas_z0_2": {
"source": "admin_areas",
"tolerance": 5000,
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2)"
},
"admin_boundaries_centroid_z0_2": {
"source": "admin_areas",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2) AND name IS NOT NULL AND name <> ''"
"sql_filter": "admin_level IN (1,2)",
"sub_tables": [
{
"table": "admin_boundaries_lines_z0_2",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z0_2",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"admin_boundaries_lines_z3_5": {

"admin_areas_z3_5": {
"source": "admin_areas",
"tolerance": 1000,
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4)"
},
"admin_boundaries_centroid_z3_5": {
"source": "admin_areas",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4) AND name IS NOT NULL AND name <> ''"
"sql_filter": "admin_level IN (1,2,3,4)",
"sub_tables": [
{
"table": "admin_boundaries_lines_z3_5",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z3_5",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"admin_boundaries_lines_z6_7": {

"admin_areas_z6_7": {
"source": "admin_areas",
"tolerance": 200,
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6)"
},
"admin_boundaries_centroid_z6_7": {
"source": "admin_areas",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6) AND name IS NOT NULL AND name <> ''"
"sql_filter": "admin_level IN (1,2,3,4,5,6)",
"sub_tables": [
{
"table": "admin_boundaries_lines_z6_7",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z6_7",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"admin_boundaries_lines_z8_9": {

"admin_areas_z8_9": {
"source": "admin_areas",
"tolerance": 100,
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9)"
},
"admin_boundaries_centroid_z8_9": {
"source": "admin_areas",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9) AND name IS NOT NULL AND name <> ''"
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9)",
"sub_tables": [
{
"table": "admin_boundaries_lines_z8_9",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z8_9",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"admin_boundaries_lines_z10_12": {

"admin_areas_z10_12": {
"source": "admin_areas",
"tolerance": 20,
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)"
},
"admin_boundaries_centroid_z10_12": {
"source": "admin_areas",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10) AND name IS NOT NULL AND name <> ''"
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)",
"sub_tables": [
{
"table": "admin_boundaries_lines_z10_12",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z10_12",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"admin_boundaries_lines_z13_15": {

"admin_areas_z13_15": {
"source": "admin_areas",
"tolerance": 5,
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)"
},
"admin_boundaries_centroid_z13_15": {
"source": "admin_areas",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10) AND name IS NOT NULL AND name <> ''"
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)",
"sub_tables": [
{
"table": "admin_boundaries_lines_z13_15",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z13_15",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"admin_boundaries_lines_z16_20": {
"admin_areas_z16_20": {
"source": "admin_areas",
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)"
},
"admin_boundaries_centroid_z16_20": {
"source": "admin_areas",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10) AND name IS NOT NULL AND name <> ''"
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)",
"sub_tables": [
{
"table": "admin_boundaries_lines_z16_20",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z16_20",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
}
},
"tables": {
Expand Down
92 changes: 49 additions & 43 deletions images/tiler-imposm/config/layers/water_areas.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,74 @@
"water_areas_z0_2": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'riverbank') AND area > 100000000",
"tolerance": 5000
},
"water_areas_centroid_z0_2": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'riverbank') AND area > 100000000 AND name IS NOT NULL AND name <> ''",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')"
"tolerance": 5000,
"sub_tables": [
{
"table": "water_areas_centroid_z0_2",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"water_areas_z3_5": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 50000000",
"tolerance": 1000
},
"water_areas_centroid_z3_5": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 50000000 AND name IS NOT NULL AND name <> ''",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')"
"tolerance": 1000,
"sub_tables": [
{
"table": "water_areas_centroid_z3_5",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"water_areas_z6_7": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 1000000",
"tolerance": 200
},
"water_areas_centroid_z6_7": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 1000000 AND name IS NOT NULL AND name <> ''",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')"
"tolerance": 200,
"sub_tables": [
{
"table": "water_areas_centroid_z6_7",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"water_areas_z8_9": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 10000",
"tolerance": 100
},
"water_areas_centroid_z8_9": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 10000 AND name IS NOT NULL AND name <> ''",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')"
"tolerance": 100,
"sub_tables": [
{
"table": "water_areas_centroid_z8_9",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"water_areas_z10_12": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank')",
"tolerance": 20
},
"water_areas_centroid_z10_12": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND name IS NOT NULL AND name <> ''",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')"
"tolerance": 20,
"sub_tables": [
{
"table": "water_areas_centroid_z10_12",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
},
"water_areas_z13_15": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock')",
"tolerance": 5
},
"water_areas_centroid_z13_15": {
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock') AND name IS NOT NULL AND name <> ''",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')"
"tolerance": 5,
"sub_tables": [
{
"table": "water_areas_centroid_z13_15",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
]
}
},
"tables": {
Expand Down Expand Up @@ -126,4 +132,4 @@
}
}
}
}
}
Loading

0 comments on commit 5a91a98

Please sign in to comment.