コード例 #1
0
def execute(args):
    query_type = classify_query(args)

    if query_type == 'latest':
        return getFullHistogram(args)
    else:
        return getAlertCount(args)
コード例 #2
0
ファイル: biomassloss.py プロジェクト: sunank200/gfw-api
def execute(args):
    if 'begin' in args:
        args['begin'] = args['begin'].strftime('%Y-%m-%d')
    if 'end' in args:
        args['end'] = args['end'].strftime('%Y-%m-%d')

    query_type = classify_query(args)

    # Set default threshold
    if 'thresh' not in args:
        args['thresh'] = 30

    if query_type == 'iso':
        return _executeIso(args)
    elif query_type == 'id1':
        return _executeId1(args)
    elif query_type == 'ifl':
        return _executeIfl(args)
    elif query_type == 'ifl_id1':
        return _executeIflId1(args)
    elif query_type == 'use':
        return _executeUse(args)
    elif query_type == 'wdpa':
        return _executeWdpa(args)
    elif query_type == 'world':
        return _executeWorld(args)
コード例 #3
0
def execute(args):
    query_type = classify_query(args)

    if 'begin' in args:
        args['begin'] = args['begin'].strftime('%Y-%m-%d')
    if 'end' in args:
        args['end'] = args['end'].strftime('%Y-%m-%d')

    # Set default threshold
    if 'thresh' not in args:
        args['thresh'] = 30

    if query_type == 'iso':
        return _executeIso(args)
    elif query_type == 'id1':
        return _executeId1(args)
    elif query_type == 'ifl':
        return _executeIfl(args)
    elif query_type == 'ifl_id1':
        return _executeIflId1(args)
    elif query_type == 'use':
        return _executeUse(args)
    elif query_type == 'wdpa':
        return _executeWdpa(args)
    elif query_type == 'world':
        return _executeWorld(args)
コード例 #4
0
ファイル: glad.py プロジェクト: wri/gfw-api
def execute(args):
    query_type = classify_query(args)

    if query_type == 'latest':
        return getFullHistogram(args)
    else:
        return getAlertCount(args)
コード例 #5
0
    def process(cls, args):
        classification = classify_query(args)

        query = ''
        if hasattr(cls, classification):
            query = getattr(cls, classification)(args)

        if hasattr(cls, classification.upper()):
            query = getattr(cls, classification.upper()).format(**args)

        return cls.clean(query)
コード例 #6
0
    def process(cls, args):
        classification = classify_query(args)

        query = ''
        if hasattr(cls, classification):
            query = getattr(cls, classification)(args)

        if hasattr(cls, classification.upper()):
            query = getattr(cls, classification.upper()).format(**args)

        return cls.clean(query)
コード例 #7
0
ファイル: umd.py プロジェクト: johan--/gfw-api
def execute(args):
    query_type = classify_query(args)

    # Set default threshold
    if not 'thresh' in args:
        args['thresh'] = 10

    if query_type == 'iso':
        return _executeIso(args)
    elif query_type == 'id1':
        return _executeId1(args)
    elif query_type == 'ifl':
        return _executeIfl(args)
    elif query_type == 'ifl_id1':
        return _executeIflId1(args)    
    elif query_type == 'use':
        return _executeUse(args)
    elif query_type == 'wdpa':
        return _executeWdpa(args)
    elif query_type == 'world':
        return _executeWorld(args)