[Potlatch-dev] HOT Potlatch2 presets

Pierre (PierZen) infosbelas-gps at yahoo.fr
Tue Mar 15 03:42:43 GMT 2011


Serge asked me to post the script used for conversion from JOSM to PL2 presets. Below is this Python script and a modified copy of 'humanitarian_presets_josm.xml. There might be better ways. This is my first Python script.

Pierre

#-------------------------------------------------------------------------------------------------------------------------------------
print "========================================================================="
print "josm-to-potlach2-preset-conversion.py"
print "original script written by Pierre Beland, 2011-03"
print "========================================================================="
"""
 parse XML from josm preset file with lxml iterparse method
 this XML parser permits to treat big files with minimal memory usage
 START tag events : create new JOSM_element
 END tag events : append tag / write files
 JOSM_presets : JOSM presets file (input)
 OUTPUT to Potlach2 preset main file
 potlach2_preset : Potlach2 preset file (output)
 OUTPUT to Potlach2 group menu file
 potlach2_group : Potlach2 group file (output) : creates a file for each first level of group tag
=========================================================================
"""
"""
=========================================================================
 CUSTOM PRESET : Conversion from JOSM to Potlach2
 humanitarian preset , test file
=========================================================================
"""
import os
from lxml import etree
os.chdir('f:\osm\potlach2\\')
josm_file='humanitarian_presets_josm-r.xml'
infile = open(josm_file, 'r')
print "NOTE : this script expects the JOSM preset file to contain two levels of GROUP Tags.\nThe second level will be used to save Potlatch2 preset categories.\n<group>\n\t<group>\n"
print "MISSING TAGS AND NODES NOT TREATED IN THE CONVERSION ROUTINE WILL\nBE REPORTED BELOW WITH ERROR MESSAGE INDICATION\n"
print "=========================================================================\n"
print "JOSM INPUT : file=",josm_file, "\n"
"""
=========================================================================
 FUNCTIONS : TAG conversion from JOSM to Potlatch2
=========================================================================
"""
def fPrintCurrentElement():
    global JOSM_element
    txt_element=etree.tostring(JOSM_element)
    colend=txt_element.find(">")+1
    if colend<2: colend=120
    print txt_element[0:colend], "\n***************************************"
def fPresetsStart ():
    global potlach2_preset    
    # root tag
    potlach2_preset=etree.Element("mapFeatures")
    comment = etree.Comment('  Conversion from JOSM to Potlach2 made with josm-to-potlach2-preset-conversion.py\n\tPython script by Pierre Beland  ')
    potlach2_preset.append(comment)
def fPresetsEnd():
    global potlach2_preset, featureGroup
    # potlach2_preset file needs to list twice the groups
    # 1. list of category, 2. list of include files
    # the  list of groups permits to treat these lists after reading all JOSM file
    #??? potlach2_preset.append(featureGroup)
    #debug print "potlach2_preset"
    tree=etree.ElementTree(potlach2_preset)
    #debug print etree.tostring(tree, encoding="utf-8",method="xml", xml_declaration=True,pretty_print=True)
    potlach2_file="potlach2_preset_test.xml"
    tree.write(potlach2_file,xml_declaration=True,encoding='utf-8',method="xml",pretty_print=True )
    print "\nPOTLATCH2 OUTPUT : Main preset file\nFile=",potlach2_file
    print "========================================================================="
def fGroup1Start():
    # JOSM first group level menu is ignored. In Potlach2, there is only one level
    return
    
def fGroup1End():
    # JOSM first group level menu is ignored. In Potlach2, there is only one level
    return
    
def ffeatureGroupStart():
# --------- first level group menu - add to groups_list ----------
    # JOSM second level menu group correspond to Potlach2 featureGroup
    # each featureGroup are saved in a separate file; include instructions are added to main file
    #   <group name="Highways" icon="presets/way_secondary.png">
    global JOSM_element, JOSM_node, JOSM_element, featureGroup_category, featureGroup, featureGroup_icon, groups_list, group_no
    #debug print JOSM_node, "featureGroup"
    if (JOSM_element.get("name")):
        featureGroup_category=JOSM_element.get("name")
    else:
        featureGroup_category="NoName"
        print "\nJOSM ERROR : no name specified in <group> Tag --> NoName will be used"
        fPrintCurrentElement()
    #debug print JOSM_node, "featureGroup category=", featureGroup_category
    featureGroup=etree.Element("featureGroup")
    if (JOSM_element.get("icon")):
        featureGroup_icon=etree.Element("icon")
        featureGroup_icon_url=JOSM_element.get("icon")
        featureGroup_icon.set("image",featureGroup_icon_url)
        icon_font = etree.fromstring('<font size="14pt"><b>${name}</b></font>')
        # icon tag will be added to all feature sub-groups
    else:
        print "\nJOSM ERROR : ", featureGroup_category, " -> no icon specified in <group> Tag"
        fPrintCurrentElement()
    # adds group to groups_list (list used in cPresetsEnd() )
    groups_list.append(featureGroup_category)
    #debug print group_no, groups_list
    group_no=group_no+1
