Ahoj,

pro zajímavost, tvůj skript jsem při zkoumání LPISu nakonec zavrhl, jelikož 
jsem našel tohle:

http://wiki.openstreetmap.org/wiki/Ogr2osm

Stačí doplnit translation funkci (vypůjčeno z pův. skriptu, v příloze) a 
veškerou srandu udělá jeden příkaz:

ogr2osm.py PLPIS_233406_KU_KOD_742376.shp -t trn-lpis.py -o ujezd.lpis.osm

Mj. je tím vyřešeno slučování uzlů, multipolygony a nejspíš i další problémy.

Martin

def filterTags(attrs):
    if not attrs:
        return

    tags = {}
    tags['source'] = 'lpis'

    if 'ID_FB' in attrs:
	tags['id_fb'] = attrs['ID_FB'];
    if 'VYSKA' in attrs:
	tags["ele"] = "%d" % int(float(attrs['VYSKA']))
    if 'NKODFB' in attrs:
	tags["ref"] = attrs['NKODFB']

    kul = -1
    if 'KULTURA' in attrs and attrs['KULTURA'] != '':
	kul = int(attrs['KULTURA'])

    if kul == 2:    tags["landuse"] = "farmland"
    elif kul == 3:  tags["landuse"] = "farmland"; tags["crop"] = "hop"
    elif kul == 30: tags["landuse"] = "farmland"; tags["crop"] = "hop"
    elif kul == 31: tags["landuse"] = "farmland"; tags["crop"] = "hop"
    elif kul == 41: tags["landuse"] = "vineyard"; tags["barrier"] = "fence"
    elif kul == 61: tags["landuse"] = "orchard";  tags["barrier"] = "fence"
    elif kul == 62: tags["landuse"] = "orchard"
    elif kul == 7:  tags["landuse"] = "meadow"; tags["meadow"] = "agricultural"
    elif kul == 71: tags["landuse"] = "meadow"; tags["meadow"] = "agricultural"
    elif kul == 72: tags["landuse"] = "meadow"; tags["meadow"] = "agricultural"
    elif kul == 91: tags["landuse"] = "forest";
    elif kul == 92: tags["landuse"] = "farm"; tags["crop"] = "vegetables"
    elif kul == 97: tags["landuse"] = "reservoir"
    elif kul == 98: tags["landuse"] = "scrub"; tags["note"]="rychle rostouci dreviny"
    elif kul == 99: tags["landuse"] ="forest"
    else:           tags["landuse"] ="unknown_farmland_%s" % kul

    return tags

_______________________________________________
Talk-cz mailing list
Talk-cz@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-cz

Odpovedet emailem