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

sebastic pushed a commit to branch master
in repository osm2pgsql.

commit ec758314f72878b5203d9348c6515c7d80bbf470
Author: Bas Couwenberg <sebas...@xs4all.nl>
Date:   Sat Aug 15 11:03:32 2015 +0200

    Imported Upstream version 0.88.1
---
 configure.ac              |  2 +-
 docs/osm2pgsql.1          |  2 +-
 geometry-builder.cpp      |  2 +-
 id-tracker.cpp            |  2 ++
 id-tracker.hpp            |  1 +
 node-persistent-cache.cpp |  7 ++++---
 node-ram-cache.hpp        |  2 +-
 output-multi.cpp          | 36 ++++++++++++++++++++++++++----------
 output-pgsql.cpp          | 40 ++++++++++++++++++++++++++++------------
 table.cpp                 |  2 ++
 10 files changed, 67 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index f67739d..cdbedc8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(osm2pgsql, 0.88.0)
+AC_INIT(osm2pgsql, 0.88.1)
 
 dnl Required autoconf version
 AC_PREREQ(2.61)
diff --git a/docs/osm2pgsql.1 b/docs/osm2pgsql.1
index bde5149..e3aaec7 100644
--- a/docs/osm2pgsql.1
+++ b/docs/osm2pgsql.1
@@ -117,7 +117,7 @@ imported into database columns and which tags get dropped. 
Defaults to /usr/shar
 Only for slim mode: Use up to num many MB of RAM for caching nodes. Giving 
osm2pgsql sufficient cache
 to store all imported nodes typically greatly increases the speed of the 
import. Each cached node
 requires 8 bytes of cache, plus about 10% \- 30% overhead. For a current OSM 
full planet import with
-its ~ 1.9 billion nodes, a good value would be 17000 if you have enough RAM. 
If you don't have enough
+its ~ 3 billion nodes, a good value would be 27000 if you have enough RAM. If 
you don't have enough
 RAM, it is likely beneficial to give osm2pgsql close to the full available 
amount of RAM. Defaults to 800. 
 .TP
 \fB\  \fR\-\-cache\-strategy strategy