def ffeatureGroupEnd():
    global featureGroup, featureGroup_category, feature, featureGroup_icon, globals
    # if not </item> TAG before </group> TAG, we submit to save last item contents before group end
    if ('feature' in globals()):
        #debug print "POTLATCH2 <feature> TAG contains\n",etree.tostring(feature)        
        print "\nJOSM ERROR :  we save sub-items even if </item> TAG is missing before"
        fPrintCurrentElement()
        ffeatureEnd()
#    featureGroup.append(feature)
    category_fname=featureGroup_category+".xml"
    #debug print "category=", featureGroup_category, category_fname
    tree=etree.ElementTree(featureGroup)
    #debug print etree.tostring(tree, encoding="utf-8",method="xml", xml_declaration=True,pretty_print=True)
    tree.write(category_fname,xml_declaration=True,encoding='utf-8',method="xml",pretty_print=True )    
    print "\nPOTLATCH2 OUTPUT : Category preset file\nFile=", category_fname
    if ("featureGroup"  in globals()): del featureGroup
    if ("featureGroup_icon"  in globals()): del featureGroup_icon
  
def ffeatureGroupMissing():
    # If Group level 2 Tag is missing, adds featureGroup and prints Error message
    global JOSM_node, JOSM_element, featureGroup
    featureGroup=etree.Element("featureGroup")
    featureGroup_category="NoName"
    print "\n<group> TAG level 2 is missing before <sub-elements> : NoName used for category"
    fPrintCurrentElement()
def fSeparatorStart():
    # JOSM Separator add line between memu item. No correspondance in Potlatch2 and is ignored in the conversion.
    print "\nJOSM : <separator> TAG has no correspondance in Potlatch2. It will be ignored"
    fPrintCurrentElement()
    return
    
def fSeparatorEnd():
    # JOSM Separator add line between memu item. No correspondance in Potlatch2 and is ignored in the conversion.
    return
def ffeatureStart():
    # --------- second level group menu ----------
    """
     JOSM 
     second level menu group
          <item name="Road Restrictions" icon="presets/restrictions.png" type="node,way">
          <item name="Motorway Link" icon="presets/motorway.png" type="way">
     ->   <feature name="Motorway link">
           item type - Potlach2 docum specifies only line/point/area
          <item type="node" ->    <point/>
          <item type="way" ->    <line/>
          <item type="closedway" ->   <???area/>
          <item type="relation" ->    <???relation/> not documented but appears in Potlach2 defaultpresets
          <item type="node,way" ->    <point/><way/> 
     ->   <category>roads</category>
     ->   <icon image="features/highway__motorway_link.png"/>
    """
    global JOSM_element, featureGroup_category, feature, feature_category, feature_icon, icon_font
    #    if not ('featureGroup' in globals()):
    if not ('featureGroup' in globals()):
        ffeatureGroupMissing()
    # if previous item has no closed item, we submit to save previous item contents
    if ('feature' in globals()):
        print "\n</group> TAG missing before"
        fPrintCurrentElement()
        ffeatureEnd()
    feature=etree.Element("feature")
    feature.set("name",JOSM_element.get("name"))
    feature_category=etree.Element("category")
    if featureGroup_category is not None :
        feature_category.text=featureGroup_category
        feature.append(feature_category)
    """
    # detect if icon attribute and then create icon tag
    if (JOSM_element.get("icon")):
        feature_icon=etree.Element("icon")
        feature_icon_url=JOSM_element.get("icon")
        feature_icon.set("image",feature_icon_url)
        icon_font = etree.fromstring('<font size="14pt"><b>${name}</b></font>')
        feature_icon.append(icon_font)
        feature.append(feature_icon)
    """
    # adds icon TAG from JOSM Group to each feature TAG
    if featureGroup_icon is not None :
        print etree.tostring(featureGroup_icon)
        feature.append(featureGroup_icon)
    # list of types
    ctypes=JOSM_element.get("type")
    # print etree.tostring(JOSM_element)
    #debug print JOSM_node, "feature=", etree.tostring(feature,pretty_print=True)
    if ctypes:
        ctypes=ctypes.replace('closedway','area')
        #debug print 'feature-type : ', JOSM_element.tag, JOSM_element.text, JOSM_element.keys(), featureGroup_category
        ctypes_list=ctypes.rsplit(',')
        #    print "LIST ",cvalues_list
        for ctype in ctypes_list:
            if ctype=="node" : ctag=etree.Element("point")
            elif ctype=="way" : ctag=etree.Element("line")
            elif ctype=="closedway" : ctag=etree.Element("line")
            elif ctype=="relation" : ctag=etree.Element("relation")
            elif ctype=="relations" : ctag=etree.Element("relation")
            feature.append(ctag)
    #debug  print JOSM_node, "feature=", etree.tostring(feature,pretty_print=True)
    
def ffeatureEnd():
    global feature, featureGroup
    if ('featureGroup' in globals()):
        featureGroup.append(feature)
        if 'feature'  in globals() : del feature
def ffeatureMissing():
    # If Item tag is missing, adds feature and prints Error message
    global JOSM_node, JOSM_element, feature
    feature=etree.Element("feature")
    feature_category="NoName"
    print "\nJOSM ERROR : <item> TAG is missing before"
    # print etree.tostring(JOSM_element, pretty_print=True)
    fPrintCurrentElement()
