You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@baremaps.apache.org by bc...@apache.org on 2022/11/17 13:52:24 UTC

[incubator-baremaps] branch 498-simplify-landcover-layers updated (67325596 -> 0f9d7c18)

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

bchapuis pushed a change to branch 498-simplify-landcover-layers
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git


    from 67325596 Fix IDE run config
     new 98208119 Fix IDE run config
     new 3e9482d4 Disable parallel execution
     new 0f9d7c18 Merge branch '498-simplify-landcover-layers' of github.com:apache/incubator-baremaps into 498-simplify-landcover-layers

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 map/queries/osm_landuse_prepare.sql | 15 ++++++++-----
 map/queries/osm_natural_prepare.sql | 14 ++++++++----
 map/workflow.js                     | 43 ++++++++++---------------------------
 3 files changed, 31 insertions(+), 41 deletions(-)


[incubator-baremaps] 03/03: Merge branch '498-simplify-landcover-layers' of github.com:apache/incubator-baremaps into 498-simplify-landcover-layers

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch 498-simplify-landcover-layers
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git

commit 0f9d7c180a6aa7e59ec6a5512c78ddcb3d02e6ff
Merge: 3e9482d4 67325596
Author: Bertil Chapuis <bc...@gmail.com>
AuthorDate: Thu Nov 17 14:52:13 2022 +0100

    Merge branch '498-simplify-landcover-layers' of github.com:apache/incubator-baremaps into 498-simplify-landcover-layers

 .../main/java/org/apache/baremaps/workflow/WorkflowExecutor.java    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)


[incubator-baremaps] 01/03: Fix IDE run config

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch 498-simplify-landcover-layers
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git

commit 98208119d0781356765b0e75eef0d88529e69554
Author: Bertil Chapuis <bc...@gmail.com>
AuthorDate: Tue Nov 15 08:03:22 2022 +0100

    Fix IDE run config
---
 .run/workflow-execute.run.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.run/workflow-execute.run.xml b/.run/workflow-execute.run.xml
index 0d9d39e2..1f0821b2 100644
--- a/.run/workflow-execute.run.xml
+++ b/.run/workflow-execute.run.xml
@@ -1,8 +1,8 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="workflow-execute" type="Application" factoryName="Application">
     <option name="MAIN_CLASS_NAME" value="org.apache.baremaps.cli.Baremaps" />
-    <module name="baremaps-benchmark" />
-    <option name="PROGRAM_PARAMETERS" value="workflow execute --file workflow.json" />
+    <module name="baremaps-cli" />
+    <option name="PROGRAM_PARAMETERS" value="workflow execute --file workflow.js" />
     <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/map" />
     <extension name="coverage">
       <pattern>


[incubator-baremaps] 02/03: Disable parallel execution

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bchapuis pushed a commit to branch 498-simplify-landcover-layers
in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git

commit 3e9482d428ecba862f77fe82e40a09a8545ad707
Author: Bertil Chapuis <bc...@gmail.com>
AuthorDate: Thu Nov 17 14:51:54 2022 +0100

    Disable parallel execution
---
 map/queries/osm_landuse_prepare.sql | 15 ++++++++-----
 map/queries/osm_natural_prepare.sql | 14 ++++++++----
 map/workflow.js                     | 43 ++++++++++---------------------------
 3 files changed, 31 insertions(+), 41 deletions(-)

diff --git a/map/queries/osm_landuse_prepare.sql b/map/queries/osm_landuse_prepare.sql
index 1d90c123..bb72c6de 100644
--- a/map/queries/osm_landuse_prepare.sql
+++ b/map/queries/osm_landuse_prepare.sql
@@ -1,17 +1,22 @@
 DROP VIEW IF EXISTS osm_landuse CASCADE;
 
-CREATE VIEW osm_landuse AS
-SELECT id, tags, geom
+CREATE MATERIALIZED VIEW osm_landuse AS
+SELECT
+    id as id,
+    jsonb_build_object('landuse', tags -> 'landuse') as tags,
+    st_buildarea(st_exteriorring(geom)) as geom
 FROM osm_polygon
-WHERE geom IS NOT NULL AND tags ?| ARRAY ['landuse'];
+WHERE geom IS NOT NULL
+  AND tags ->> 'landuse' IN ('residential', 'farmland', 'forest', 'meadow', 'orchard', 'vineyard', 'salt_pond', 'water');
+
+CREATE INDEX osm_landuse_geom_idx ON osm_landuse USING GIST (geom);
 
 CREATE MATERIALIZED VIEW osm_landuse_grouped AS
 SELECT
     min(id) as id,
     jsonb_build_object('landuse', tags -> 'landuse') as tags,
