Commit 39a359c1 authored by xuebingbing's avatar xuebingbing

创建

parent 8d31d8e0
Pipeline #280 failed with stages
## pycharm ignore
# User-specific files
#虚拟环境
venv
#python cache files
__pycache__
*.pyc
#pycharm project files
.idea
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import sys
from dtmodel.gps_context import GpsContext
class Director(object):
"""
流程导演,用于组装各种处理策略
"""
def __init__(self):
pass
def main(argv):
# self.db = kwargs['db']
# self.layer = kwargs['layer']
# self.preprocess_module = importlib.import_module(kwargs['preprocess_module'])
# self.preprocess_strategy = kwargs['preprocess_strategy']
# self.process_module = importlib.import_module(kwargs['module'])
# self.process_strategy = kwargs['strategy']
gpscontext = GpsContext(db='', layer='', preprocess_module='preprocessing.gps.strategy.s1', preprocess_strategy='S1',
process_module='processing.gps.strategy.s1', process_strategy='S1')
gpscontext.pre_processing()
if __name__ == '__main__':
main(sys.argv)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import importlib
class GpsContext(object):
"""
gps 内容抽象类
表名:RAW_GPS_P
原始GPS:除原始gps信息外,存储前一点、后一点的连接关系
PREV 字符串 (数量:id列表)
PREV_COUNT int 前向节点数量
NEXT
NEXT_COUNT
BLOCKED int 0 正常点,1分段点
GPS连通图
表明:GPS_GRAPH_P
单次或多次原始连通的GPS轨迹融合生成的连通图
PREV 字符串 (数量:id列表)
PREV_COUNT int 前向节点数量
NEXT
NEXT_COUNT
BLOCKED int 0 正常点,1分段点
TYPE 点类型 0-主点 2-pair点, pair点依附于主点存在(被聚类的点)
"""
def __init__(self, **kwargs):
"""
:param kw:
db x str
layer str
preprocess_module str 预处理模块名
preprocess_strategy str 预处理策略名
process_module str 处理模块名
process_strategy str 处理策略名
"""
if 0 == len(kwargs):
return
self.db = kwargs['db']
self.layer = kwargs['layer']
self.preprocess_module = importlib.import_module(kwargs['preprocess_module'])
self.preprocess_strategy_name = kwargs['preprocess_strategy']
self.process_module = importlib.import_module(kwargs['process_module'])
self.process_strategy_name = kwargs['process_strategy']
pre_reflect = getattr(self.preprocess_module, self.preprocess_strategy_name)
self.preprocess_strategy = pre_reflect(self)
process_reflect = getattr(self.process_module, self.process_strategy_name)
self.process_strategy = process_reflect(self)
def pre_processing(self):
self.preprocess_strategy.invoke()
def processing(self):
self.process_strategy.invode()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
class IGpsProcess(object, metaclass=ABCMeta):
@abstractmethod
def invoke(self):
pass
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
"""
#预处理模块
##GPS预处理
##图像识别预处理
"""
\ No newline at end of file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from interfaces.igps import IGpsProcess
from dtmodel.gps_context import GpsContext
class S1(IGpsProcess):
"""
gps处理策略
"""
def __init__(self, context=GpsContext()):
self.context =context
def invoke(self):
"""
执行策略
:return:
"""
# print('{}' % self)
print(self)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from interfaces.igps import IGpsProcess
class S1(IGpsProcess):
def __init__(self):
pass
def invoke(self):
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment