Exemple #1
0
def get(iconname):
    iconpath = os.path.join(ICONSFOLDER, iconname)
    if os.path.lexists(iconpath):
        return pyagg.load(iconpath)
    else: raise Exception("No icon by that name")
Exemple #2
0
print ""
print "testing from country name"
germany = Country(name="United States")
print germany

print ""
print "testing geojson"
print str(germany.__geo_interface__)[:200]
import pyagg
canvas = pyagg.Canvas(600,300)
canvas.geographic_space()
canvas.draw_geojson(germany.__geo_interface__)

print ""
print "testing flag image"
img = pyagg.load(germany.flag).resize(60,30)
canvas.paste(img, canvas.coord2pixel(*germany.point))
canvas.view()

print ""
print "testing neighbours and hierarchy"
print germany.neighbours
print germany.region
print germany.continent

print ""
print "testing flexible country name search"
for country in search_countryname("Korea"):
    print country

print ""
Exemple #3
0
def imgfill(w,h):
    return pa.load(r"C:\Users\kimo\Downloads\BM_Maps_100204710.jpg").resize(w,h)