This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch basemaps-schema
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git

commit 3a49c5a2db5f7f5ef9d4c38b96ce97bb4c7fbcd9
Author: Bertil Chapuis <[email protected]>
AuthorDate: Wed Jan 1 09:57:53 2025 +0100

    Improve the refresh scripts
---
 .run/basemap-serve.run.xml                         |  2 +-
 .../apache/baremaps/cli/database/ImportOsm.java    | 55 +++++++++++-----------
 .../org/apache/baremaps/tasks/ImportOsmPbf.java    |  3 +-
 .../apache/baremaps/workflow/ObjectMapperTest.java |  2 +-
 .../org/apache/baremaps/workflow/WorkflowTest.java |  2 +-
 .../postgres/openstreetmap/HeaderRepository.java   |  2 +-
 .../postgres/openstreetmap/NodeRepository.java     |  2 +-
 .../postgres/openstreetmap/RelationRepository.java |  2 +-
 .../postgres/openstreetmap/WayRepository.java      |  2 +-
 basemap/import.js                                  | 35 +++-----------
 basemap/layers/aerialway/tileset.js                |  2 +-
 basemap/layers/header/create.sql                   |  4 +-
 basemap/layers/{polygon => node}/refresh.sql       | 10 ++--
 basemap/layers/point/create.sql                    | 40 ++++++++--------
 basemap/layers/point/refresh.sql                   | 14 ++++++
 basemap/layers/polygon/refresh.sql                 |  2 +
 basemap/layers/{polygon => relation}/refresh.sql   | 10 ++--
 basemap/layers/{polygon => way}/refresh.sql        | 10 ++--
 basemap/refresh.js                                 |  3 ++
 basemap/tileset.js                                 |  2 +-
 20 files changed, 102 insertions(+), 102 deletions(-)

diff --git a/.run/basemap-serve.run.xml b/.run/basemap-serve.run.xml
index a0e90fa38..d0a486ac1 100644
--- a/.run/basemap-serve.run.xml
+++ b/.run/basemap-serve.run.xml
@@ -2,7 +2,7 @@
   <configuration default="false" name="basemap-serve" type="Application" 
factoryName="Application">
     <option name="MAIN_CLASS_NAME" value="org.apache.baremaps.cli.Baremaps" />
     <module name="baremaps-cli" />
-    <option name="PROGRAM_PARAMETERS" value="map serve --tileset tileset.js 
--style style.js" />
+    <option name="PROGRAM_PARAMETERS" value="map serve --tileset tileset.js 
--style style.js --log-level DEBUG" />
     <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/basemap" />
     <method v="2">
       <option name="Make" enabled="true" />
diff --git 
a/baremaps-cli/src/main/java/org/apache/baremaps/cli/database/ImportOsm.java 
b/baremaps-cli/src/main/java/org/apache/baremaps/cli/database/ImportOsm.java
index e0a7ccc1d..60d8eb0eb 100644
--- a/baremaps-cli/src/main/java/org/apache/baremaps/cli/database/ImportOsm.java
+++ b/baremaps-cli/src/main/java/org/apache/baremaps/cli/database/ImportOsm.java
@@ -18,9 +18,9 @@
 package org.apache.baremaps.cli.database;
 
 
-
 import java.nio.file.Path;
 import java.util.concurrent.Callable;
+
 import org.apache.baremaps.cli.Options;
 import org.apache.baremaps.tasks.ImportOsmPbf;
 import org.apache.baremaps.workflow.WorkflowContext;