diff --git a/geometry-builder.cpp b/geometry-builder.cpp
index 5c4a6b5..a0233e6 100644
--- a/geometry-builder.cpp
+++ b/geometry-builder.cpp
@@ -185,7 +185,7 @@ geometry_builder::maybe_wkts_t 
geometry_builder::get_wkt_split(const nodelist_t
                 const Coordinate this_pt = coords->getAt(i);
                 const Coordinate prev_pt = coords->getAt(i-1);
                 const double delta = this_pt.distance(prev_pt);
-                assert(!isnan(delta));
+                assert(!std::isnan(delta));
                 // figure out if the addition of this point would take the 
total
                 // length of the line in `segment` over the `split_at` 
distance.
 
diff --git a/id-tracker.cpp b/id-tracker.cpp
index 748ae7e..e9ee29a 100644
--- a/id-tracker.cpp
+++ b/id-tracker.cpp
@@ -171,6 +171,8 @@ osmid_t id_tracker::pop_mark() {
 
 size_t id_tracker::size() { return impl->count; }
 
+osmid_t id_tracker::last_returned() const { return impl->old_id; }
+
 bool id_tracker::is_valid(osmid_t id) { return id != max(); }
 osmid_t id_tracker::max() { return std::numeric_limits<osmid_t>::max(); }
 osmid_t id_tracker::min() { return std::numeric_limits<osmid_t>::min(); }
diff --git a/id-tracker.hpp b/id-tracker.hpp
index 023bbb7..7135316 100644
--- a/id-tracker.hpp
+++ b/id-tracker.hpp
@@ -13,6 +13,7 @@ struct id_tracker : public boost::noncopyable {
     bool is_marked(osmid_t id);
     osmid_t pop_mark();
     size_t size();
+    osmid_t last_returned() const;
 
     static bool is_valid(osmid_t);
     static osmid_t max();
diff --git a/node-persistent-cache.cpp b/node-persistent-cache.cpp
index 3689ce7..59c0d97 100644
--- a/node-persistent-cache.cpp
+++ b/node-persistent-cache.cpp
@@ -376,10 +376,11 @@ int node_persistent_cache::set_append(osmid_t id, double 
lat, double lon)
     if (block_id < 0)
         block_id = load_block(block_offset);
 
-    if (isnan(lat) && isnan(lon))
+    if (std::isnan(lat) && std::isnan(lon)) {
         readNodeBlockCache[block_id].nodes[id & READ_NODE_BLOCK_MASK] = 
ramNode();
-    else
+    } else {
         readNodeBlockCache[block_id].nodes[id & READ_NODE_BLOCK_MASK] = 
ramNode(lon, lat);
+    }
     readNodeBlockCache[block_id].inc_used();
     readNodeBlockCache[block_id].set_dirty();
 
@@ -438,7 +439,7 @@ int node_persistent_cache::get_list(nodelist_t &out, const 
idlist_t nds)
 
     size_t wrtidx = 0;
     for (size_t i = 0; i < nds.size(); i++) {
-        if (isnan(out[i].lat) && isnan(out[i].lon)) {
+        if (std::isnan(out[i].lat) && std::isnan(out[i].lon)) {
             if (get(&(out[wrtidx]), nds[i]) == 0)
                 wrtidx++;
         } else {
diff --git a/node-ram-cache.hpp b/node-ram-cache.hpp
index c292c2a..94f255d 100644
--- a/node-ram-cache.hpp
+++ b/node-ram-cache.hpp
@@ -68,7 +68,7 @@ public:
     ramNode() : _lat(NAN), _lon(NAN) {}
     ramNode(double _lon, double _lat) : _lon(lon), _lat(lat) {}
 
-    bool is_valid() const ( return !isnan(_lon); }
+    bool is_valid() const ( return !std::isnan(_lon); }
     double lon() const { return _lon; }
     double lat() const { return _lat; }
 private:
diff --git a/output-multi.cpp b/output-multi.cpp
index 49f44a0..2e406a1 100644
--- a/output-multi.cpp
+++ b/output-multi.cpp
@@ -61,6 +61,15 @@ size_t output_multi_t::pending_count() const {
 }
 
 void output_multi_t::enqueue_ways(pending_queue_t &job_queue, osmid_t id, 
size_t output_id, size_t& added) {
+    osmid_t const prev = ways_pending_tracker->last_returned();
+    if (id_tracker::is_valid(prev) && prev >= id) {
+        if (prev > id) {
+            job_queue.push(pending_job_t(id, output_id));
+        }
+        // already done the job
+        return;
+    }
+
     //make sure we get the one passed in
     if(!ways_done_tracker->is_marked(id) && id_tracker::is_valid(id)) {
         job_queue.push(pending_job_t(id, output_id));
@@ -83,11 +92,10 @@ void output_multi_t::enqueue_ways(pending_queue_t 
&job_queue, osmid_t id, size_t
 
     //make sure to get this one as well and move to the next
     if(popped == id) {
-        popped = ways_pending_tracker->pop_mark();
-    }
-    if (!ways_done_tracker->is_marked(popped) && id_tracker::is_valid(popped)) 
{
-        job_queue.push(pending_job_t(popped, output_id));
-        added++;
+        if (!ways_done_tracker->is_marked(popped) && 
id_tracker::is_valid(popped)) {
+            job_queue.push(pending_job_t(popped, output_id));
+            added++;
+        }
     }
 }
 
@@ -106,6 +114,15 @@ int output_multi_t::pending_way(osmid_t id, int exists) {
 }
 
 void output_multi_t::enqueue_relations(pending_queue_t &job_queue, osmid_t id, 
size_t output_id, size_t& added) {
+    osmid_t const prev = rels_pending_tracker->last_returned();
+    if (id_tracker::is_valid(prev) && prev >= id) {
+        if (prev > id) {
+            job_queue.push(pending_job_t(id, output_id));
+        }
+        // already done the job
+        return;
+    }
+
     //make sure we get the one passed in
     if(id_tracker::is_valid(id)) {
         job_queue.push(pending_job_t(id, output_id));
@@ -126,11 +143,10 @@ void output_multi_t::enqueue_relations(pending_queue_t 
&job_queue, osmid_t id, s
 
     //make sure to get this one as well and move to the next
     if(popped == id) {
-        popped = rels_pending_tracker->pop_mark();
-    }
-    if(id_tracker::is_valid(popped)) {
-        job_queue.push(pending_job_t(popped, output_id));
-        added++;
+        if(id_tracker::is_valid(popped)) {
+            job_queue.push(pending_job_t(popped, output_id));
+            added++;
+        }
     }
 }
 
diff --git a/output-pgsql.cpp b/output-pgsql.cpp
index 8800d49..33cc553 100644
--- a/output-pgsql.cpp
+++ b/output-pgsql.cpp
@@ -276,6 +276,15 @@ extern "C" void *pthread_output_pgsql_stop_one(void *arg) {
 } // anonymous namespace
 
 void output_pgsql_t::enqueue_ways(pending_queue_t &job_queue, osmid_t id, 
size_t output_id, size_t& added) {
+    osmid_t const prev = ways_pending_tracker->last_returned();
+    if (id_tracker::is_valid(prev) && prev >= id) {
+        if (prev > id) {
+            job_queue.push(pending_job_t(id, output_id));
+        }
+        // already done the job
+        return;
+    }
+
     //make sure we get the one passed in
     if(!ways_done_tracker->is_marked(id) && id_tracker::is_valid(id)) {
         job_queue.push(pending_job_t(id, output_id));
@@ -297,12 +306,11 @@ void output_pgsql_t::enqueue_ways(pending_queue_t 
&job_queue, osmid_t id, size_t
     }
 
     //make sure to get this one as well and move to the next
-    if(popped == id) {
-        popped = ways_pending_tracker->pop_mark();
-    }
-    if (!ways_done_tracker->is_marked(popped) && id_tracker::is_valid(popped)) 
{
-        job_queue.push(pending_job_t(popped, output_id));
-        added++;
+    if(popped > id) {
+        if (!ways_done_tracker->is_marked(popped) && 
id_tracker::is_valid(popped)) {
+            job_queue.push(pending_job_t(popped, output_id));
+            added++;
+        }
     }
 }
 
@@ -322,6 +330,15 @@ int output_pgsql_t::pending_way(osmid_t id, int exists) {
 }
 
 void output_pgsql_t::enqueue_relations(pending_queue_t &job_queue, osmid_t id, 
size_t output_id, size_t& added) {
+    osmid_t const prev = rels_pending_tracker->last_returned();
+    if (id_tracker::is_valid(prev) && prev >= id) {
+        if (prev > id) {
+            job_queue.push(pending_job_t(id, output_id));
+        }
+        // already done the job
+        return;
+    }
+
     //make sure we get the one passed in
     if(id_tracker::is_valid(id)) {
         job_queue.push(pending_job_t(id, output_id));
@@ -341,12 +358,11 @@ void output_pgsql_t::enqueue_relations(pending_queue_t 
&job_queue, osmid_t id, s
     }
 
     //make sure to get this one as well and move to the next
-    if(popped == id) {
-        popped = rels_pending_tracker->pop_mark();
-    }
-    if(id_tracker::is_valid(popped)) {
-        job_queue.push(pending_job_t(popped, output_id));
-        added++;
+    if(popped > id) {
+        if(id_tracker::is_valid(popped)) {
+            job_queue.push(pending_job_t(popped, output_id));
+            added++;
+        }
     }
 }
 
diff --git a/table.cpp b/table.cpp
index 8c7a882..94fd383 100644
--- a/table.cpp
+++ b/table.cpp
@@ -229,6 +229,8 @@ void table_t::stop()
         pgsql_exec_simple(sql_conn, PGRES_COMMAND_OK, (fmt("CREATE TABLE 
%1%_tmp %2% AS SELECT * FROM %3% 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() : "") % name).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 %2%") % name % name).str());
+        // Re-add constraints if on 1.x. 2.0 has typemod, and they 
automatically come with CREATE TABLE AS
+        pgsql_exec_simple(sql_conn, PGRES_TUPLES_OK, (fmt("SELECT CASE WHEN 
PostGIS_Lib_Version() LIKE '1.%%' THEN 
Populate_Geometry_Columns('%1%'::regclass) ELSE 1 END;") % name).str());
         fprintf(stderr, "Copying %s to cluster by geometry finished\n", 
name.c_str());
         fprintf(stderr, "Creating geometry index on  %s\n", name.c_str());
 

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

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to