[osm2pgsql] 01/06: Imported Upstream version 0.90.1+ds

Bas Couwenberg sebastic at debian.org
Sun Jul 17 12:28:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository osm2pgsql.

commit beab47b81d8ad3c4d629bbce06817c4a49579a6d
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun Jul 17 13:30:43 2016 +0200

    Imported Upstream version 0.90.1+ds
---
 CMakeLists.txt     |  2 +-
 TODO               | 18 ------------------
 default.style      |  1 -
 pgsql.cpp          |  2 +-
 processor-line.cpp |  7 ++++++-
 processor-line.hpp |  1 +
 reprojection.cpp   |  8 +++++---
 style.lua          |  2 +-
 table.cpp          |  2 +-
 9 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3aa5ec2..8107a26 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
 set(PACKAGE osm2pgsql)
 set(PACKAGE_NAME osm2pgsql)
-set(PACKAGE_VERSION 0.90.0)
+set(PACKAGE_VERSION 0.90.1-dev)
 
 cmake_minimum_required(VERSION 2.8.7)
 
diff --git a/TODO b/TODO
deleted file mode 100644
index 25c3ba4..0000000
--- a/TODO
+++ /dev/null
@@ -1,18 +0,0 @@
-== osm2pgsql ==
-
-* there is still room for code cleanups
-
-** the postgres specific files also contain some general functions
-  that could/should be moved out to separate files so that they
-  may be shared by other middle and output backends in the future
-
-* in the long run it may make sense to go for C++ all the way
-
-** the C++ interface to Google ProtoBuffers is much more mature than
-   its C counterpart
-
-** inheriting input, middle, and output plugin implementations from
-   abstract C++ base clases would provide a cleaner and more readable
-   interface than the current C99 struct based implementation IMHO
-
-
diff --git a/default.style b/default.style
index 217b4a2..5dd74bb 100644
--- a/default.style
+++ b/default.style
@@ -126,7 +126,6 @@ node,way   office       text         polygon
 node,way   oneway       text         linear
 node,way   operator     text         linear
 node,way   place        text         polygon
-node       poi          text         linear
 node,way   population   text         linear
 node,way   power        text         polygon
 node,way   power_source text         linear
diff --git a/pgsql.cpp b/pgsql.cpp
index 3136adb..531fa42 100644
--- a/pgsql.cpp
+++ b/pgsql.cpp
@@ -127,7 +127,7 @@ PGresult *pgsql_execPrepared( PGconn *sql_conn, const char *stmtName, const int
              message += "Arguments were: ";
             for(int i = 0; i < nParams; i++)
             {
-                message += paramValues[i];
+                message += paramValues[i]?paramValues[i]:"<NULL>";
                 message += ", ";
             }
         }
diff --git a/processor-line.cpp b/processor-line.cpp
index d979c42..bc1b23a 100644
--- a/processor-line.cpp
+++ b/processor-line.cpp
@@ -1,6 +1,6 @@
 #include "processor-line.hpp"
 
-processor_line::processor_line(int srid) : geometry_processor(srid, "LINESTRING", interest_way)
+processor_line::processor_line(int srid) : geometry_processor(srid, "LINESTRING", interest_way | interest_relation )
 {
 }
 
@@ -12,3 +12,8 @@ geometry_builder::pg_geom_t processor_line::process_way(const nodelist_t &nodes)
 {
     return builder.get_wkb_simple(nodes, false);
 }