def fHelpStart():
    global JOSM_element, feature
    #    <link href="http://wiki.openstreetmap.org/wiki/Tag:highway=motorway"
    #       de.href="http://wiki.openstreetmap.org/wiki/DE:Tag:highway=motorway" />
    # -> <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway</help>
    if not ('feature' in globals()):
        ffeatureMissing()
    help=etree.Element("help")
    help.text=JOSM_element.get("href")
    feature.append(help)
def fLineStart():
    global JOSM_element, feature
    #    <space />
    # -> <br/>
    if not ('feature' in globals()):
        ffeatureMissing()
    br=etree.Element("br")
    feature.append(br)
def fDescriptionStart():
    global JOSM_element, feature
    #    <label text="Edit Serviceway" />
    # -> <description  Access roads </description>
    if not ('feature' in globals()):
        ffeatureMissing()
    desc=etree.Element("description")
    desc.text=JOSM_element.get("text")
    feature.append(desc)
def fChoiceStart():
    #    <combo key="service" text="Serviceway type" values="alley,driveway,parking_aisle" default="" delete_if_empty="true" />
    # -> <input type="choice" presence="always" name="Type of service road" key="service" category="">
    # ->    <choice value="alley" text="Alleyway/laneway"/>
    # ->    <choice value="parking_aisle" text="Parking aisle" description="The path that cars drive on through a parking lot."/>
    # -> </input>
    global JOSM_element, feature
    if not ('feature' in globals()):
        ffeatureMissing()
    cinput=etree.Element("input")
    ckey=JOSM_element.get("key")
    ctext=JOSM_element.get("text")
    cvalues=JOSM_element.get("values")
    if (JOSM_element.get("default")):
        cdefault=JOSM_element.get("default")
        cinput.set("default",cdefault)
    cinput.set("type","choice")
    cinput.set("presence","always")
    cinput.set("name",ctext)
    cinput.set("key",ckey)
    cinput.set("category","")
    cinput.set("delete_if_empty","true")
    cvalues_list=cvalues.rsplit(',')
    #    print "LIST ",cvalues_list
    for cvalue in cvalues_list:
        choice=etree.Element("choice")
        choice.set("value",cvalue)
        choice.set("text",cvalue)
        cinput.append(choice)
    feature.append(cinput)
def fTagStart():
    #    <key key="highway" value="motorway_link" />
    # -> <tag k="highway" v="motorway_link"/>
    # -> <tag k="man_made" v="survey_point" vmatch="survey_point|lighthouse|beacon|cairn|buoy"/>
    global JOSM_element, feature
    if not ('feature' in globals()):
        ffeatureMissing()
    ctag=etree.Element("tag")
    ckey=JOSM_element.get("key")
    cvalue=JOSM_element.get("value")
    ctag.set("k",ckey)
    ctag.set("v",cvalue)
    feature.append(ctag)
def fCheckboxStart():    
    #    <check key="oneway" text="Oneway" default="off" delete_if_empty="true" />
    # -> <input type="checkbox" presence="onTagMatch" category="Restrictions" key="area" name="Open area" description="The way is a large open space, like at a dock, where vehicles can move anywhere within the space, rather than just along the edge." />
    global JOSM_element, feature
    if not ('feature' in globals()):
        ffeatureMissing()
    ccheck=etree.Element("check")
    ckey=JOSM_element.get("key")
    ctext=JOSM_element.get("text")
    cdefault=JOSM_element.get("default")
    cdelete=JOSM_element.get("delete_if_empty")
    ccheck.set("type","checkbox")
    ccheck.set("presence","")
    ccheck.set("category","")
    ccheck.set("key",ckey)
    ccheck.set("name",ctext)
    ccheck.set("description","")
    feature.append(ccheck)
def fOptionalStart():    
    #    <optional>
    # -> ??? dont find this fonctionality in Potlatch2
    global JOSM_element, feature
    if not ('feature' in globals()):
        ffeatureMissing()
    coptional=etree.Element("optional")
    #feature.append(coptional)
def fEntity():
    # not documented in feature_maps.xml
    #     <within entity="way" k="highway" minimum="2"/>
    # - > ???
def fRelation():
    # not documented in feature_maps.xml
    #     ???
    # ->  <tag k="route" v="hiking" vmatch="hiking|foot"/>
def fTextStart():    
    #    <text key="name" text="Name" default="" delete_if_empty="true" />
    # -> ???<input type="freetext" category="Restrictions" presence="always" name="Start day"
    # key="day_on"   description="What day of the week does it start?" layout="horizontal" priority="low"/>
    global JOSM_element, feature, feature_category
    if not ('feature' in globals()):
        ffeatureMissing()
    cinput=etree.Element("input")
    if (JOSM_element.get("key")):
        ckey=JOSM_element.get("key")
    else:
        ckey="NoKey"
    if (JOSM_element.get("text")):
        ctext=JOSM_element.get("text")
    else:
        ctext="NoText"
    if (JOSM_element.get("default")):
        cdefault=JOSM_element.get("default")
    else:
        cdefault=""
    if (JOSM_element.get("delete_if_empty")):
        cdelete=JOSM_element.get("delete_if_empty")
    else:
        cdelete=""
    cinput.set("type","freetext")
    cinput.set("category",featureGroup_category)
    cinput.set("key",ckey)
    cinput.set("presence","")
    feature_category=etree.Element("category")
    #debug  print ctext, etree.tostring(cinput,pretty_print=True)
    #debug  print "feature=", etree.tostring(feature,pretty_print=True)
    cinput.set("name",ctext)
    cinput.set("description","")
    feature.append(cinput)
