source: subversion/applications/utils/import/bulkupload/osm2change-reorder.patch @ 34714

Last change on this file since 34714 was 19408, checked in by avar, 10 years ago

Add bulk upload scripts from http://openstreetmap.pl/balrog/bulkupload/ by balrog-k1n, he doesn't have svn access so I'm commiting this for him

File size: 1.4 KB
  • .py

    old new try: 
    7373
    7474    operation = {}
    7575    for opname in [ "create", "modify", "delete" ]:
    76         operation[opname] = ElementTree.SubElement(output_root,
     76        operation[opname] = {}
     77    for opname, elname in [
     78            ("create", "node"),
     79            ("modify", "node"),
     80            ("create", "way"),
     81            ("modify", "way"),
     82            ("create", "relation"),
     83            ("modify", "relation"),
     84            ("delete", "relation"),
     85            ("delete", "way"),
     86            ("delete", "node") ]:
     87        operation[opname][elname] = ElementTree.SubElement(output_root,
    7788                opname, output_attr)
    7889
    7990    for element in root:
    try: 
    8394            opname = element.attrib.pop("action")
    8495        else:
    8596            continue
    86         operation[opname].append(element)
     97        operation[opname][element.tag].append(element)
    8798
    8899    # Does this account for all cases?  Also, is it needed?
    89100    # (cases like relations containing relations... is that allowed?)
    90     osmsort(operation["create"], [ "node", "way", "relation" ])
    91     osmsort(operation["delete"], [ "relation", "way", "node" ])
     101    #osmsort(operation["create"], [ "node", "way", "relation" ])
     102    #osmsort(operation["delete"], [ "relation", "way", "node" ])
    92103
    93104    output_tree.write(filename_base + ".osc", "utf-8")
    94105except Exception,err:
Note: See TracBrowser for help on using the repository browser.