Skip to content

Commit

Permalink
Move layers in separate directories
Browse files Browse the repository at this point in the history
  • Loading branch information
bchapuis committed Oct 27, 2023
1 parent ad7c3d2 commit d5f4b87
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 99 deletions.
23 changes: 0 additions & 23 deletions basemap/layers/water/clean.sql

This file was deleted.

22 changes: 0 additions & 22 deletions basemap/layers/water/index.sql

This file was deleted.

8 changes: 4 additions & 4 deletions basemap/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
]
},
{
"id": "water-polygons",
"id": "openstreetmap-water-polygons",
"needs": [],
"tasks": [
{
Expand All @@ -71,7 +71,7 @@ export default {
]
},
{
"id": "simplified-water-polygons",
"id": "openstreetmap-simplified-water-polygons",
"needs": [],
"tasks": [
{
Expand All @@ -96,8 +96,8 @@ export default {
{
"id": "openstreetmap-ocean",
"needs": [
"water-polygons",
"simplified-water-polygons",
"openstreetmap-water-polygons",
"openstreetmap-simplified-water-polygons",
],
"tasks": [
{
Expand Down
22 changes: 22 additions & 0 deletions daylight/layers/coastline/clean.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- Licensed 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 MATERIALIZED VIEW IF EXISTS osm_coastline CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z12 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z11 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z10 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z9 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z8 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z7 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z6 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z5 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z4 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z3 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z2 CASCADE;
DROP MATERIALIZED VIEW IF EXISTS osm_coastline_z1 CASCADE;
22 changes: 22 additions & 0 deletions daylight/layers/coastline/index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- Licensed 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 osm_coastline_index ON osm_coastline USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z12_index ON osm_coastline_z12 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z11_index ON osm_coastline_z11 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z10_index ON osm_coastline_z10 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z9_index ON osm_coastline_z9 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z8_index ON osm_coastline_z8 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z7_index ON osm_coastline_z7 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z6_index ON osm_coastline_z6 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z5_index ON osm_coastline_z5 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z4_index ON osm_coastline_z4 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z3_index ON osm_coastline_z3 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z2_index ON osm_coastline_z2 USING SPGIST (geom);
CREATE INDEX IF NOT EXISTS osm_coastline_z1_index ON osm_coastline_z1 USING SPGIST (geom);
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
-- 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 MATERIALIZED VIEW osm_water AS
CREATE MATERIALIZED VIEW osm_coastline AS
SELECT row_number() OVER () as id, '{"ocean":"water"}'::jsonb as tags, st_setsrid(geometry, 3857) AS geom FROM water_polygons_shp;
Original file line number Diff line number Diff line change
Expand Up @@ -7,74 +7,74 @@
-- 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 osm_water_z20 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z20 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE VIEW osm_water_z19 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z19 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE VIEW osm_water_z18 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z18 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE VIEW osm_water_z17 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z17 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE VIEW osm_water_z16 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z16 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE VIEW osm_water_z15 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z15 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE VIEW osm_water_z14 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z14 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE VIEW osm_water_z13 AS
SELECT id, tags, geom FROM osm_water;
CREATE VIEW osm_coastline_z13 AS
SELECT id, tags, geom FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z12 AS
CREATE MATERIALIZED VIEW osm_coastline_z12 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 12)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z11 AS
CREATE MATERIALIZED VIEW osm_coastline_z11 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 11)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z10 AS
CREATE MATERIALIZED VIEW osm_coastline_z10 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 10)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z9 AS
CREATE MATERIALIZED VIEW osm_coastline_z9 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 9)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z8 AS
CREATE MATERIALIZED VIEW osm_coastline_z8 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 8)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z7 AS
CREATE MATERIALIZED VIEW osm_coastline_z7 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 7)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z6 AS
CREATE MATERIALIZED VIEW osm_coastline_z6 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 6)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z5 AS
CREATE MATERIALIZED VIEW osm_coastline_z5 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 5)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z4 AS
CREATE MATERIALIZED VIEW osm_coastline_z4 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 4)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z3 AS
CREATE MATERIALIZED VIEW osm_coastline_z3 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 3)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z2 AS
CREATE MATERIALIZED VIEW osm_coastline_z2 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 2)) AS geom
FROM osm_water;
FROM osm_coastline;

CREATE MATERIALIZED VIEW osm_water_z1 AS
CREATE MATERIALIZED VIEW osm_coastline_z1 AS
SELECT id, tags, st_simplifypreservetopology(geom, 78270 / power(2, 1)) AS geom
FROM osm_water;
FROM osm_coastline;
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export default {
{
"minzoom": 0,
"maxzoom": 12,
"sql": "SELECT id, tags, geom FROM osm_water_z$zoom"
"sql": "SELECT id, tags, geom FROM osm_coastline_z$zoom"
},
{
"minzoom": 12,
"maxzoom": 20,
"sql": "SELECT id, tags, geom FROM osm_water"
"sql": "SELECT id, tags, geom FROM osm_coastline"
}
]
}
2 changes: 1 addition & 1 deletion daylight/tileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import man_made from "../basemap/layers/man_made/tileset.js";
import power from "../basemap/layers/power/tileset.js";
import point from "../basemap/layers/point/tileset.js";
import waterway from "../basemap/layers/waterway/tileset.js";
import water from "../basemap/layers/water/tileset.js";
import water from "./layers/coastline/tileset.js";


export default {
Expand Down
10 changes: 4 additions & 6 deletions daylight/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import config from "./config.js";

export default {
"steps": [
/*
{
"id": "daylight-data",
"needs": [],
Expand Down Expand Up @@ -109,28 +108,27 @@ export default {
},
{
"type": "ExecuteSql",
"file": "../basemap/layers/water/clean.sql",
"file": "./layers/coastline/clean.sql",
"database": config.database,
},
{
"type": "ExecuteSql",
"file": "../basemap/layers/water/prepare.sql",
"file": "./layers/coastline/prepare.sql",
"database": config.database,
},
{
"type": "ExecuteSql",
"file": "../basemap/layers/water/simplify.sql",
"file": "./layers/coastline/simplify.sql",
"database": config.database,
"parallel": true,
},
{
"type": "ExecuteSql",
"file": "../basemap/layers/water/index.sql",
"file": "./layers/coastline/index.sql",
"database": config.database,
},
]
},
*/
{
"id": "daylight-preferred-localization",
"needs": ["daylight-data"],
Expand Down

0 comments on commit d5f4b87

Please sign in to comment.