Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

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

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment

Comments

@openstreetmap-trac
Copy link

Reporter: komzpa[at]gmail.com
[Submitted to the original trac issue database at 1.00pm, Saturday, 17th September 2011]

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)
@openstreetmap-trac
Copy link
Author

Author: amm
[Added to the original trac issue at 7.03pm, Sunday, 25th September 2011]

Committed (excluding the debian changes), thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant