diff --git a/Python/Kuntakartta.py b/Python/Kuntakartta.py index 3470705..32342c1 100644 --- a/Python/Kuntakartta.py +++ b/Python/Kuntakartta.py @@ -39819,22 +39819,26 @@ if rawgeocachefi == "[LIITÄ LÖYTÖTAULUKKO PAIKKAKUNNITTAIN TÄHÄN]": print("""'Löytötaulukko paikkakunnittain' puuttuu""") exit() -otsikko = rawgeocachefi[rawgeocachefi.find('Sija\t'):rawgeocachefi.find('Yht.\n')+4] -stats = rawgeocachefi[rawgeocachefi.find('1.\t'):rawgeocachefi.find('\n',rawgeocachefi.find(kuntia+"."))].replace(otsikko+'\n',"") +otsikko = rawgeocachefi[rawgeocachefi.find('Paikkakunta\t'):rawgeocachefi.find('Eri\n')+4] +stats = rawgeocachefi[rawgeocachefi.find('Akaa\t'):rawgeocachefi.find('\n',rawgeocachefi.find("Äänekoski"))].replace(otsikko+'\n',"") sarake = otsikko.split('\t') k, A = 1, 0 while k <= int(kuntia): - A = stats.find(str(k)+'.'+'\t', A) + if k > 1: + A = stats.find('\n', A) + 1 + if k != int(kuntia): B = A + stats[A:].find('\n') else: B = len(stats) kunta = stats[A:B].split('\t') - PAYLOAD = kunta[0]+kunta[1]+' '+sarake[15]+' '+kunta[15]+' /' - if int(kunta[15]) > 0: + PAYLOAD = kunta[0]+' '+sarake[14]+' '+kunta[14]+' /' + if int(kunta[14]) > 0: COLOR = '#poly-009D57-1-0' + if int(kunta[1]) > 0: + PAYLOAD = PAYLOAD+'/ '+sarake[1]+' '+kunta[1]+' ' if int(kunta[2]) > 0: PAYLOAD = PAYLOAD+'/ '+sarake[2]+' '+kunta[2]+' ' if int(kunta[3]) > 0: @@ -39859,12 +39863,10 @@ while k <= int(kuntia): PAYLOAD = PAYLOAD+'/ '+sarake[12]+' '+kunta[12]+' ' if int(kunta[13]) > 0: PAYLOAD = PAYLOAD+'/ '+sarake[13]+' '+kunta[13]+' ' - if int(kunta[14]) > 0: - PAYLOAD = PAYLOAD+'/ '+sarake[14]+' '+kunta[14]+' ' else: COLOR = '#poly-DB4436-1-64' - KuntaA = kuntarajat.find(''+kunta[1]+'') + KuntaA = kuntarajat.find(''+kunta[0]+'') SplitA = kuntarajat[KuntaA:].find('CDATA[')+KuntaA+6 SplitB = kuntarajat[KuntaA:].find(']]>')+KuntaA @@ -39882,5 +39884,3 @@ tiedosto = "Kuntarajat" + now.strftime("%d%m%Y") + ".kml" with open(tiedosto, "w") as f: f.write(kuntarajat) print(kuntarajat) -print('VALMIS') -input() \ No newline at end of file