def fCheckboxStart():    
    #    <check key="oneway" text="Oneway" default="off" delete_if_empty="true" />
    # -> <input type="checkbox" presence="onTagMatch" category="Restrictions" key="area" name="Open area" description="The way is a large open space, like at a dock, where vehicles can move anywhere within the space, rather than just along the edge." />
    global JOSM_element, feature
    if not ('feature' in globals()):
        ffeatureMissing()
    ccheck=etree.Element("check")
    ckey=JOSM_element.get("key")
    ctext=JOSM_element.get("text")
    cdefault=JOSM_element.get("default")
    cdelete=JOSM_element.get("delete_if_empty")
    ccheck.set("type","checkbox")
    ccheck.set("presence","")
    ccheck.set("category","")
    ccheck.set("key",ckey)
    ccheck.set("name",ctext)
    ccheck.set("description","")
    feature.append(ccheck)
def fMultiSelectStart():
    #    <multiselect key="cuisine" text="Cuisine" values="italian;chinese;pizza;burger;greek;german;indian;regional;kebab;turkish;asian;thai;mexican;japanese;french;sandwich;sushi" default=""/>
    #     values: delimiter-separated list of values (delimiter can be escaped with backslash)
    #     display_values: delimiter-separated list of values to be displayed instead of the
    #     database values, order and number must be equal to values
    #     short_description: delimiter-separated list of texts to be displayed below each
    # ->  Not found in Potlach2 : we treat like combo
    fChoiceStart()
    
def fRolesStart():
    #    <roles>
    if not ('feature' in globals()):
        ffeatureMissing()
    return
    
def fRolesEnd():
    #    </roles>
    return
def fRoleStart():
    #    <role key="outer" text="outer segment" requisite="required" type="way" />
    if not ('feature' in globals()):
        ffeatureMissing()
    return
"""
===============================================================================
 Main routine : parse JOSM presets and convert to Potlach2
===============================================================================
"""
JOSM_presets = etree.iterparse(infile, events=("start", "end"))
#print etree.tostring(JOSM_presets, encoding="utf-8",method="xml",pretty_print=True)
#print "========================================================================="
#for JOSM_event, JOSM_element in JOSM_presets:
#    print etree.find(".")
    #subElement(JOSM_element),pretty_print=True)
#print "========================================================================="
#logfile = open('test.log', 'w')
#logfile.write('test succeeded')
#logfile.close()
#===============================================================================
#<presets>
#<!-- *** group Humanitarian *** -->
#<group name="Humanitarian Features - Common Tags">
#<!-- *** item ID *** -->
#<item name="ID">
#<text key="id:uuid" text="ID:UUID"/>
group_no=0
groups_list=[]
JOSM_node=0
for JOSM_event, JOSM_element in JOSM_presets:
    #debug print JOSM_node, JOSM_element.tag, JOSM_element.text, JOSM_element.keys()
    JOSM_node=JOSM_node+1
