Пример #1
0

if __name__ == "__main__":
    import DataSources as mydatasource
    reload(mydatasource)
    #Constants
    FACTORING_NUMBER = 100  #values divide this number to rescale to integer.
    cchuncked_lines = []
    ROUNDAT = 0  #to convert to int, make it 0
    INTERGER_CONVERSION = True

    #Load Data.
    dlslist = []
    datatype = 'mscounty'
    t0, t1 = 0, 0
    polygons, inputspatialref = mydatasource.getPolygons(datatype=datatype)
    print len(polygons)
    for pid in [0]:  #,63,64,65,66,67,68,69]:#range(len(polygons)):
        print("pid:"), pid
        polygon = [polygons[pid]]
        try:
            t0 = time.time()
            cchuncked_lines, cntoriglines = divide_lines_into_chunks(polygon)
            t1 = time.time()
        except:
            continue
        dls = constructDls(cchuncked_lines)
        dlslist = [(datatype + ',' + str(pid) + "," + str(cntoriglines), dls)]
        print("Constructed a dictionary type DLS.time:div,dlsconst:"), round(
            t1 - t0, 3), ',', round(time.time() - t1, 3)
        print
Пример #2
0
                yy.append('w')
            #if (y[k][1]>y[k][0]) and (y[k][0]>= y[k-1][1]):#...(?,6),(8,10)
            #yy.append('g')
            #yy.append('w') #wrapped around
            #if (y[k][1]>y[k][0]) and (y[k][1]== y[k-1][1]):
            #yy.append('w') #wrapped around after a previous blue
    return yy


if __name__ == "__main__":

    import DataSources as mydatasource
    import sys
    reload(mydatasource)
    datatype = 'sample'
    polygons, inputsspatialref, feature_names = mydatasource.getPolygons(
        datatype=datatype, dofilter=True)
    print("len of features_names"), len(polygons)
    printer(polygons)

    domapall = True  #divides a complete map of polygons.
    if domapall:
        howmany = 1
    else:
        howmany = len(polygons)
    datarows = []
    for fid in range(0, howmany):
        if domapall:
            polygon = polygons  #we are passing list of polys
            fidx = 'map'
        else:
            polygon = [polygons[fid]]