Skip to content

Commit

Permalink
Fix changset counting
Browse files Browse the repository at this point in the history
  • Loading branch information
NKAmapper authored May 15, 2023
1 parent 39f9418 commit cd3a792
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions addr2osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from xml.etree import ElementTree as ET


version = "2.0.0"
version = "2.0.1"

debug = False

Expand Down Expand Up @@ -433,6 +433,7 @@ def process_municipality (municipality_id):
deleted = 0
validated = 0
corrected = 0
uploaded = 0

found = [] # Index list which Will contain True for matched adresses from Kartverket

Expand Down Expand Up @@ -689,9 +690,7 @@ def init_root():
global osm_root # XML of all addresses in municipality
global upload_root # XML to be uploaded to OSM
global save_root # XML of all deleted addresses during run
global uploaded # Number of elements to be uploaded

uploaded = 0
osm_root = ET.Element("osm", version="0.6", generator="addr2osm v%s" % version, upload="false")
upload_root = ET.Element("osmChange", version="0.6", generator="nsr2osm")
if "save_root" not in globals():
Expand Down Expand Up @@ -747,7 +746,7 @@ def upload_changeset(entity_id, entity_name, changeset_count):
return True

else:
message ("\n\nCHANGESET TOO LARGE (%i) - UPLOAD MANUALLY WITH JOSM\n\n" % uploaded)
message ("\n\nCHANGESET TOO LARGE (%i) - UPLOAD MANUALLY WITH JOSM\n\n" % changeset_count)
not_uploaded.append("%s %s" % (entity_id, entity_name))

if not upload and changeset_count > 0 or upload and changeset_count >= 9900 or debug:
Expand Down

0 comments on commit cd3a792

Please sign in to comment.