[Tile-serving] [openstreetmap/osm2pgsql] Don't use ST_GeoHash for ordering on Postgis >= 2.4 (#1050)

Jochen Topf notifications at github.com
Sun Jan 5 14:03:35 UTC 2020


joto commented on this pull request.



> +
+        std::string sql =
+            "CREATE TABLE {0}_tmp {1} AS SELECT * FROM {0}"_format(
+                m_target->name, m_table_space);
+
+        if (srid != "4326") {
+            // libosmium assures validity of geometries in 4326.
+            // Transformation to another projection could make the geometry
+            // invalid. Therefore add a filter to drop those.
+            sql += " WHERE ST_IsValid(way)";
+        }
+
+        auto res = m_sql_conn->query(
+            PGRES_TUPLES_OK,
+            "SELECT regexp_split_to_table(postgis_lib_version(), '\\.')");
+        auto postgis_major = std::stoi(res.get_value_as_string(0, 0));

2x const

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1050#pullrequestreview-338402374
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20200105/13c39c0a/attachment.htm>


More information about the Tile-serving mailing list