Changes between Version 74 and Version 75 of UserGuidelines/GIS/Data


Ignore:
Timestamp:
09/06/10 15:27:22 (11 years ago)
Author:
Fran Boon
Comment:

PEP8 ;)

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/GIS/Data

    v74 v75  
    8888table = db[tablename]
    8989db.executesql("DROP INDEX name__idx on %s;" % tablename)
    90 db(table.id<166).delete()
    91 db(table.id>166).delete()
     90db(table.id < 166).delete()
     91db(table.id > 166).delete()
    9292db.commit()
    9393# L0
    9494import csv
    9595csv.field_size_limit(2**20 * 10)  # 10 megs
    96 db.import_from_csv_file(open('L0.csv','rb'))
     96db.import_from_csv_file(open("L0.csv", "rb"))
    9797db.commit()
    9898# L1
    99 gis.import_csv('pak_adm1.csv')
     99gis.import_csv("pak_adm1.csv")
    100100db.commit()
    101101# L2
    102 db(table.name=="Baluchistan").update(name="Balochistan")
    103 db(table.name=="Northern Areas").update(name="Gilgit Baltistan")
    104 db(table.name=="N.W.F.P.").update(name="Khyber Pakhtunkhwa")
    105 db(table.name=="F.A.T.A.").update(name="FATA")
    106 db(table.name=="F.C.T.").update(name="Islamabad")
    107 db(table.name=="Azad Kashmir").update(name="AJK")
    108 gis.import_csv('pak_adm2.csv')
    109 db(table.name=="Sind").update(name="Sindh")
    110 db(table.name=="AJK").update(name="Pakistan Administered Kashmir")
    111 db(table.name=="Islamabad").update(name="Federal Capital Territory")
    112 db(table.name=="FATA").update(name="Federally Administered Tribal Areas")
     102db(table.name == "Baluchistan").update(name="Balochistan")
     103db(table.name == "Northern Areas").update(name="Gilgit Baltistan")
     104db(table.name == "N.W.F.P.").update(name="Khyber Pakhtunkhwa")
     105db(table.name == "F.A.T.A.").update(name="FATA")
     106db(table.name == "F.C.T.").update(name="Islamabad")
     107db(table.name == "Azad Kashmir").update(name="AJK")
     108gis.import_csv("pak_adm2.csv")
     109db(table.name == "Sind").update(name="Sindh")
     110db(table.name == "AJK").update(name="Pakistan Administered Kashmir")
     111db(table.name == "Islamabad").update(name="Federal Capital Territory")
     112db(table.name == "FATA").update(name="Federally Administered Tribal Areas")
    113113db.commit()
    114114# L2
    115 db(table.name=="Islamabad Capital Territory").update(name="Islamabad")
    116 db(table.name=="Jaccobabad").update(name="Jacobabad")
    117 db(table.name=="Tando Allahyar").update(name="Tando Allah Yar")
    118 db(table.name=="Qambar Shahdad kot").update(name="Qambar Shahdadkot")
    119 gis.import_csv('pak_adm3.csv')
    120 db(table.name=="Islamabad").update(name="Islamabad Capital Territory")
    121 db(table.name=="Tando Allah Yar").update(name="Tando Allahyar")
    122 db(table.name=="Qambar Shahdadkot").update(name="Qambar Shahdad Kot")
    123 db(table.name=="Leiah").update(name="Layyah")
    124 db(table.name=="Leiah Tehsil").update(name="Layyah Tehsil")
    125 db(table.name=="Kalur Kot Tehsil").update(name="Kallur Kot Tehsil")
    126 db(table.name=="De-excluded Area").update(name="Tribal Area")
    127 db(table.name=="De-excluded Area D.g Khan").update(name="Tribal Area")
     115db(table.name == "Islamabad Capital Territory").update(name="Islamabad")
     116db(table.name == "Jaccobabad").update(name="Jacobabad")
     117db(table.name == "Tando Allahyar").update(name="Tando Allah Yar")
     118db(table.name == "Qambar Shahdad kot").update(name="Qambar Shahdadkot")
     119gis.import_csv("pak_adm3.csv")
     120db(table.name == "Islamabad").update(name="Islamabad Capital Territory")
     121db(table.name == "Tando Allah Yar").update(name="Tando Allahyar")
     122db(table.name == "Qambar Shahdadkot").update(name="Qambar Shahdad Kot")
     123db(table.name == "Leiah").update(name="Layyah")
     124db(table.name == "Leiah Tehsil").update(name="Layyah Tehsil")
     125db(table.name == "Kalur Kot Tehsil").update(name="Kallur Kot Tehsil")
     126db(table.name == "De-excluded Area").update(name="Tribal Area")
     127db(table.name == "De-excluded Area D.g Khan").update(name="Tribal Area")
    128128db.commit()
    129129field = "name"