當前位置: 首頁>>代碼示例>>Python>>正文


Python WRCCUtils.orient_shape_ccw方法代碼示例

本文整理匯總了Python中WRCCUtils.orient_shape_ccw方法的典型用法代碼示例。如果您正苦於以下問題:Python WRCCUtils.orient_shape_ccw方法的具體用法?Python WRCCUtils.orient_shape_ccw怎麽用?Python WRCCUtils.orient_shape_ccw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WRCCUtils的用法示例。


在下文中一共展示了WRCCUtils.orient_shape_ccw方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: station_meta_to_json

# 需要導入模塊: import WRCCUtils [as 別名]
# 或者: from WRCCUtils import orient_shape_ccw [as 別名]

#.........這裏部分代碼省略.........
    params = {'meta':'name,state,sids,ll,elev,uid,valid_daterange','elems':vX_tuple}
    params[WRCCData.STN_AREA_FORM_TO_PARAM[by_type]] = val
    if by_type == 'sw_states':params['state'] = 'az,ca,co,nm,nv,ut'
    #Find bbox for custom shapes
    if by_type == 'shape':
        shape_type,bbox = WRCCUtils.get_bbox(val)
        params['bbox'] = bbox

    #Acis Metadata call and sanity checks on results
    try:
        request = StnMeta(params)
    except:
        stn_json['error'] = 'Metadata request failed. Please check your parameters!'
        WRCCUtils.load_data_to_json_file(f_dir + f_name, stn_json)
        return stn_json, f_name

    if request is None:
        stn_json['error'] = 'No metadata found.'
        WRCCUtils.load_data_to_json_file(f_dir + f_name, stn_json)
        return stn_json, f_name
    if not 'meta' in request.keys() or not request['meta'] or 'error' in request.keys():
        stn_json['error'] = 'No metadata found.'
        WRCCUtils.load_data_to_json_file(f_dir + f_name, stn_json)
        return stn_json, f_name
    stn_meta_list = []
    #For alphabetic ordering of station names
    sorted_list =[]
    #Keep track of duplicates
    unique_stations = []
    for i, stn in enumerate(request['meta']):
        #if custom shape, check if  stn lies within shape
        if by_type == 'shape':
            if shape_type in ['bbox','location']:shape = bbox.split(',')
            elif shape_type == 'polygon':shape = WRCCUtils.orient_shape_ccw(val).split(',')
            else:shape = val.split(',')
            if not stn_in_poly(by_type, shape_type, shape, stn):
                continue
        #sanity check
        if not stn['valid_daterange']:
            continue
        #check if we are looking for stations with particular variables
        if el_list is not None and time_range is not None:
            #Check if ACIS produced correct output, i.e. one valid_daterange per variable
            if len(stn['valid_daterange']) < len(el_list):
                continue
            #Check if station is valid, if not, proceed to next station
            flag_invalid_station = station_invalid(el_list, vX_list, time_range, stn, constraints)
            if flag_invalid_station:
                continue
        stn_sids = []
        stn_networks = []
        stn_network_codes = []
        sids = stn['sids'] if 'sids' in stn.keys() else []
        marker_icons = []
        for sid in sids:
            sid_split = sid.split(' ')
            '''
            #put coop id up front (for csc application metagraph  and possibly others)
            if str(sid_split[1]) == '2':
                #stn_sids.append(re.sub('[^a-zA-Z0-9\n\.]', ' ', str(sid_split[1])))
                stn_sids.insert(0,str(sid_split[0]).replace("\'"," "))
                stn_network_codes.insert(0, str(sid_split[1]))
                marker_icons.insert(0, WRCCData.NETWORK_ICONS[str(sid_split[1])])
                stn_networks.insert(0,WRCCData.NETWORK_CODES[str(sid_split[1])])
            else:
            '''
開發者ID:bdaudert,項目名稱:my-python-lib,代碼行數:70,代碼來源:AcisWS.py


注:本文中的WRCCUtils.orient_shape_ccw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。