Opened 8 years ago

Closed 8 years ago

#4009 closed defect (fixed)

[PATCH] osm2pgsql: show import speed for primitive XML parser; debian packaging minor fix

Reported by: komzpa@… Owned by: jburgess777@…
Priority: minor Milestone:
Component: osm2pgsql Version:
Keywords: osm2pgsql Cc:

Description

kom@thinkcat:~/osm/osm2pgsql$ svn diff
Index: debian/control
===================================================================
--- debian/control      (revision 26668)
+++ debian/control      (working copy)
@@ -7,7 +7,7 @@
 
 Package: osm2pgsql
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libgeos-3.0.0 | libgeos-3.1.0, libxml2, libpq5
+Depends: ${shlibs:Depends}, ${misc:Depends}, libxml2, libpq5
 Conflicts:  openstreetmap-utils
 Description: Openstreetmap data to PostgreSQL converter
  osm2pgsql imports OpenStreetMap data into a PostGIS database.
Index: parse-primitive.c
===================================================================
--- parse-primitive.c   (revision 26668)
+++ parse-primitive.c   (working copy)
@@ -197,9 +197,14 @@
         if (osmdata->osm_id > osmdata->max_node)
             osmdata->max_node = osmdata->osm_id;
 
+        if (osmdata->count_node == 0) {
+            time(&osmdata->start_node);
+        }
+        
         osmdata->count_node++;
         if (osmdata->count_node%10000 == 0)
             printStatus(osmdata);
+
     } else if (!strcmp(name, "tag")) {
         xk = extractAttribute(token, tokens, "k");
         assert(xk);
@@ -223,7 +228,11 @@
 
         if (osmdata->osm_id > osmdata->max_way)
             osmdata->max_way = osmdata->osm_id;
-
+        
+        if (osmdata->count_way == 0) {
+            time(&osmdata->start_way);
+        }
+        
         osmdata->count_way++;
         if (osmdata->count_way%1000 == 0)
             printStatus(osmdata);
@@ -245,6 +254,10 @@
 
         if (osmdata->osm_id > osmdata->max_rel)
             osmdata->max_rel = osmdata->osm_id;
+        
+        if (osmdata->count_rel == 0) {
+            time(&osmdata->start_rel);
+        }
 
         osmdata->count_rel++;
         if (osmdata->count_rel%10 == 0)

Change History (2)

comment:1 Changed 8 years ago by Tom Hughes

Component: utilsosm2pgsql
Owner: changed from Tom Hughes to jburgess777@…

comment:2 Changed 8 years ago by amm

Resolution: fixed
Status: newclosed

Committed (excluding the debian changes), thank you.

Note: See TracTickets for help on using tickets.