#  if JOSM_event=="start":
    parent=JOSM_element.getparent()
    '''
    if JOSM_node>0:
        prec=JOSM_element.getprevious()
        txt_element=etree.tostring(prec)
        colend=txt_element.find("-->")+3
        if colend>1:
            print "\nCOMMENT before JOSM_element"
            print txt_element[0:colend], "\n***************************************"
    '''
    
    """
    # node 1 : modify Tag name when Namespace is specified on presets tag
    #ie. {http://josm.openstreetmap.de/tagging-preset-1.0}presets"
    if JOSM_node ==1:
        txt=JOSM_element.tag
        print "JOSM_element.tag", JOSM_element.tag
        iPresets=txt.find("presets")
        print "iPresets=", iPresets
        if iPresets>=1 : JOSM_element.tag="presets"
        print "JOSM_element.tag", JOSM_element.tag
        if (JOSM_element.find("presets")>=1): print "OUI PRESETS"
        print "DEBUG JOSM_node=", JOSM_node, ", JOSM_event=", JOSM_event, JOSM_element.tag
        fPrintCurrentElement()
    """    
    # --------- presets ==> mapFeatures ----------
    ### if (JOSM_node==1 and iPresets>=1 and (JOSM_event=="start")):
    if ((JOSM_element.tag=="presets") and (JOSM_event=="start")):
        fPresetsStart ()
        iPresets=0
    # --------- presets ==> write potlach2 preset main file ----------
    elif (JOSM_element.tag=="presets") and (JOSM_event=="end"):
        fPresetsEnd ()
    # --------- groups ----------
    # group menu - two levels exist
    # elif (JOSM_element.tag=="group") and (JOSM_event=="start"):
    # --------- first level group menu - ignore this first level of menu ----------
    elif (JOSM_element.tag=="group") and (parent.tag<>"group") and JOSM_event=="start":
        fGroup1Start()
    elif (JOSM_element.tag=="group") and (parent.tag<>"group") and JOSM_event=="end":
        fGroup1End()
    # --------- second level group menu ----------
    elif (JOSM_element.tag=="group") and (parent.tag=="group") and (JOSM_event=="start"):
        ffeatureGroupStart()
    # end of featureGroup - add category and include instructions + write Potlach2 feature file
    elif  (JOSM_element.tag=="group") and (parent.tag=="group") and (JOSM_event=="end"):
        ffeatureGroupEnd()
    # --------- separator line in JOSM preset menu ----------
    elif (JOSM_element.tag=="separator") and JOSM_event=="start":
        fSeparatorStart()
    elif (JOSM_element.tag=="separator") and JOSM_event=="end":
        fSeparatorEnd()
    # --------- items ----------
    elif (JOSM_element.tag=="item") and (JOSM_event=="start"):
        ffeatureStart()
    # end of item - append to feature
    elif (JOSM_element.tag=="item") and (JOSM_event=="end"):
        ffeatureEnd()
        # --------- link -> help ----------
    elif (JOSM_element.tag=="link") and (JOSM_event=="start"):
        fHelpStart()
    elif (JOSM_element.tag=="link") and (JOSM_event=="end"):
        pass
    # --------- space -> br ----------
    elif (JOSM_element.tag=="space") and (JOSM_event=="start"):
        fLineStart()
    elif (JOSM_element.tag=="space") and (JOSM_event=="end"):
        pass
    # --------- label -> description ----------
    elif (JOSM_element.tag=="label") and (JOSM_event=="start"):
        fDescriptionStart()
    elif (JOSM_element.tag=="label") and (JOSM_event=="end"):
        pass
    # --------- combo -> choice ----------
    elif (JOSM_element.tag=="combo") and (JOSM_event=="start"):
        fChoiceStart()
    elif (JOSM_element.tag=="combo") and (JOSM_event=="end"):
        pass
    # --------- key -> tag ----------
    elif (JOSM_element.tag=="key") and (JOSM_event=="start"):
        fTagStart()
    elif (JOSM_element.tag=="key") and (JOSM_event=="end"):
        pass
    # --------- check -> input type="checkbox" ----------
    elif (JOSM_element.tag=="check") and (JOSM_event=="start"):
        fCheckboxStart()
    elif (JOSM_element.tag=="check") and (JOSM_event=="end"):
        pass
    # --------- optional ->  ----------
    elif (JOSM_element.tag=="optional") and (JOSM_event=="start"):
        fOptionalStart()
    elif (JOSM_element.tag=="optional") and (JOSM_event=="end"):
        pass
    # --------- text ->  ----------
    elif (JOSM_element.tag=="text") and (JOSM_event=="start"):
        fTextStart()
    elif (JOSM_element.tag=="text") and (JOSM_event=="end"):
        pass
    # to verify if all TAGS have been treated
    else:
        print JOSM_event, "EVENT TAG not treated"
        fPrintCurrentElement()
"""
===============================================================================
 PARSING XML completed
 Builds Potlatch2 presets main file
 adds category and include instructions
===============================================================================
"""
#debug print "========================================================================="
#debug print featureGroup_category
#debug tree=etree.ElementTree(featureGroup)
#debug print etree.tostring(tree, encoding="utf-8",method="xml", xml_declaration=True,pretty_print=True)
# potalch2_preset file : adds category
comment = etree.Comment(' Categories ')
potlach2_preset.append(comment)
group_no=0
#debug print "========================================================================="
#debug print groups_list
for group in groups_list:
    #    <group name="Humanitarian Features - Common Tags">
    #==> <category name="Humanitarian" id="Humanitarian"/>
    category=etree.Element("category")
    category.set("name",group)
    potlach2_preset.append(category)
# potalch2_preset file : adds include tags
comment = etree.Comment(' Features ')
potlach2_preset.append(comment)
group_no=0
for group in groups_list:
    #    <group name="Humanitarian Features - Common Tags">
    #==> <include file="Humanitarian" id="Humanitarian.xml"/>
    category=etree.Element("include")
    category.set("name",group+".xml")
    potlach2_preset.append(category)
#=========================================================================
infile.close()
#-------------------------------------------------------------------------------------------------------------------------------------


#-------------------------------------------------------------------------------------------------------------------------------------
# file humanitarian_presets_josm-r.xml
#-------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<presets>
<!--
bug when using
<presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0">
<presets>
-->
<group test="TEST level 1, no name and icon specified">
<group test="TEST level 2, no name specified" icon="">
<titem test="we provoke 2 errors, no start and end item TAGs">
<label text="Edit Motorway" test="no item tag before this label tag" />
<space />
<key key="highway" value="motorway" />
<text key="ref" text="Reference" default="" delete_if_empty="true" />
<optional>
<text key="name" text="Name" default="" delete_if_empty="true" />
<combo key="layer" text="Layer" values="5,4,3,2,1,0,-1,-2,-3,-4,-5" default="" delete_if_empty="true" />
<combo key="lanes" text="Lanes" values="1,2,3,4,5" default="2" delete_if_empty="true" />
<text key="maxspeed" text="Max. speed (km/h)" default="" delete_if_empty="true" />
<check key="oneway" text="Oneway" default="on" delete_if_empty="true" />
<check key="bridge" text="Bridge" default="off" delete_if_empty="true" />
<check key="tunnel" text="Tunnel" default="off" delete_if_empty="true" />
<check key="cutting" text="Cutting" default="off" delete_if_empty="true" />
<check key="embankment" text="Embankment" default="off" delete_if_empty="true" />
<check key="lit" text="Lit" default="off" delete_if_empty="true" /> 
</optional>
</titem>
</group>
</group>
<group name="Humanitarian" icon="features/hot.png">
<!-- *** group Humanitarian *** -->
<group name="Humanitarian Features - Common Tags" icon="features/hot.png">
<!-- *** item ID *** -->
<item name="ID" type="node,way,closedway">
<text key="id:uuid" text="ID:UUID"/>
<text key="id:uid" text="id:uid" />
<text key ="id:ssid" text="id:ssid" />
</item>
    <separator/>