-    (st_dump(st_union(st_buildarea(st_exteriorring(geom))))).geom AS geom
+    (st_dump(st_buffer(st_collect(geom), 0))).geom AS geom
 FROM osm_landuse
-WHERE tags ->> 'landuse' IN ('residential', 'farmland', 'forest', 'meadow', 'orchard', 'vineyard', 'salt_pond', 'water')
 GROUP BY tags -> 'landuse';
 
 CREATE INDEX osm_landuse_grouped_geom_idx ON osm_landuse_grouped USING GIST (geom);
diff --git a/map/queries/osm_natural_prepare.sql b/map/queries/osm_natural_prepare.sql
index b32a812a..d4d45378 100644
--- a/map/queries/osm_natural_prepare.sql
+++ b/map/queries/osm_natural_prepare.sql
@@ -1,15 +1,21 @@
 DROP VIEW IF EXISTS osm_natural CASCADE;
 
-CREATE VIEW osm_natural AS
-SELECT id, tags, geom
+CREATE MATERIALIZED VIEW osm_natural AS
+SELECT
+    id as id,
+    jsonb_build_object('natural', tags -> 'natural') as tags,
+    st_buildarea(st_exteriorring(geom)) as geom
 FROM osm_polygon
-WHERE geom IS NOT NULL AND tags ?| ARRAY ['natural'];
+WHERE geom IS NOT NULL
+  AND tags ->> 'natural' IN ('grassland', 'heath', 'scrub', 'wood', 'bay', 'beach', 'glacier', 'mud', 'shingle', 'shoal', 'strait', 'water', 'wetland', 'bare_rock', 'sand', 'scree');
+
+CREATE INDEX osm_natural_geom_idx ON osm_natural USING GIST (geom);
 
 CREATE MATERIALIZED VIEW osm_natural_grouped AS
 SELECT
     min(id) as id,
     jsonb_build_object('natural', tags -> 'natural') as tags,
-    (st_dump(st_union(st_buildarea(st_exteriorring(geom))))).geom AS geom
+    (st_dump(st_buffer(st_collect(geom), 0))).geom AS geom
 FROM osm_natural
 GROUP BY tags -> 'natural';
 
diff --git a/map/workflow.js b/map/workflow.js
index 33830533..1184189e 100644
--- a/map/workflow.js
+++ b/map/workflow.js
@@ -89,17 +89,17 @@ export default {
       "id": "openstreetmap-data",
       "needs": [],
       "tasks": [
-        // {
-        //   "type": "DownloadUrl",
-        //   "url": "https://download.geofabrik.de/europe/switzerland-latest.osm.pbf",
-        //   "path": "data/data.osm.pbf"
-        // },
-        // {
-        //   "type": "ImportOpenStreetMap",
-        //   "file": "data/data.osm.pbf",
-        //   "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-        //   "databaseSrid": 3857
-        // },
+        {
+          "type": "DownloadUrl",
+          "url": "https://download.geofabrik.de/europe/switzerland-latest.osm.pbf",
+          "path": "data/data.osm.pbf"
+        },
+        {
+          "type": "ImportOpenStreetMap",
+          "file": "data/data.osm.pbf",
+          "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
+          "databaseSrid": 3857
+        },
       ]
     },
     {
@@ -110,25 +110,21 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_nodes_clean.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_nodes_prepare.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_nodes_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_nodes_index.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -140,25 +136,21 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_ways_clean.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_ways_prepare.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_ways_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_ways_index.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -170,25 +162,21 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_relations_clean.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_relations_prepare.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_relations_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_relations_index.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -216,7 +204,6 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_polygon_index.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -233,13 +220,11 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_boundary_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_boundary_index.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -256,13 +241,11 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_highway_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_highway_index.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -279,13 +262,11 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_railway_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
         {
           "type": "ExecuteSql",
           "file": "queries/osm_railway_index.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -302,7 +283,6 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_natural_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     },
@@ -319,7 +299,6 @@ export default {
           "type": "ExecuteSql",
           "file": "queries/osm_landuse_simplify.sql",
           "database": "jdbc:postgresql://localhost:5432/baremaps?&user=baremaps&password=baremaps",
-          "parallel": true,
         },
       ]
     }