This is an automated email from the ASF dual-hosted git repository. bchapuis pushed a commit to branch update-basemap in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
commit 6aa24c638181e223e2a5dafdbea984a0908db3b4 Author: Bertil Chapuis <[email protected]> AuthorDate: Sat Nov 11 12:04:19 2023 +0100 Add refresh statements for the materialized views --- basemap/{workflow.js => import.js} | 0 basemap/layers/boundary/globaladm0_clean.sql | 36 ---------- basemap/layers/boundary/globaladm0_index.sql | 28 -------- basemap/layers/boundary/globaladm0_simplify.sql | 76 ---------------------- basemap/layers/boundary/globaladm1_clean.sql | 36 ---------- basemap/layers/boundary/globaladm1_index.sql | 28 -------- basemap/layers/boundary/globaladm1_simplify.sql | 76 ---------------------- basemap/layers/highway/clean.sql | 25 ++++++- basemap/layers/highway/prepare.sql | 2 - .../{route/prepare.sql => highway/refresh.sql} | 27 ++++---- basemap/layers/landuse/clean.sql | 1 + basemap/layers/landuse/refresh.sql | 62 ++++++++++++++++++ basemap/layers/leisure/clean.sql | 1 + basemap/layers/leisure/index.sql | 1 + basemap/layers/leisure/prepare.sql | 1 + basemap/layers/leisure/refresh.sql | 62 ++++++++++++++++++ basemap/layers/linestring/clean.sql | 1 + basemap/layers/linestring/index.sql | 1 + basemap/layers/linestring/prepare.sql | 1 + .../{route/clean.sql => linestring/refresh.sql} | 3 +- .../layers/{route/clean.sql => member/refresh.sql} | 3 +- basemap/layers/natural/refresh.sql | 57 ++++++++++++++++ basemap/layers/point/index.sql | 1 + .../{linestring/prepare.sql => point/refresh.sql} | 24 +++---- .../{route/clean.sql => polygon/refresh.sql} | 3 +- basemap/layers/railway/clean.sql | 23 +++++++ basemap/layers/railway/index.sql | 1 + basemap/layers/railway/prepare.sql | 2 +- .../{route/prepare.sql => railway/refresh.sql} | 27 ++++---- basemap/layers/route/clean.sql | 23 +++++++ basemap/layers/route/index.sql | 1 + basemap/layers/route/prepare.sql | 1 + .../{linestring/prepare.sql => route/refresh.sql} | 23 ++++--- basemap/layers/route/simplify.sql | 1 + basemap/layers/waterway/clean.sql | 23 +++++++ basemap/layers/waterway/index.sql | 1 + basemap/layers/waterway/prepare.sql | 1 + .../{route/prepare.sql => waterway/refresh.sql} | 27 ++++---- basemap/update.js | 0 39 files changed, 360 insertions(+), 350 deletions(-) diff --git a/basemap/workflow.js b/basemap/import.js similarity index 100% rename from basemap/workflow.js rename to basemap/import.js diff --git a/basemap/layers/boundary/globaladm0_clean.sql b/basemap/layers/boundary/globaladm0_clean.sql deleted file mode 100644 index a729669e..00000000 --- a/basemap/layers/boundary/globaladm0_clean.sql +++ /dev/null @@ -1,36 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one or more --- contributor license agreements. See the NOTICE file distributed with --- this work for additional information regarding copyright ownership. --- The ASF licenses this file to you under the Apache License, Version 2.0 --- (the "License"); you may not use this file except in compliance with --- the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. -DROP VIEW IF EXISTS globaladm0_z20 CASCADE; -DROP VIEW IF EXISTS globaladm0_z19 CASCADE; -DROP VIEW IF EXISTS globaladm0_z18 CASCADE; -DROP VIEW IF EXISTS globaladm0_z17 CASCADE; -DROP VIEW IF EXISTS globaladm0_z16 CASCADE; -DROP VIEW IF EXISTS globaladm0_z15 CASCADE; -DROP VIEW IF EXISTS globaladm0_z14 CASCADE; -DROP VIEW IF EXISTS globaladm0_z13 CASCADE; - -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z12 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z11 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z10 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z9 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z8 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z7 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z6 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z5 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z4 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z3 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z2 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z1 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm0_z0 CASCADE; diff --git a/basemap/layers/boundary/globaladm0_index.sql b/basemap/layers/boundary/globaladm0_index.sql deleted file mode 100644 index bfbeeb8d..00000000 --- a/basemap/layers/boundary/globaladm0_index.sql +++ /dev/null @@ -1,28 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one or more --- contributor license agreements. See the NOTICE file distributed with --- this work for additional information regarding copyright ownership. --- The ASF licenses this file to you under the Apache License, Version 2.0 --- (the "License"); you may not use this file except in compliance with --- the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. -CREATE INDEX IF NOT EXISTS globaladm0_index ON "globalADM0" USING SPGIST(geom); -CREATE INDEX IF NOT EXISTS globaladm0_z12_index ON globaladm0_z12 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z11_index ON globaladm0_z11 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z10_index ON globaladm0_z10 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z9_index ON globaladm0_z9 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z8_index ON globaladm0_z8 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z7_index ON globaladm0_z7 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z6_index ON globaladm0_z6 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z5_index ON globaladm0_z5 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z4_index ON globaladm0_z4 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z3_index ON globaladm0_z3 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z2_index ON globaladm0_z2 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z1_index ON globaladm0_z1 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm0_z0_index ON globaladm0_z0 USING SPGIST (geom); diff --git a/basemap/layers/boundary/globaladm0_simplify.sql b/basemap/layers/boundary/globaladm0_simplify.sql deleted file mode 100644 index c6d42f3c..00000000 --- a/basemap/layers/boundary/globaladm0_simplify.sql +++ /dev/null @@ -1,76 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one or more --- contributor license agreements. See the NOTICE file distributed with --- this work for additional information regarding copyright ownership. --- The ASF licenses this file to you under the Apache License, Version 2.0 --- (the "License"); you may not use this file except in compliance with --- the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. -CREATE VIEW globaladm0_z20 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE VIEW globaladm0_z19 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE VIEW globaladm0_z18 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE VIEW globaladm0_z17 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE VIEW globaladm0_z16 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE VIEW globaladm0_z15 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE VIEW globaladm0_z14 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE VIEW globaladm0_z13 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z12 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 12)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z11 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 11)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z10 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 10)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z9 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 9)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z8 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 8)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z7 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 7)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z6 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 6)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z5 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 5)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z4 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 4)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z3 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 3)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z2 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 2)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z1 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 1)) AS geom FROM "globalADM0"; - -CREATE MATERIALIZED VIEW globaladm0_z0 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 0)) AS geom FROM "globalADM0"; diff --git a/basemap/layers/boundary/globaladm1_clean.sql b/basemap/layers/boundary/globaladm1_clean.sql deleted file mode 100644 index a6b2377b..00000000 --- a/basemap/layers/boundary/globaladm1_clean.sql +++ /dev/null @@ -1,36 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one or more --- contributor license agreements. See the NOTICE file distributed with --- this work for additional information regarding copyright ownership. --- The ASF licenses this file to you under the Apache License, Version 2.0 --- (the "License"); you may not use this file except in compliance with --- the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. -DROP VIEW IF EXISTS globaladm1_z20 CASCADE; -DROP VIEW IF EXISTS globaladm1_z19 CASCADE; -DROP VIEW IF EXISTS globaladm1_z18 CASCADE; -DROP VIEW IF EXISTS globaladm1_z17 CASCADE; -DROP VIEW IF EXISTS globaladm1_z16 CASCADE; -DROP VIEW IF EXISTS globaladm1_z15 CASCADE; -DROP VIEW IF EXISTS globaladm1_z14 CASCADE; -DROP VIEW IF EXISTS globaladm1_z13 CASCADE; - -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z12 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z11 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z10 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z9 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z8 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z7 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z6 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z5 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z4 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z3 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z2 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z1 CASCADE; -DROP MATERIALIZED VIEW IF EXISTS globaladm1_z0 CASCADE; diff --git a/basemap/layers/boundary/globaladm1_index.sql b/basemap/layers/boundary/globaladm1_index.sql deleted file mode 100644 index 3dfe8d30..00000000 --- a/basemap/layers/boundary/globaladm1_index.sql +++ /dev/null @@ -1,28 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one or more --- contributor license agreements. See the NOTICE file distributed with --- this work for additional information regarding copyright ownership. --- The ASF licenses this file to you under the Apache License, Version 2.0 --- (the "License"); you may not use this file except in compliance with --- the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. -CREATE INDEX IF NOT EXISTS globaladm1_index ON "globalADM1" USING SPGIST(geom); -CREATE INDEX IF NOT EXISTS globaladm1_z12_index ON globaladm1_z12 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z11_index ON globaladm1_z11 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z10_index ON globaladm1_z10 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z9_index ON globaladm1_z9 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z8_index ON globaladm1_z8 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z7_index ON globaladm1_z7 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z6_index ON globaladm1_z6 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z5_index ON globaladm1_z5 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z4_index ON globaladm1_z4 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z3_index ON globaladm1_z3 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z2_index ON globaladm1_z2 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z1_index ON globaladm1_z1 USING SPGIST (geom); -CREATE INDEX IF NOT EXISTS globaladm1_z0_index ON globaladm1_z0 USING SPGIST (geom); diff --git a/basemap/layers/boundary/globaladm1_simplify.sql b/basemap/layers/boundary/globaladm1_simplify.sql deleted file mode 100644 index 86696433..00000000 --- a/basemap/layers/boundary/globaladm1_simplify.sql +++ /dev/null @@ -1,76 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one or more --- contributor license agreements. See the NOTICE file distributed with --- this work for additional information regarding copyright ownership. --- The ASF licenses this file to you under the Apache License, Version 2.0 --- (the "License"); you may not use this file except in compliance with --- the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. -CREATE VIEW globaladm1_z20 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE VIEW globaladm1_z19 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE VIEW globaladm1_z18 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE VIEW globaladm1_z17 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE VIEW globaladm1_z16 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE VIEW globaladm1_z15 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE VIEW globaladm1_z14 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE VIEW globaladm1_z13 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z12 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 12)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z11 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 11)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z10 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 10)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z9 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 9)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z8 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 8)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z7 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 7)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z6 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 6)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z5 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 5)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z4 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 4)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z3 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 3)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z2 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 2)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z1 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 1)) AS geom FROM "globalADM1"; - -CREATE MATERIALIZED VIEW globaladm1_z0 AS -SELECT fid, "shapeGroup" as shapegroup, "shapeType" as shapetype, st_simplifypreservetopology(geom, 78270 / power(2, 0)) AS geom FROM "globalADM1"; diff --git a/basemap/layers/highway/clean.sql b/basemap/layers/highway/clean.sql index 8350fac8..b3fa7321 100644 --- a/basemap/layers/highway/clean.sql +++ b/basemap/layers/highway/clean.sql @@ -12,4 +12,27 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_highway CASCADE; + +DROP VIEW IF EXISTS osm_highway CASCADE; + +DROP VIEW IF EXISTS osm_highway_z20 CASCADE; +DROP VIEW IF EXISTS osm_highway_z19 CASCADE; +DROP VIEW IF EXISTS osm_highway_z18 CASCADE; +DROP VIEW IF EXISTS osm_highway_z17 CASCADE; +DROP VIEW IF EXISTS osm_highway_z16 CASCADE; +DROP VIEW IF EXISTS osm_highway_z15 CASCADE; +DROP VIEW IF EXISTS osm_highway_z14 CASCADE; +DROP VIEW IF EXISTS osm_highway_z13 CASCADE; + +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z12 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z11 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z10 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z9 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z8 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z7 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z6 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z5 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z4 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z3 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z2 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_highway_z1 CASCADE; diff --git a/basemap/layers/highway/prepare.sql b/basemap/layers/highway/prepare.sql index dff5eb1c..b29d130d 100644 --- a/basemap/layers/highway/prepare.sql +++ b/basemap/layers/highway/prepare.sql @@ -12,8 +12,6 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_highway CASCADE; - CREATE MATERIALIZED VIEW osm_highway AS WITH -- Filter the linestrings diff --git a/basemap/layers/route/prepare.sql b/basemap/layers/highway/refresh.sql similarity index 59% copy from basemap/layers/route/prepare.sql copy to basemap/layers/highway/refresh.sql index cc25bd0b..cfb9bc4a 100644 --- a/basemap/layers/route/prepare.sql +++ b/basemap/layers/highway/refresh.sql @@ -12,19 +12,18 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; -CREATE MATERIALIZED VIEW osm_route AS -SELECT id, tags, geom -FROM ( - SELECT - min(id) as id, - jsonb_build_object('route', tags -> 'route') as tags, - (st_dump(st_linemerge(st_collect(geom)))).geom as geom - FROM osm_ways - WHERE tags ->> 'route' IN ('light_rail', 'monorail', 'rail', 'subway', 'tram') - AND NOT tags ? 'service' - GROUP BY tags -> 'route' -) AS merge; +REFRESH MATERIALIZED VIEW osm_highway; -CREATE INDEX IF NOT EXISTS osm_route_geom_index ON osm_route USING SPGIST (geom); +REFRESH MATERIALIZED VIEW osm_highway_z12; +REFRESH MATERIALIZED VIEW osm_highway_z11; +REFRESH MATERIALIZED VIEW osm_highway_z10; +REFRESH MATERIALIZED VIEW osm_highway_z9; +REFRESH MATERIALIZED VIEW osm_highway_z8; +REFRESH MATERIALIZED VIEW osm_highway_z7; +REFRESH MATERIALIZED VIEW osm_highway_z6; +REFRESH MATERIALIZED VIEW osm_highway_z5; +REFRESH MATERIALIZED VIEW osm_highway_z4; +REFRESH MATERIALIZED VIEW osm_highway_z3; +REFRESH MATERIALIZED VIEW osm_highway_z2; +REFRESH MATERIALIZED VIEW osm_highway_z1; \ No newline at end of file diff --git a/basemap/layers/landuse/clean.sql b/basemap/layers/landuse/clean.sql index 294ce311..1032d5c6 100644 --- a/basemap/layers/landuse/clean.sql +++ b/basemap/layers/landuse/clean.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_landuse_filtered CASCADE; DROP MATERIALIZED VIEW IF EXISTS osm_landuse_clustered CASCADE; DROP MATERIALIZED VIEW IF EXISTS osm_landuse_grouped CASCADE; diff --git a/basemap/layers/landuse/refresh.sql b/basemap/layers/landuse/refresh.sql new file mode 100644 index 00000000..0cfb37f5 --- /dev/null +++ b/basemap/layers/landuse/refresh.sql @@ -0,0 +1,62 @@ +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to you under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +REFRESH MATERIALIZED VIEW osm_landuse_filtered; +REFRESH MATERIALIZED VIEW osm_landuse_clustered; +REFRESH MATERIALIZED VIEW osm_landuse_grouped; +REFRESH MATERIALIZED VIEW osm_landuse_buffered; +REFRESH MATERIALIZED VIEW osm_landuse_exploded; +REFRESH MATERIALIZED VIEW osm_landuse; + +REFRESH MATERIALIZED VIEW osm_landuse_xl_filtered; +REFRESH MATERIALIZED VIEW osm_landuse_xl_clustered; +REFRESH MATERIALIZED VIEW osm_landuse_xl_grouped; +REFRESH MATERIALIZED VIEW osm_landuse_xl_buffered; +REFRESH MATERIALIZED VIEW osm_landuse_xl_exploded; +REFRESH MATERIALIZED VIEW osm_landuse_xl; + +REFRESH MATERIALIZED VIEW osm_landuse_l_filtered; +REFRESH MATERIALIZED VIEW osm_landuse_l_clustered; +REFRESH MATERIALIZED VIEW osm_landuse_l_grouped; +REFRESH MATERIALIZED VIEW osm_landuse_l_buffered; +REFRESH MATERIALIZED VIEW osm_landuse_l_exploded; +REFRESH MATERIALIZED VIEW osm_landuse_l; + +REFRESH MATERIALIZED VIEW osm_landuse_m_filtered; +REFRESH MATERIALIZED VIEW osm_landuse_m_clustered; +REFRESH MATERIALIZED VIEW osm_landuse_m_grouped; +REFRESH MATERIALIZED VIEW osm_landuse_m_buffered; +REFRESH MATERIALIZED VIEW osm_landuse_m_exploded; +REFRESH MATERIALIZED VIEW osm_landuse_m; + +REFRESH MATERIALIZED VIEW osm_landuse_s_filtered; +REFRESH MATERIALIZED VIEW osm_landuse_s_clustered; +REFRESH MATERIALIZED VIEW osm_landuse_s_grouped; +REFRESH MATERIALIZED VIEW osm_landuse_s_buffered; +REFRESH MATERIALIZED VIEW osm_landuse_s_exploded; +REFRESH MATERIALIZED VIEW osm_landuse_s; + +REFRESH MATERIALIZED VIEW osm_landuse_z12; +REFRESH MATERIALIZED VIEW osm_landuse_z11; +REFRESH MATERIALIZED VIEW osm_landuse_z10; +REFRESH MATERIALIZED VIEW osm_landuse_z9; +REFRESH MATERIALIZED VIEW osm_landuse_z8; +REFRESH MATERIALIZED VIEW osm_landuse_z7; +REFRESH MATERIALIZED VIEW osm_landuse_z6; +REFRESH MATERIALIZED VIEW osm_landuse_z5; +REFRESH MATERIALIZED VIEW osm_landuse_z4; +REFRESH MATERIALIZED VIEW osm_landuse_z3; +REFRESH MATERIALIZED VIEW osm_landuse_z2; +REFRESH MATERIALIZED VIEW osm_landuse_z1; diff --git a/basemap/layers/leisure/clean.sql b/basemap/layers/leisure/clean.sql index 9b97c9dc..de58d7bb 100644 --- a/basemap/layers/leisure/clean.sql +++ b/basemap/layers/leisure/clean.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_leisure_filtered CASCADE; DROP MATERIALIZED VIEW IF EXISTS osm_leisure_clustered CASCADE; DROP MATERIALIZED VIEW IF EXISTS osm_leisure_grouped CASCADE; diff --git a/basemap/layers/leisure/index.sql b/basemap/layers/leisure/index.sql index 5efaf447..3029ef15 100644 --- a/basemap/layers/leisure/index.sql +++ b/basemap/layers/leisure/index.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE INDEX IF NOT EXISTS osm_leisure_geom_z1_index ON osm_leisure_z1 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_leisure_geom_z2_index ON osm_leisure_z2 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_leisure_geom_z3_index ON osm_leisure_z3 USING SPGIST (geom); diff --git a/basemap/layers/leisure/prepare.sql b/basemap/layers/leisure/prepare.sql index 75b99c3f..aba4c2ab 100644 --- a/basemap/layers/leisure/prepare.sql +++ b/basemap/layers/leisure/prepare.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE MATERIALIZED VIEW osm_leisure_filtered AS SELECT tags -> 'leisure' AS leisure, diff --git a/basemap/layers/leisure/refresh.sql b/basemap/layers/leisure/refresh.sql new file mode 100644 index 00000000..93a62c5d --- /dev/null +++ b/basemap/layers/leisure/refresh.sql @@ -0,0 +1,62 @@ +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to you under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +REFRESH MATERIALIZED VIEW osm_leisure_filtered; +REFRESH MATERIALIZED VIEW osm_leisure_clustered; +REFRESH MATERIALIZED VIEW osm_leisure_grouped; +REFRESH MATERIALIZED VIEW osm_leisure_buffered; +REFRESH MATERIALIZED VIEW osm_leisure_exploded; +REFRESH MATERIALIZED VIEW osm_leisure; + +REFRESH MATERIALIZED VIEW osm_leisure_xl_filtered; +REFRESH MATERIALIZED VIEW osm_leisure_xl_clustered; +REFRESH MATERIALIZED VIEW osm_leisure_xl_grouped; +REFRESH MATERIALIZED VIEW osm_leisure_xl_buffered; +REFRESH MATERIALIZED VIEW osm_leisure_xl_exploded; +REFRESH MATERIALIZED VIEW osm_leisure_xl; + +REFRESH MATERIALIZED VIEW osm_leisure_l_filtered; +REFRESH MATERIALIZED VIEW osm_leisure_l_clustered; +REFRESH MATERIALIZED VIEW osm_leisure_l_grouped; +REFRESH MATERIALIZED VIEW osm_leisure_l_buffered; +REFRESH MATERIALIZED VIEW osm_leisure_l_exploded; +REFRESH MATERIALIZED VIEW osm_leisure_l; + +REFRESH MATERIALIZED VIEW osm_leisure_m_filtered; +REFRESH MATERIALIZED VIEW osm_leisure_m_clustered; +REFRESH MATERIALIZED VIEW osm_leisure_m_grouped; +REFRESH MATERIALIZED VIEW osm_leisure_m_buffered; +REFRESH MATERIALIZED VIEW osm_leisure_m_exploded; +REFRESH MATERIALIZED VIEW osm_leisure_m; + +REFRESH MATERIALIZED VIEW osm_leisure_s_filtered; +REFRESH MATERIALIZED VIEW osm_leisure_s_clustered; +REFRESH MATERIALIZED VIEW osm_leisure_s_grouped; +REFRESH MATERIALIZED VIEW osm_leisure_s_buffered; +REFRESH MATERIALIZED VIEW osm_leisure_s_exploded; +REFRESH MATERIALIZED VIEW osm_leisure_s; + +REFRESH MATERIALIZED VIEW osm_leisure_z12; +REFRESH MATERIALIZED VIEW osm_leisure_z11; +REFRESH MATERIALIZED VIEW osm_leisure_z10; +REFRESH MATERIALIZED VIEW osm_leisure_z9; +REFRESH MATERIALIZED VIEW osm_leisure_z8; +REFRESH MATERIALIZED VIEW osm_leisure_z7; +REFRESH MATERIALIZED VIEW osm_leisure_z6; +REFRESH MATERIALIZED VIEW osm_leisure_z5; +REFRESH MATERIALIZED VIEW osm_leisure_z4; +REFRESH MATERIALIZED VIEW osm_leisure_z3; +REFRESH MATERIALIZED VIEW osm_leisure_z2; +REFRESH MATERIALIZED VIEW osm_leisure_z1; diff --git a/basemap/layers/linestring/clean.sql b/basemap/layers/linestring/clean.sql index 11f941d8..a7a69450 100644 --- a/basemap/layers/linestring/clean.sql +++ b/basemap/layers/linestring/clean.sql @@ -12,4 +12,5 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_linestring CASCADE; diff --git a/basemap/layers/linestring/index.sql b/basemap/layers/linestring/index.sql index edb77ae7..6c82ea12 100644 --- a/basemap/layers/linestring/index.sql +++ b/basemap/layers/linestring/index.sql @@ -12,5 +12,6 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE INDEX IF NOT EXISTS osm_linestring_tags_index ON osm_linestring USING gin (tags); CREATE INDEX IF NOT EXISTS osm_linestring_geom_index ON osm_linestring USING gist (geom); \ No newline at end of file diff --git a/basemap/layers/linestring/prepare.sql b/basemap/layers/linestring/prepare.sql index e86180d0..fb7b1cf3 100644 --- a/basemap/layers/linestring/prepare.sql +++ b/basemap/layers/linestring/prepare.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_linestring CASCADE; CREATE MATERIALIZED VIEW osm_linestring AS diff --git a/basemap/layers/route/clean.sql b/basemap/layers/linestring/refresh.sql similarity index 93% copy from basemap/layers/route/clean.sql copy to basemap/layers/linestring/refresh.sql index 711f993c..f665292e 100644 --- a/basemap/layers/route/clean.sql +++ b/basemap/layers/linestring/refresh.sql @@ -12,4 +12,5 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; + +REFRESH MATERIALIZED VIEW osm_linestring; diff --git a/basemap/layers/route/clean.sql b/basemap/layers/member/refresh.sql similarity index 93% copy from basemap/layers/route/clean.sql copy to basemap/layers/member/refresh.sql index 711f993c..1056b2b2 100644 --- a/basemap/layers/route/clean.sql +++ b/basemap/layers/member/refresh.sql @@ -12,4 +12,5 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; + +REFRESH MATERIALIZED VIEW osm_member; diff --git a/basemap/layers/natural/refresh.sql b/basemap/layers/natural/refresh.sql new file mode 100644 index 00000000..215d35ab --- /dev/null +++ b/basemap/layers/natural/refresh.sql @@ -0,0 +1,57 @@ +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to you under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. + +REFRESH MATERIALIZED VIEW osm_natural_filtered; +REFRESH MATERIALIZED VIEW osm_natural_clustered; +REFRESH MATERIALIZED VIEW osm_natural_grouped; +REFRESH MATERIALIZED VIEW osm_natural_buffered; +REFRESH MATERIALIZED VIEW osm_natural_exploded; +REFRESH MATERIALIZED VIEW osm_natural; + +REFRESH MATERIALIZED VIEW osm_natural_xl_filtered; +REFRESH MATERIALIZED VIEW osm_natural_xl_clustered; +REFRESH MATERIALIZED VIEW osm_natural_xl_grouped; +REFRESH MATERIALIZED VIEW osm_natural_xl_buffered; +REFRESH MATERIALIZED VIEW osm_natural_xl_exploded; +REFRESH MATERIALIZED VIEW osm_natural_xl; + +-- Why don't we have a natural_l view? + +REFRESH MATERIALIZED VIEW osm_natural_m_filtered; +REFRESH MATERIALIZED VIEW osm_natural_m_clustered; +REFRESH MATERIALIZED VIEW osm_natural_m_grouped; +REFRESH MATERIALIZED VIEW osm_natural_m_buffered; +REFRESH MATERIALIZED VIEW osm_natural_m_exploded; +REFRESH MATERIALIZED VIEW osm_natural_m; + +REFRESH MATERIALIZED VIEW osm_natural_s_filtered; +REFRESH MATERIALIZED VIEW osm_natural_s_clustered; +REFRESH MATERIALIZED VIEW osm_natural_s_grouped; +REFRESH MATERIALIZED VIEW osm_natural_s_buffered; +REFRESH MATERIALIZED VIEW osm_natural_s_exploded; +REFRESH MATERIALIZED VIEW osm_natural_s; + +REFRESH MATERIALIZED VIEW osm_natural_z12; +REFRESH MATERIALIZED VIEW osm_natural_z11; +REFRESH MATERIALIZED VIEW osm_natural_z10; +REFRESH MATERIALIZED VIEW osm_natural_z9; +REFRESH MATERIALIZED VIEW osm_natural_z8; +REFRESH MATERIALIZED VIEW osm_natural_z7; +REFRESH MATERIALIZED VIEW osm_natural_z6; +REFRESH MATERIALIZED VIEW osm_natural_z5; +REFRESH MATERIALIZED VIEW osm_natural_z4; +REFRESH MATERIALIZED VIEW osm_natural_z3; +REFRESH MATERIALIZED VIEW osm_natural_z2; +REFRESH MATERIALIZED VIEW osm_natural_z1; diff --git a/basemap/layers/point/index.sql b/basemap/layers/point/index.sql index 9706058d..1c9c24e8 100644 --- a/basemap/layers/point/index.sql +++ b/basemap/layers/point/index.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE INDEX IF NOT EXISTS osm_point_geom_z13_index ON osm_point_z13 USING gist (geom); CREATE INDEX IF NOT EXISTS osm_point_geom_z12_index ON osm_point_z12 USING gist (geom); CREATE INDEX IF NOT EXISTS osm_point_geom_z11_index ON osm_point_z11 USING gist (geom); diff --git a/basemap/layers/linestring/prepare.sql b/basemap/layers/point/refresh.sql similarity index 60% copy from basemap/layers/linestring/prepare.sql copy to basemap/layers/point/refresh.sql index e86180d0..981821ba 100644 --- a/basemap/layers/linestring/prepare.sql +++ b/basemap/layers/point/refresh.sql @@ -12,15 +12,17 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_linestring CASCADE; -CREATE MATERIALIZED VIEW osm_linestring AS -SELECT id, tags, geom, changeset -FROM osm_ways -LEFT JOIN osm_member ON id = member_ref -WHERE ST_GeometryType(osm_ways.geom) = 'ST_LineString' - AND tags != '{}' - AND member_ref IS NULL; - -CREATE INDEX IF NOT EXISTS osm_linestring_tags_index ON osm_linestring USING gin (tags); -CREATE INDEX IF NOT EXISTS osm_linestring_geom_index ON osm_linestring USING gist (geom); +REFRESH MATERIALIZED VIEW osm_point_z13; +REFRESH MATERIALIZED VIEW osm_point_z12; +REFRESH MATERIALIZED VIEW osm_point_z11; +REFRESH MATERIALIZED VIEW osm_point_z10; +REFRESH MATERIALIZED VIEW osm_point_z9; +REFRESH MATERIALIZED VIEW osm_point_z8; +REFRESH MATERIALIZED VIEW osm_point_z7; +REFRESH MATERIALIZED VIEW osm_point_z6; +REFRESH MATERIALIZED VIEW osm_point_z5; +REFRESH MATERIALIZED VIEW osm_point_z4; +REFRESH MATERIALIZED VIEW osm_point_z3; +REFRESH MATERIALIZED VIEW osm_point_z2; +REFRESH MATERIALIZED VIEW osm_point_z1; \ No newline at end of file diff --git a/basemap/layers/route/clean.sql b/basemap/layers/polygon/refresh.sql similarity index 93% copy from basemap/layers/route/clean.sql copy to basemap/layers/polygon/refresh.sql index 711f993c..580d6f9e 100644 --- a/basemap/layers/route/clean.sql +++ b/basemap/layers/polygon/refresh.sql @@ -12,4 +12,5 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; + +REFRESH MATERIALIZED VIEW osm_polygon; \ No newline at end of file diff --git a/basemap/layers/railway/clean.sql b/basemap/layers/railway/clean.sql index 5cbdfd6f..28bb55fb 100644 --- a/basemap/layers/railway/clean.sql +++ b/basemap/layers/railway/clean.sql @@ -12,4 +12,27 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_railway CASCADE; + +DROP VIEW IF EXISTS osm_railway_z20 CASCADE; +DROP VIEW IF EXISTS osm_railway_z19 CASCADE; +DROP VIEW IF EXISTS osm_railway_z18 CASCADE; +DROP VIEW IF EXISTS osm_railway_z17 CASCADE; +DROP VIEW IF EXISTS osm_railway_z16 CASCADE; +DROP VIEW IF EXISTS osm_railway_z15 CASCADE; +DROP VIEW IF EXISTS osm_railway_z14 CASCADE; +DROP VIEW IF EXISTS osm_railway_z13 CASCADE; + +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z12 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z11 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z10 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z9 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z8 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z7 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z6 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z5 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z4 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z3 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z2 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_railway_z1 CASCADE; diff --git a/basemap/layers/railway/index.sql b/basemap/layers/railway/index.sql index 34a6c2a1..df2d0d5b 100644 --- a/basemap/layers/railway/index.sql +++ b/basemap/layers/railway/index.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE INDEX IF NOT EXISTS osm_railway_geom_z12_index ON osm_railway_z12 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_railway_geom_z11_index ON osm_railway_z11 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_railway_geom_z10_index ON osm_railway_z10 USING SPGIST (geom); diff --git a/basemap/layers/railway/prepare.sql b/basemap/layers/railway/prepare.sql index c9222865..7ccfa2a3 100644 --- a/basemap/layers/railway/prepare.sql +++ b/basemap/layers/railway/prepare.sql @@ -12,7 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_railway CASCADE; + CREATE MATERIALIZED VIEW osm_railway AS SELECT id, tags, geom FROM ( diff --git a/basemap/layers/route/prepare.sql b/basemap/layers/railway/refresh.sql similarity index 59% copy from basemap/layers/route/prepare.sql copy to basemap/layers/railway/refresh.sql index cc25bd0b..81f52c13 100644 --- a/basemap/layers/route/prepare.sql +++ b/basemap/layers/railway/refresh.sql @@ -12,19 +12,18 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; -CREATE MATERIALIZED VIEW osm_route AS -SELECT id, tags, geom -FROM ( - SELECT - min(id) as id, - jsonb_build_object('route', tags -> 'route') as tags, - (st_dump(st_linemerge(st_collect(geom)))).geom as geom - FROM osm_ways - WHERE tags ->> 'route' IN ('light_rail', 'monorail', 'rail', 'subway', 'tram') - AND NOT tags ? 'service' - GROUP BY tags -> 'route' -) AS merge; +REFRESH MATERIALIZED VIEW osm_railway; -CREATE INDEX IF NOT EXISTS osm_route_geom_index ON osm_route USING SPGIST (geom); +REFRESH MATERIALIZED VIEW osm_railway_z12; +REFRESH MATERIALIZED VIEW osm_railway_z11; +REFRESH MATERIALIZED VIEW osm_railway_z10; +REFRESH MATERIALIZED VIEW osm_railway_z9; +REFRESH MATERIALIZED VIEW osm_railway_z8; +REFRESH MATERIALIZED VIEW osm_railway_z7; +REFRESH MATERIALIZED VIEW osm_railway_z6; +REFRESH MATERIALIZED VIEW osm_railway_z5; +REFRESH MATERIALIZED VIEW osm_railway_z4; +REFRESH MATERIALIZED VIEW osm_railway_z3; +REFRESH MATERIALIZED VIEW osm_railway_z2; +REFRESH MATERIALIZED VIEW osm_railway_z1; diff --git a/basemap/layers/route/clean.sql b/basemap/layers/route/clean.sql index 711f993c..1b5358ae 100644 --- a/basemap/layers/route/clean.sql +++ b/basemap/layers/route/clean.sql @@ -12,4 +12,27 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; + +DROP VIEW IF EXISTS osm_route_z20 CASCADE; +DROP VIEW IF EXISTS osm_route_z19 CASCADE; +DROP VIEW IF EXISTS osm_route_z18 CASCADE; +DROP VIEW IF EXISTS osm_route_z17 CASCADE; +DROP VIEW IF EXISTS osm_route_z16 CASCADE; +DROP VIEW IF EXISTS osm_route_z15 CASCADE; +DROP VIEW IF EXISTS osm_route_z14 CASCADE; +DROP VIEW IF EXISTS osm_route_z13 CASCADE; + +DROP MATERIALIZED VIEW IF EXISTS osm_route_z12 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z11 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z10 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z9 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z8 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z7 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z6 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z5 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z4 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z3 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z2 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_route_z1 CASCADE; diff --git a/basemap/layers/route/index.sql b/basemap/layers/route/index.sql index 0f5eabd3..3b2a8ac9 100644 --- a/basemap/layers/route/index.sql +++ b/basemap/layers/route/index.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE INDEX IF NOT EXISTS osm_route_geom_z12_index ON osm_route_z12 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_route_geom_z11_index ON osm_route_z11 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_route_geom_z10_index ON osm_route_z10 USING SPGIST (geom); diff --git a/basemap/layers/route/prepare.sql b/basemap/layers/route/prepare.sql index cc25bd0b..a06761fb 100644 --- a/basemap/layers/route/prepare.sql +++ b/basemap/layers/route/prepare.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; CREATE MATERIALIZED VIEW osm_route AS diff --git a/basemap/layers/linestring/prepare.sql b/basemap/layers/route/refresh.sql similarity index 60% copy from basemap/layers/linestring/prepare.sql copy to basemap/layers/route/refresh.sql index e86180d0..a25194f9 100644 --- a/basemap/layers/linestring/prepare.sql +++ b/basemap/layers/route/refresh.sql @@ -12,15 +12,18 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_linestring CASCADE; -CREATE MATERIALIZED VIEW osm_linestring AS -SELECT id, tags, geom, changeset -FROM osm_ways -LEFT JOIN osm_member ON id = member_ref -WHERE ST_GeometryType(osm_ways.geom) = 'ST_LineString' - AND tags != '{}' - AND member_ref IS NULL; +REFRESH MATERIALIZED VIEW osm_route; -CREATE INDEX IF NOT EXISTS osm_linestring_tags_index ON osm_linestring USING gin (tags); -CREATE INDEX IF NOT EXISTS osm_linestring_geom_index ON osm_linestring USING gist (geom); +REFRESH MATERIALIZED VIEW osm_route_z12; +REFRESH MATERIALIZED VIEW osm_route_z11; +REFRESH MATERIALIZED VIEW osm_route_z10; +REFRESH MATERIALIZED VIEW osm_route_z9; +REFRESH MATERIALIZED VIEW osm_route_z8; +REFRESH MATERIALIZED VIEW osm_route_z7; +REFRESH MATERIALIZED VIEW osm_route_z6; +REFRESH MATERIALIZED VIEW osm_route_z5; +REFRESH MATERIALIZED VIEW osm_route_z4; +REFRESH MATERIALIZED VIEW osm_route_z3; +REFRESH MATERIALIZED VIEW osm_route_z2; +REFRESH MATERIALIZED VIEW osm_route_z1; diff --git a/basemap/layers/route/simplify.sql b/basemap/layers/route/simplify.sql index f1766c65..ef528424 100644 --- a/basemap/layers/route/simplify.sql +++ b/basemap/layers/route/simplify.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE VIEW osm_route_z20 AS SELECT id, tags, geom FROM osm_route; diff --git a/basemap/layers/waterway/clean.sql b/basemap/layers/waterway/clean.sql index 3726734f..b5c2bfdb 100644 --- a/basemap/layers/waterway/clean.sql +++ b/basemap/layers/waterway/clean.sql @@ -12,4 +12,27 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_waterway CASCADE; + +DROP VIEW IF EXISTS osm_waterway_z20 CASCADE; +DROP VIEW IF EXISTS osm_waterway_z19 CASCADE; +DROP VIEW IF EXISTS osm_waterway_z18 CASCADE; +DROP VIEW IF EXISTS osm_waterway_z17 CASCADE; +DROP VIEW IF EXISTS osm_waterway_z16 CASCADE; +DROP VIEW IF EXISTS osm_waterway_z15 CASCADE; +DROP VIEW IF EXISTS osm_waterway_z14 CASCADE; +DROP VIEW IF EXISTS osm_waterway_z13 CASCADE; + +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z12 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z11 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z10 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z9 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z8 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z7 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z6 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z5 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z4 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z3 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z2 CASCADE; +DROP MATERIALIZED VIEW IF EXISTS osm_waterway_z1 CASCADE; diff --git a/basemap/layers/waterway/index.sql b/basemap/layers/waterway/index.sql index 81ddb5c1..06e1484b 100644 --- a/basemap/layers/waterway/index.sql +++ b/basemap/layers/waterway/index.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + CREATE INDEX IF NOT EXISTS osm_waterway_geom_z12_index ON osm_waterway_z12 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_waterway_geom_z11_index ON osm_waterway_z11 USING SPGIST (geom); CREATE INDEX IF NOT EXISTS osm_waterway_geom_z10_index ON osm_waterway_z10 USING SPGIST (geom); diff --git a/basemap/layers/waterway/prepare.sql b/basemap/layers/waterway/prepare.sql index 54c8928a..1e079d36 100644 --- a/basemap/layers/waterway/prepare.sql +++ b/basemap/layers/waterway/prepare.sql @@ -12,6 +12,7 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. + DROP MATERIALIZED VIEW IF EXISTS osm_waterway CASCADE; CREATE MATERIALIZED VIEW osm_waterway AS diff --git a/basemap/layers/route/prepare.sql b/basemap/layers/waterway/refresh.sql similarity index 58% copy from basemap/layers/route/prepare.sql copy to basemap/layers/waterway/refresh.sql index cc25bd0b..b18034ba 100644 --- a/basemap/layers/route/prepare.sql +++ b/basemap/layers/waterway/refresh.sql @@ -12,19 +12,18 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -DROP MATERIALIZED VIEW IF EXISTS osm_route CASCADE; -CREATE MATERIALIZED VIEW osm_route AS -SELECT id, tags, geom -FROM ( - SELECT - min(id) as id, - jsonb_build_object('route', tags -> 'route') as tags, - (st_dump(st_linemerge(st_collect(geom)))).geom as geom - FROM osm_ways - WHERE tags ->> 'route' IN ('light_rail', 'monorail', 'rail', 'subway', 'tram') - AND NOT tags ? 'service' - GROUP BY tags -> 'route' -) AS merge; +REFRESH MATERIALIZED VIEW osm_waterway; -CREATE INDEX IF NOT EXISTS osm_route_geom_index ON osm_route USING SPGIST (geom); +REFRESH MATERIALIZED VIEW osm_waterway_z12; +REFRESH MATERIALIZED VIEW osm_waterway_z11; +REFRESH MATERIALIZED VIEW osm_waterway_z10; +REFRESH MATERIALIZED VIEW osm_waterway_z9; +REFRESH MATERIALIZED VIEW osm_waterway_z8; +REFRESH MATERIALIZED VIEW osm_waterway_z7; +REFRESH MATERIALIZED VIEW osm_waterway_z6; +REFRESH MATERIALIZED VIEW osm_waterway_z5; +REFRESH MATERIALIZED VIEW osm_waterway_z4; +REFRESH MATERIALIZED VIEW osm_waterway_z3; +REFRESH MATERIALIZED VIEW osm_waterway_z2; +REFRESH MATERIALIZED VIEW osm_waterway_z1; diff --git a/basemap/update.js b/basemap/update.js new file mode 100644 index 00000000..e69de29b