<item name="Name" type="node,way,closedway">
<text key="name" text="Name"/>
<text key="name:en" text="Name:En"/>
<text key="name:fr" text="Name:Fr"/>
<text key="name:kr" text="Name:Kr"/>
<text key="registry_name" text="Registry Name"/>
</item>
<!-- *** item Address *** -->
<item name="Address" type="node,closedway">
<text key="address:country_national_code" text="Address:Country_National_Code"/>
<text key="address:country" text="Address:Country"/>
<text key="address:city" text="Address:City"/>
<text key="address:ward" text="Address:Ward"/>
<text key="address:postal_code" text="Postal Code"/>
<text key="address:street" text="Address:Street"/>
<text key="address:housenumber" text="Address:House_Number"/>
</item>
<item name="Spatial Signature" type="node,closedway">
<text key="pcode" text="PCODE"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=1" text="Admin Level=1"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=2" text="Admin Level=2"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=3" text="Admin Level=3"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=4" text="Admin Level=4"/>
<text key="place:area" text="Place:Area"/>
<text key="place:area-alternate" text="Place:Area - Alternate Name"/>
<text key="description" text="Location Description"/>
<text key="place:nearestlandmark" text="Nearest Landmark" />
</item>
<item name="Operating Institution" type="node,closedway">
<text key="operator" text="Operator" />
<combo key="operator_type" text="operator type" values="government_facility-public,government_facility-not_public,private_for_profit,private_non_profit" />
<text key="operator id" text="Operator ID" />
</item>
<item name="Contact Information" type="node,closedway">
<text key="phonebusiness" text="Phone - Business"/>
<text key="phoneemergency" text="Phone - Emergency" />
<text key="email" text="Email"/>
<text key="fax:" text="Fax"/>
</item>
<item name="Humanitarian Use" type="node,closedway">
<combo key="humanitarian_use" text="Humanitarian Use" values="primary_hub,secondary_hub,final_delivery_point,operationally_significant_location,unspecified" />
</item>
<item name="Operational_status" type="node,closedway">
<combo key="Operational_status" text="Operational Status" values="open,restricted,closed,unspecified" />
<combo key="Operational_status_quality" text="Quality of Op. Status Info" values="reported,confirmed,unspecified" />
</item>
<item name="Surface" type="way">
<combo key="Surface" text="Surface" values="Paved,Gravel,Dirt/Sand,Unspecified" />
<combo key="SurfaceCondition" text="SurfaceCondition" values="Rough_less_than_40kph,Smooth_greater_than_40kph,Snow/Ice,Mud,Unspecified" />
</item>
<item name="Practicability" type="way">
<combo key="Practicability" text="Practicability" values="non_motorized,motorbike,4wd_less_than_3.5mt,light_truck_less_than_10mt,heavy_truck_less_than_20mt,truck_+_trailer_greater_than_20mt,unspecified" />
</item>
<item name="Source" type="node,way,closedway">
<text key="Geometry_source_type" text="Geometry Source Type" />
<text key="Geometry_source_date" text="Geometry Source Date" />
<text key="Attribute_source_type" text="Attribute Source Type" />
<text key="Attribute_source_date" text="Attribute Source Date" />
</item>
</group>
<group name="Humanitarian Features" icon="features/hot.png">
<item name="IDP Camp"  icon="features/hot.png" type="node,closedway">
<text key="id:uuid" text="ID:UUID"/>
<text key="id:uid" text="id:uid" />
<text key ="id:ssid" text="id:ssid" />
<text key="name" text="Name"/>
<text key="name:en" text="Name:En"/>
<text key="name:fr" text="Name:Fr"/>
<text key="name:kr" text="Name:Kr"/>
<text key="registry_name" text="Registry Name"/>
<text key="address:country_national_code" text="Address:Country_National_Code"/>
<text key="address:country" text="Address:Country"/>
<text key="address:city" text="Address:City"/>
<text key="address:ward" text="Address:Ward"/>
<text key="address:postal_code" text="Postal Code"/>
<text key="address:street" text="Address:Street"/>
<text key="address:housenumber" text="Address:House_Number"/>
<text key="pcode" text="PCODE"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=1" text="Admin Level=1"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=2" text="Admin Level=2"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=3" text="Admin Level=3"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=4" text="Admin Level=4"/>
<text key="place:area" text="Place:Area"/>
<text key="place:area-alternate" text="Place:Area - Alternate Name"/>
<text key="description" text="Location Description"/>
<text key="place:nearestlandmark" text="Nearest Landmark" />
<text key="operator" text="Operator" />
<combo key="operator_type" text="operator type" values="government_facility-public,government_facility-not_public,private_for_profit,private_non_profit" />
<text key="operator id" text="Operator ID" />
<text key="phonebusiness" text="Phone - Business"/>
<text key="phoneemergency" text="Phone - Emergency" />
<text key="email" text="Email"/>
<text key="fax:" text="Fax"/>
<combo key="settlement_type" text="Type of Settlement" values="spontaneous,planned,unspecified" />
<combo key="camp_management_agency" text="Camp Management Agency?" values="yes,no,unspecified" />
<text key="camp_management_agency_name" text="Camp Management Agency Name" />
<text key="pop_estimates_area" text="Population Estimates in Area" />
<text key="pop_estimates_site_ind" text="Population Estimates in Site - Indviduals" />
<text key="pop_estimates_site_hou" text="Population Estimates in Site - Households" />
<combo key="camp_registered" text="Camp Registered?" values="yes,no,unspecified" />
<text key="camp_registered_agency_name" text="Camp Regisration Agency" />
<combo key="camp_assessed" text="Camp Assessed?" values="yes,no,unspecified" />
<text key="camp_assessment_agency_name" text="Camp Assessment Agency Name" />
<combo key="Operational_status" text="Operational Status" values="open,restricted,closed,unspecified" />
<combo key="Operational_status_quality" text="Quality of Op. Status Info" values="reported,confirmed,unspecified" />
<text key="Geometry_source_type" text="Geometry Source Type" />
<text key="Geometry_source_date" text="Geometry Source Date" />
<text key="Attribute_source_type" text="Attribute Source Type" />
<text key="Attribute_source_date" text="Attribute Source Date" />
</item>
<item name="School" type="node,closedway">
<text key="id:uuid" text="ID:UUID"/>
<text key="id:uid" text="id:uid" />
<text key ="id:ssid" text="id:ssid" />
<text key="name" text="Name"/>
<text key="name:en" text="Name:En"/>
<text key="name:fr" text="Name:Fr"/>
<text key="name:kr" text="Name:Kr"/>
<text key="registry_name" text="Registry Name"/>
<text key="address:country_national_code" text="Address:Country_National_Code"/>
<text key="address:country" text="Address:Country"/>
<text key="address:city" text="Address:City"/>
<text key="address:ward" text="Address:Ward"/>
<text key="address:postal_code" text="Postal Code"/>
<text key="address:street" text="Address:Street"/>
<text key="address:housenumber" text="Address:House_Number"/>
<text key="pcode" text="PCODE"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=1" text="Admin Level=1"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=2" text="Admin Level=2"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=3" text="Admin Level=3"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=4" text="Admin Level=4"/>
<text key="place:area" text="Place:Area"/>
<text key="place:area-alternate" text="Place:Area - Alternate Name"/>
<text key="description" text="Location Description"/>
<text key="place:nearestlandmark" text="Nearest Landmark" />
<text key="operator" text="Operator" />
<combo key="operator_type" text="operator type" values="government_facility-public,government_facility-not_public,private_for_profit,private_non_profit" />
<text key="operator id" text="Operator ID" />
<text key="phonebusiness" text="Phone - Business"/>
<text key="phoneemergency" text="Phone - Emergency" />
<text key="email" text="Email"/>
<text key="fax:" text="Fax"/>
<text key="scolar_district" text="School District" />
<combo key="scolar_type" text="Type of School" values="Enseignement primaire - creche - jardin d'enfant,Enseignement primaire - ecole primaire,Enseignement primaire - ecole maternelle,Enseignement primaire - groupe scolaire,Enseignement secondaire - College,Enseignement secondaire - Lycee,Enseignement secondaire - Formation Professionnelle des Adultes (F.P.A.),Enseignement supérieur - faculte,Enseignement superieur - centre universitaire,Enseignement superieur - institut,Science - centre de recherche,Science - laboratoire,Science - observatoire,Science - station scientifique,Other (specify in Notes)" />
<combo key="Operational_status" text="Operational Status" values="open,restricted,closed,unspecified" />
<combo key="Operational_status_quality" text="Quality of Op. Status Info" values="reported,confirmed,unspecified" />
<text key="Geometry_source_type" text="Geometry Source Type" />
<text key="Geometry_source_date" text="Geometry Source Date" />
<text key="Attribute_source_type" text="Attribute Source Type" />
<text key="Attribute_source_date" text="Attribute Source Date" />
</item>
<item name="Electricity Network" type="way">
<combo key="classe" text="Classe" values="conduite,ligne_electrique,poste_transformation,pylone" />
<text key="voltage:" text="Voltage"/>
<text key="pos_sol:" text="Position par rapport au sol"/>
</item>
<item name="Health Facilities" type="node,closedway">
<text key="id:uuid" text="ID:UUID"/>
<text key="id:uid" text="id:uid" />
<text key ="id:ssid" text="id:ssid" />
<text key="name" text="Name"/>
<text key="name:en" text="Name:En"/>
<text key="name:fr" text="Name:Fr"/>
<text key="name:kr" text="Name:Kr"/>
<text key="registry_name" text="Registry Name"/>
<text key="address:country_national_code" text="Address:Country_National_Code"/>
<text key="address:country" text="Address:Country"/>
<text key="address:city" text="Address:City"/>
<text key="address:ward" text="Address:Ward"/>
<text key="address:postal_code" text="Postal Code"/>
<text key="address:street" text="Address:Street"/>
<text key="address:housenumber" text="Address:House_Number"/>
<text key="pcode" text="PCODE"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=1" text="Admin Level=1"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=2" text="Admin Level=2"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=3" text="Admin Level=3"/>
<text key="boundary=administrative" text="boundary=administrative"/>
<text key="admin_level=4" text="Admin Level=4"/>
<text key="place:area" text="Place:Area"/>
<text key="place:area-alternate" text="Place:Area - Alternate Name"/>
<text key="description" text="Location Description"/>
<text key="place:nearestlandmark" text="Nearest Landmark" />
<text key="operator" text="Operator" />
<combo key="operator_type" text="operator type" values="government_facility-public,government_facility-not_public,private_for_profit,private_non_profit" />
<text key="operator id" text="Operator ID" />
<text key="phonebusiness" text="Phone - Business"/>
<text key="phoneemergency" text="Phone - Emergency" />
<text key="email" text="Email"/>
<text key="fax:" text="Fax"/>
<combo key="type" text="Type" values="Specialized_Hopital,Hospital,Field Hospital,CS-Health_center,CAL-Health_center_with_beds,CSL-Health_center_without_beds,Dispensary,Other_type_of_health_facility,Unknown_type_of_facility,Unspecified" />
<text key="Organization_Name" text="Name of the Organization Responsible for Health Facility"/>
<combo key="Humanitarian:HealthFacility:OrganizationType" text="Type of Organization Responsible for Health Facility" values="government_facility-public,government_facility-not_public,private_for_profit,Faith-based_organization_(FBO),NGO_other_than_faith-based,Community,Unspecified" />
<text key="HealthFacilityConstructionDescription" text="Construction Description"/>
<text key="HealthFacilityServiceDescription" text="Service Description" />
<text key="HealthFacilityCapacityDescription" text="Capacity Description" />
<text key="HealthFacilityCapacityBeds" text="Number of Beds" />
<combo key="Operational_status" text="Operational Status" values="open,restricted,closed,unspecified" />
<combo key="Operational_status_quality" text="Quality of Op. Status Info" values="reported,confirmed,unspecified" />
<text key="Geometry_source_type" text="Geometry Source Type" />
<text key="Geometry_source_date" text="Geometry Source Date" />
<text key="Attribute_source_type" text="Attribute Source Type" />
<text key="Attribute_source_date" text="Attribute Source Date" />
</item>
<item name="Roads" type="way">
<combo key="highway" text="Type" values="primary,secondary,tertiary,footway,track,unspecified" delete_if_empty="true" />
<combo key="Operational_status" text="Operational Status" values="open,restricted,closed,unspecified" />
<combo key="Operational_status_quality" text="Quality of Op. Status Info" values="reported,confirmed,unspecified" />
<combo key="Surface" text="Surface" values="Paved,Gravel,Dirt/Sand,Unspecified" />
<combo key="SurfaceCondition" text="SurfaceCondition" values="Rough_less_than_40kph,Smooth_greater_than_40kph,Snow/Ice,Mud,Unspecified" />
<combo key="Practicability" text="Practicability" values="non_motorized,motorbike,4wd_less_than_3.5mt,light_truck_less_than_10mt,heavy_truck_less_than_20mt,truck_+_trailer_greater_than_20mt,unspecified" />
<text key="Geometry_source_type" text="Geometry Source Type" />
<text key="Geometry_source_date" text="Geometry Source Date" />
<text key="Attribute_source_type" text="Attribute Source Type" />
<text key="Attribute_source_date" text="Attribute Source Date" />
</item>
<item name="Transport Obstacles" type="node">
<combo key="type" text="Type" values="bridge_damage,road_damage,landslide,mudslide,debris,checkpoint,roadblock,unspecified" />
<combo key="Operational_status" text="Operational Status" values="open,restricted,closed,unspecified" />
<combo key="Operational_status_quality" text="Quality of Op. Status Info" values="reported,confirmed,unspecified" />
<combo key="Practicability" text="Practicability" values="non_motorized,motorbike,4wd_less_than_3.5mt,light_truck_less_than_10mt,heavy_truck_less_than_20mt,truck_+_trailer_greater_than_20mt,unspecified" />
<text key="Geometry_source_type" text="Geometry Source Type" />
<text key="Geometry_source_date" text="Geometry Source Date" />
<text key="Attribute_source_type" text="Attribute Source Type" />
<text key="Attribute_source_date" text="Attribute Source Date" />
</item>
<item name="WaterPoint" type="node">
<combo key="waterpoint_type" text="Waterpoint Type" values="tap,well,tank,bladder,unspecified" />
<text key="Geometry_source_type" text="Geometry Source Type" />
<text key="Geometry_source_date" text="Geometry Source Date" />
<text key="Attribute_source_type" text="Attribute Source Type" />
<text key="Attribute_source_date" text="Attribute Source Date" />
</item>
</group>
</group>
</presets>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/potlatch-dev/attachments/20110314/8698f261/attachment-0001.html>


More information about the Potlatch-dev mailing list