+
+geometry_builder::pg_geoms_t processor_line::process_relation(const multinodelist_t &nodes)
+{
+    return builder.build_both(nodes, false, false, 1000000);
+}
diff --git a/processor-line.hpp b/processor-line.hpp
index 782fee5..1a011b6 100644
--- a/processor-line.hpp
+++ b/processor-line.hpp
@@ -8,6 +8,7 @@ struct processor_line : public geometry_processor {
     virtual ~processor_line();
 
     geometry_builder::pg_geom_t process_way(const nodelist_t &nodes);
+    geometry_builder::pg_geoms_t process_relation(const multinodelist_t &nodes);
 
 private:
     geometry_builder builder;
diff --git a/reprojection.cpp b/reprojection.cpp
index 3dd7f48..2919803 100644
--- a/reprojection.cpp
+++ b/reprojection.cpp
@@ -75,7 +75,8 @@ class generic_reprojection_t : public reprojection
 {
 public:
     generic_reprojection_t(int srs)
-    : pj_target(srs), pj_source(PROJ_LATLONG), pj_tile("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs")
+    : m_target_srs(srs), pj_target(srs), pj_source(PROJ_LATLONG),
+      pj_tile("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs")
     {}
 
     osmium::geom::Coordinates reproject(osmium::Location loc) const override
@@ -94,10 +95,11 @@ public:
         *lat = c.y;
     }
 
-    int target_srs() const override { return PROJ_SPHERE_MERC; }
-    const char *target_desc() const override { return "Spherical Mercator"; }
+    int target_srs() const override { return m_target_srs; }
+    const char *target_desc() const override { return pj_get_def(pj_target.get(), 0); }
 
 private:
+    int m_target_srs;
     osmium::geom::CRS pj_target;
     /** The projection of the source data. Always lat/lon (EPSG:4326). */
     osmium::geom::CRS pj_source;
diff --git a/style.lua b/style.lua
index cf35391..3c85a95 100644
--- a/style.lua
+++ b/style.lua
@@ -10,7 +10,7 @@ polygon_keys = { 'building', 'landuse', 'amenity', 'harbour', 'historic', 'leisu
 generic_keys = {'access','addr:housename','addr:housenumber','addr:interpolation','admin_level','aerialway','aeroway','amenity','area','barrier',
    'bicycle','brand','bridge','boundary','building','capital','construction','covered','culvert','cutting','denomination','disused','ele',
    'embarkment','foot','generation:source','harbour','highway','historic','hours','intermittent','junction','landuse','layer','leisure','lock',
-   'man_made','military','motor_car','name','natural','office','oneway','operator','place','poi','population','power','power_source','public_transport',
+   'man_made','military','motor_car','name','natural','office','oneway','operator','place','population','power','power_source','public_transport',
    'railway','ref','religion','route','service','shop','sport','surface','toll','tourism','tower:type', 'tracktype','tunnel','water','waterway',
    'wetland','width','wood','type'}
 
diff --git a/table.cpp b/table.cpp
index 1c21cb9..74bf4bf 100644
--- a/table.cpp
+++ b/table.cpp
@@ -221,7 +221,7 @@ void table_t::stop()
 
         // Special handling for empty geometries because geohash chokes on
         // empty geometries on postgis 1.5.
-        pgsql_exec_simple(sql_conn, PGRES_COMMAND_OK, (fmt("CREATE TABLE %1%_tmp %2% AS SELECT * FROM %1% ORDER BY CASE WHEN ST_IsEmpty(way) THEN NULL ELSE ST_GeoHash(ST_Transform(ST_Envelope(way),4326),10) END") % name % (table_space ? "TABLESPACE " + table_space.get() : "")).str());
+        pgsql_exec_simple(sql_conn, PGRES_COMMAND_OK, (fmt("CREATE TABLE %1%_tmp %2% AS SELECT * FROM %1% ORDER BY CASE WHEN ST_IsEmpty(way) THEN NULL ELSE ST_GeoHash(ST_Transform(ST_Envelope(way),4326),10) END COLLATE \"C\"") % name % (table_space ? "TABLESPACE " + table_space.get() : "")).str());
         pgsql_exec_simple(sql_conn, PGRES_COMMAND_OK, (fmt("DROP TABLE %1%") % name).str());
         pgsql_exec_simple(sql_conn, PGRES_COMMAND_OK, (fmt("ALTER TABLE %1%_tmp RENAME TO %1%") % name).str());
         // Re-add constraints if on 1.x. 2.0 has typemod, and they automatically come with CREATE TABLE AS

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osm2pgsql.git



More information about the Pkg-grass-devel mailing list