@@ -29,33 +29,34 @@ import picocli.CommandLine.Mixin;
 import picocli.CommandLine.Option;
 
 @Command(
-    name = "import-osm",
-    description = "Import OpenStreetMap data in Postgres.")
+        name = "import-osm",
+        description = "Import OpenStreetMap data in Postgres.")
 @SuppressWarnings("squid:S106")
 public class ImportOsm implements Callable<Integer> {
 
-  @Mixin
-  private Options options;
-
-  @Option(names = {"--file"}, paramLabel = "FILE",
-      description = "The PBF file to import in the database.", required = true)
-  private Path file;
-
-  @Option(names = {"--database"}, paramLabel = "DATABASE",
-      description = "The JDBC url of Postgres.", required = true)
-  private String database;
-
-  @Option(names = {"--srid"}, paramLabel = "SRID",
-      description = "The projection used by the database.")
-  private int srid = 3857;
-
-  @Override
-  public Integer call() throws Exception {
-    new ImportOsmPbf(
-        file.toAbsolutePath(),
-        database,
-        srid,
-        true).execute(new WorkflowContext());
-    return 0;
-  }
+    @Mixin
+    private Options options;
+
+    @Option(names = {"--file"}, paramLabel = "FILE",
+            description = "The PBF file to import in the database.", required 
= true)
+    private Path file;
+
+    @Option(names = {"--database"}, paramLabel = "DATABASE",
+            description = "The JDBC url of Postgres.", required = true)
+    private String database;
+
+    @Option(names = {"--srid"}, paramLabel = "SRID",
+            description = "The projection used by the database.")
+    private int srid = 3857;
+
+    @Override
+    public Integer call() throws Exception {
+        new ImportOsmPbf(
+                file.toAbsolutePath(),
+                database,
+                srid,
+                true,
+                true).execute(new WorkflowContext());
+        return 0;
+    }
 }
