コード例 #1
0
ファイル: dotfile.py プロジェクト: econandrew/DotMapper
    
                # Export data to the database file    
                    try:
                        c.execute( "insert into people_by_group values (?,?,?,random(),?)", (x, y, quadkey,group_type) )
                    except:
                        print "Failed to insert ", x, y, tx, ty, group_type
                        sys.exit(-1)

	    c.execute("create index if not exists i_quadkey on people_by_group(x, y, quadkey, rand, group_type)")
        conn.commit()

# Execution code...

if __name__=='__main__':
    settings_file = "settings.json"

    if (len(sys.argv) > 1):
        settings_file = sys.argv[1]

    with open(settings_file, "r") as f:
        settings = json.load(f)

    # convert from unicode to utf-8 to avoid upsetting ogr
    settings = convertjson.convert(settings)

    shapes_file_list = glob.glob(settings['shapes_path']+'/*.shp')

    main(shapes_file_list,
         settings['db_filename'],
         settings['groups'])
コード例 #2
0
            fill = ImageColor.getrgb(groups[group]['color'])
            if use_ellipse:
                draw.ellipse(
                    (rx - radius, ry - radius, rx + radius, ry + radius),
                    fill=fill)
            else:
                draw.point((rx, ry), fill=fill)
            #print "Draw at ", (rx-radius,ry-radius,rx+radius,ry+radius), ImageColor.getrgb(groups[group]['color'])

        save_tile(img, tiles_path, zoom, gtx, gty)

    save_defined_tiles(tiles_path)


# Execution code...

if __name__ == '__main__':
    settings_file = "settings.json"

    if (len(sys.argv) > 1):
        settings_file = sys.argv[1]

    with open(settings_file, "r") as f:
        settings = json.load(f)

    # convert from unicode to utf-8 to avoid upsetting ogr
    settings = convertjson.convert(settings)

    main(settings['tiles_path'], settings['db_filename'], settings['groups'],
         settings['zoom_levels'])