diff --git 
a/baremaps-core/src/main/java/org/apache/baremaps/tasks/ImportOsmPbf.java 
b/baremaps-core/src/main/java/org/apache/baremaps/tasks/ImportOsmPbf.java
index 5bda12d6c..1545916d1 100644
--- a/baremaps-core/src/main/java/org/apache/baremaps/tasks/ImportOsmPbf.java
+++ b/baremaps-core/src/main/java/org/apache/baremaps/tasks/ImportOsmPbf.java
@@ -62,11 +62,12 @@ public class ImportOsmPbf implements Task {
    * @param replaceExisting whether to replace the existing tables
    */
   public ImportOsmPbf(Path file, Object database,
-      Integer databaseSrid, Boolean replaceExisting) {
+      Integer databaseSrid, Boolean replaceExisting, Boolean truncateTables) {
     this.file = file;
     this.database = database;
     this.databaseSrid = databaseSrid;
     this.replaceExisting = replaceExisting;
+    this.truncateTables = truncateTables;
   }
 
   /**
diff --git 
a/baremaps-core/src/test/java/org/apache/baremaps/workflow/ObjectMapperTest.java
 
b/baremaps-core/src/test/java/org/apache/baremaps/workflow/ObjectMapperTest.java
index 0ce907c07..672210a24 100644
--- 
a/baremaps-core/src/test/java/org/apache/baremaps/workflow/ObjectMapperTest.java
+++ 
b/baremaps-core/src/test/java/org/apache/baremaps/workflow/ObjectMapperTest.java
@@ -43,7 +43,7 @@ public class ObjectMapperTest {
             new Step("import", List.of("download"),
                 List.of(new 
ImportOsmPbf(Paths.get("liechtenstein-latest.osm.pbf"),
                     
"jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-                    3857, true)))));
+                    3857, true, true)))));
     var json = mapper.writeValueAsString(workflow1);
     assertTrue(json.contains(DownloadUrl.class.getSimpleName()));
     assertTrue(json.contains(ImportOsmPbf.class.getSimpleName()));
diff --git 
a/baremaps-core/src/test/java/org/apache/baremaps/workflow/WorkflowTest.java 
b/baremaps-core/src/test/java/org/apache/baremaps/workflow/WorkflowTest.java
index 4bcd44d39..849b36a0d 100644
--- a/baremaps-core/src/test/java/org/apache/baremaps/workflow/WorkflowTest.java
+++ b/baremaps-core/src/test/java/org/apache/baremaps/workflow/WorkflowTest.java
@@ -103,7 +103,7 @@ class WorkflowTest extends PostgresContainerTest {
         new Step("import-osmpbf", List.of("fetch-osmpbf"),
             List.of(new 
ImportOsmPbf(Paths.get("downloads/liechtenstein.osm.pbf"),
                 jdbcUrl(),
-                3857, true))),
+                3857, true, true))),
         new Step("fetch-shapefile", List.of(), List.of(new DownloadUrl(
             
"https://osmdata.openstreetmap.de/download/simplified-water-polygons-split-3857.zip";,
             Paths.get("downloads/simplified-water-polygons-split-3857.zip"), 
false))),
diff --git 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/HeaderRepository.java
 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/HeaderRepository.java
index eada38ef7..6b569c428 100644
--- 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/HeaderRepository.java
+++ 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/HeaderRepository.java
@@ -67,7 +67,7 @@ public class HeaderRepository implements Repository<Long, 
Header> {
     this(
         dataSource,
         "public",
-        "osm_headers",
+        "osm_header",
         "replication_sequence_number",
         "replication_timestamp",
         "replication_url",
diff --git 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/NodeRepository.java
 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/NodeRepository.java
index 613ec8053..4525f3f33 100644
--- 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/NodeRepository.java
+++ 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/NodeRepository.java
@@ -74,7 +74,7 @@ public class NodeRepository implements Repository<Long, Node> 
{
     this(
         dataSource,
         "public",
-        "osm_nodes",
+        "osm_node",
         "id",
         "version",
         "uid",
diff --git 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/RelationRepository.java
 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/RelationRepository.java
index 362dc7a47..8b0c140f6 100644
--- 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/RelationRepository.java
+++ 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/RelationRepository.java
@@ -68,7 +68,7 @@ public class RelationRepository implements Repository<Long, 
Relation> {
     this(
         dataSource,
         "public",
-        "osm_relations",
+        "osm_relation",
         "id",
         "version",
         "uid",
diff --git 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/WayRepository.java
 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/WayRepository.java
index 754660d4d..d573dc9ca 100644
--- 
a/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/WayRepository.java
+++ 
b/baremaps-postgres/src/main/java/org/apache/baremaps/postgres/openstreetmap/WayRepository.java
@@ -76,7 +76,7 @@ public class WayRepository implements Repository<Long, Way> {
   public WayRepository(DataSource dataSource) {
     this(dataSource,
         "public",
-        "osm_ways",
+        "osm_way",
         "id",
         "version",
         "uid",
diff --git a/basemap/import.js b/basemap/import.js
index bcc186df4..827e669bb 100644
--- a/basemap/import.js
+++ b/basemap/import.js
@@ -18,22 +18,6 @@ import config from "./config.js";
 
 export default {
   "steps": [
-    {
-      "id": "initialize-database",
-        "needs": [],
-        "tasks": [
-          {
-            "type": "ExecuteSqlScript",
-            "file": "queries/assertions.sql",
-            "database": config.database,
-          },
-          {
-            "type": "ExecuteSqlScript",
-            "file": "queries/functions.sql",
-            "database": config.database,
-          },
-        ]
-    },
     // {
     //   "id": "openstreetmap-water-polygons",
     //   "needs": [],
@@ -110,23 +94,18 @@ export default {
       "id": "openstreetmap-data",
       "needs": [],
       "tasks": [
-        {
-          "type": "DownloadUrl",
-          "source": config.osmPbfUrl,
-          "target": "data/data.osm.pbf"
-        },
+        // {
+        //   "type": "DownloadUrl",
+        //   "source": config.osmPbfUrl,
+        //   "target": "data/data.osm.pbf"
+        // },
         {
           "type": "ImportOsmPbf",
           "file": "data/data.osm.pbf",
           "database": config.database,
           "databaseSrid": 3857,
-          "replaceExisting": true,
-        },
-        {
-          "type": "ExecuteSql",
-          "file": "queries/osm_entities.sql",
-          "database": config.database,
-          "parallel": false,
+          "replaceExisting": false,
+          "truncateExisting": true,
         },
       ]
     },
diff --git a/basemap/layers/aerialway/tileset.js 
b/basemap/layers/aerialway/tileset.js
index 78be4f965..9672034b4 100644
--- a/basemap/layers/aerialway/tileset.js
+++ b/basemap/layers/aerialway/tileset.js
@@ -21,7 +21,7 @@ export default {
             minzoom: 13,
             maxzoom: 20,
             sql:
-                "SELECT id, tags, geom FROM osm_aerialway WHERE tags ? 
'aerialway'",
+                "SELECT id, tags, geom FROM osm_way WHERE tags ? 'aerialway'",
         },
     ],
 }
diff --git a/basemap/layers/header/create.sql b/basemap/layers/header/create.sql
index aa7397af6..58405fedd 100644
--- a/basemap/layers/header/create.sql
+++ b/basemap/layers/header/create.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-DROP TABLE IF EXISTS osm_headers;
-CREATE TABLE IF NOT EXISTS osm_headers
+DROP TABLE IF EXISTS osm_header;
+CREATE TABLE IF NOT EXISTS osm_header
 (
     replication_sequence_number bigint PRIMARY KEY,
     replication_timestamp       timestamp without time zone,
diff --git a/basemap/layers/polygon/refresh.sql 
b/basemap/layers/node/refresh.sql
similarity index 75%
copy from basemap/layers/polygon/refresh.sql
copy to basemap/layers/node/refresh.sql
index 3adec2694..a71d4c29a 100644
--- a/basemap/layers/polygon/refresh.sql
+++ b/basemap/layers/node/refresh.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-DROP INDEX IF EXISTS osm_polygon_geom_idx;
-DROP INDEX IF EXISTS osm_polygon_tags_idx;
-REFRESH MATERIALIZED VIEW osm_polygon;
-CREATE INDEX osm_polygon_geom_idx ON osm_polygon USING GIST (geom);
-CREATE INDEX osm_polygon_tags_idx ON osm_polygon USING GIN (tags);
\ No newline at end of file
+DROP INDEX IF EXISTS osm_node_geom_index;
+DROP INDEX IF EXISTS osm_node_tags_index;
+
+CREATE INDEX IF NOT EXISTS osm_node_geom_index ON osm_node USING GIST (geom);
+CREATE INDEX IF NOT EXISTS osm_node_tags_index ON osm_node USING GIN (tags);
diff --git a/basemap/layers/point/create.sql b/basemap/layers/point/create.sql
index 617d17b60..f226cfdd3 100644
--- a/basemap/layers/point/create.sql
+++ b/basemap/layers/point/create.sql
@@ -5,36 +5,36 @@ WHERE tags != '{}';
 
 CREATE OR REPLACE VIEW osm_point_z20 AS
 SELECT *
-FROM point;
+FROM osm_point;
 
 CREATE OR REPLACE VIEW osm_point_z19 AS
 SELECT *
-FROM point;
+FROM osm_point;
 
 CREATE OR REPLACE VIEW osm_point_z18 AS
 SELECT *
-FROM point;
+FROM osm_point;
 
 CREATE OR REPLACE VIEW osm_point_z17 AS
 SELECT *
-FROM point;
+FROM osm_point;
 
 CREATE OR REPLACE VIEW osm_point_z16 AS
 SELECT *
-FROM point;
+FROM osm_point;
 
 CREATE OR REPLACE VIEW osm_point_z15 AS
 SELECT *
-FROM point;
+FROM osm_point;
 
 CREATE OR REPLACE VIEW osm_point_z14 AS
 SELECT *
-FROM point;
+FROM osm_point;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z13;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z13 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY 
(ARRAY['region','province','district','county','municipality','city','town','village','quarter','hamlet'])
    OR (tags->>'natural') = ANY (ARRAY['peak','volcano','spring'])
    OR (tags->>'highway') = 'motorway_junction'
@@ -46,7 +46,7 @@ WITH NO DATA;
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z12;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z12 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY 
(ARRAY['region','province','district','county','municipality','city','town','village'])
    OR (tags->>'natural') = ANY (ARRAY['peak','volcano'])
    OR (tags->>'highway') = 'motorway_junction'
@@ -57,7 +57,7 @@ WITH NO DATA;
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z11;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z11 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY 
(ARRAY['country','state','region','province','district','county','municipality','city','town','village'])
    OR (tags->>'natural') = ANY (ARRAY['peak','volcano'])
    OR (tags->>'highway') = 'motorway_junction'
@@ -66,7 +66,7 @@ WITH NO DATA;
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z10;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z10 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY 
(ARRAY['country','state','region','province','district','county','municipality','city','town'])
    OR (tags->>'natural') = ANY (ARRAY['peak','volcano'])
    OR (tags->>'highway') = 'motorway_junction'
@@ -75,62 +75,62 @@ WITH NO DATA;
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z9;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z9 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY 
(ARRAY['country','state','region','province','district','county','municipality','city','town'])
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z8;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z8 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY 
(ARRAY['country','state','region','province','district','county','municipality','city','town'])
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z7;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z7 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY (ARRAY['country','city','sea','state','county'])
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z6;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z6 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY (ARRAY['country','city','sea','state','county'])
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z5;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z5 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY (ARRAY['country','city','sea','state','county'])
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z4;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z4 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY (ARRAY['country','city','sea'])
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z3;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z3 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = ANY (ARRAY['country','city','sea'])
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z2;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z2 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = 'country'
 WITH NO DATA;
 
 DROP MATERIALIZED VIEW IF EXISTS osm_point_z1;
 CREATE MATERIALIZED VIEW IF NOT EXISTS osm_point_z1 AS
 SELECT id, tags, geom
-FROM point
+FROM osm_point
 WHERE (tags->>'place') = 'country'
 WITH NO DATA;
diff --git a/basemap/layers/point/refresh.sql b/basemap/layers/point/refresh.sql
index 5dee7af78..60fe7bbc5 100644
--- a/basemap/layers/point/refresh.sql
+++ b/basemap/layers/point/refresh.sql
@@ -13,6 +13,20 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
+DROP INDEX IF EXISTS osm_point_geom_z13_index;
+DROP INDEX IF EXISTS osm_point_geom_z12_index;
+DROP INDEX IF EXISTS osm_point_geom_z11_index;
+DROP INDEX IF EXISTS osm_point_geom_z10_index;
+DROP INDEX IF EXISTS osm_point_geom_z9_index;
+DROP INDEX IF EXISTS osm_point_geom_z8_index;
+DROP INDEX IF EXISTS osm_point_geom_z7_index;
+DROP INDEX IF EXISTS osm_point_geom_z6_index;
+DROP INDEX IF EXISTS osm_point_geom_z5_index;
+DROP INDEX IF EXISTS osm_point_geom_z4_index;
+DROP INDEX IF EXISTS osm_point_geom_z3_index;
+DROP INDEX IF EXISTS osm_point_geom_z2_index;
+DROP INDEX IF EXISTS osm_point_geom_z1_index;
+
 REFRESH MATERIALIZED VIEW osm_point_z13;
 REFRESH MATERIALIZED VIEW osm_point_z12;
 REFRESH MATERIALIZED VIEW osm_point_z11;
diff --git a/basemap/layers/polygon/refresh.sql 
b/basemap/layers/polygon/refresh.sql
index 3adec2694..bc31a967d 100644
--- a/basemap/layers/polygon/refresh.sql
+++ b/basemap/layers/polygon/refresh.sql
@@ -15,6 +15,8 @@
 
 DROP INDEX IF EXISTS osm_polygon_geom_idx;
 DROP INDEX IF EXISTS osm_polygon_tags_idx;
+
 REFRESH MATERIALIZED VIEW osm_polygon;
+
 CREATE INDEX osm_polygon_geom_idx ON osm_polygon USING GIST (geom);
 CREATE INDEX osm_polygon_tags_idx ON osm_polygon USING GIN (tags);
\ No newline at end of file
diff --git a/basemap/layers/polygon/refresh.sql 
b/basemap/layers/relation/refresh.sql
similarity index 75%
copy from basemap/layers/polygon/refresh.sql
copy to basemap/layers/relation/refresh.sql
index 3adec2694..d2d9fdc69 100644
--- a/basemap/layers/polygon/refresh.sql
+++ b/basemap/layers/relation/refresh.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-DROP INDEX IF EXISTS osm_polygon_geom_idx;
-DROP INDEX IF EXISTS osm_polygon_tags_idx;
-REFRESH MATERIALIZED VIEW osm_polygon;
-CREATE INDEX osm_polygon_geom_idx ON osm_polygon USING GIST (geom);
-CREATE INDEX osm_polygon_tags_idx ON osm_polygon USING GIN (tags);
\ No newline at end of file
+DROP INDEX IF EXISTS osm_relation_geom_index;
+DROP INDEX IF EXISTS osm_relation_tags_index;
+
+CREATE INDEX IF NOT EXISTS osm_relation_geom_index ON osm_relation USING GIST 
(geom);
+CREATE INDEX IF NOT EXISTS osm_relation_tags_index ON osm_relation USING GIN 
(tags);
diff --git a/basemap/layers/polygon/refresh.sql b/basemap/layers/way/refresh.sql
similarity index 75%
copy from basemap/layers/polygon/refresh.sql
copy to basemap/layers/way/refresh.sql
index 3adec2694..4c7ad3912 100644
--- a/basemap/layers/polygon/refresh.sql
+++ b/basemap/layers/way/refresh.sql
@@ -13,8 +13,8 @@
 -- See the License for the specific language governing permissions and
 -- limitations under the License.
 
-DROP INDEX IF EXISTS osm_polygon_geom_idx;
-DROP INDEX IF EXISTS osm_polygon_tags_idx;
-REFRESH MATERIALIZED VIEW osm_polygon;
-CREATE INDEX osm_polygon_geom_idx ON osm_polygon USING GIST (geom);
-CREATE INDEX osm_polygon_tags_idx ON osm_polygon USING GIN (tags);
\ No newline at end of file
+DROP INDEX IF EXISTS osm_way_geom_index;
+DROP INDEX IF EXISTS osm_way_tags_index;
+
+CREATE INDEX IF NOT EXISTS osm_way_geom_index ON osm_way USING GIST (geom);
+CREATE INDEX IF NOT EXISTS osm_way_tags_index ON osm_way USING GIN (tags);
diff --git a/basemap/refresh.js b/basemap/refresh.js
index bb1856a13..2aa5f0538 100644
--- a/basemap/refresh.js
+++ b/basemap/refresh.js
@@ -22,6 +22,9 @@ export default {
             "id": "refresh",
             "needs": [],
             "tasks": [
+                "layers/nodex/refresh.sql",
+                "layers/ways/refresh.sql",
+                "layers/relations/refresh.sql",
                 "layers/member/refresh.sql",
                 "layers/linestring/refresh.sql",
                 "layers/polygon/refresh.sql",
diff --git a/basemap/tileset.js b/basemap/tileset.js
index 31d5520c3..e31a87916 100644
--- a/basemap/tileset.js
+++ b/basemap/tileset.js
@@ -59,7 +59,7 @@ export default {
     leisure,
     man_made,
     natural,
-    ocean,
+    //ocean,
     point,
     power,
     railway,

Reply via email to