-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReSyncSurvey.py
55 lines (43 loc) · 1.75 KB
/
ReSyncSurvey.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# ReSyncSurvey.py - SyncSurvey with Reprojection
# Author: Lindsay Bradford, Truii.com, 2024.
# Release History:
# ---------------------------------------------------------------------------
# V1: Initial release
# ---------------------------------------------------------------------------
from importlib import reload
import support.arcpy_proxy as arcpy_proxy
import support.config as config
import support.reprojector as reprojector
import support.extractor as extractor
import support.transformer as transformer
import support.loader as loader
import support.messenger as messenger
NAME='ReSyncSurvey'
VERSION = '1.0'
def buildReprojector(configSupplied):
# ETL sub-component dependency injection
return reprojector.SurveyReprojector(configSupplied).\
usingExtractor(extractor.AGOLSurveyReplicator(configSupplied)).\
usingTransformer(transformer.FGDBReprojectionTransformer(configSupplied)).\
usingLoader(loader.ReprojectingSDEAppender(configSupplied))
def main():
mainMessenger = messenger.Messenger()
mainMessenger.info(f'{NAME} version {VERSION}')
configSupplied = config.Config().map()
mainMessenger.info(f'Parameters supplied: {configSupplied}')
reprojector = buildReprojector(configSupplied)
reprojector.reproject()
def reloadModulesForArcGISPro():
# https://gis.stackexchange.com/questions/91112/refreshing-imported-modules-in-arcgis-python-toolbox
reload(messenger)
reload(arcpy_proxy)
reload(config)
reload(reprojector)
reload(extractor)
reload(transformer)
reload(loader)
if __name__ == '__main__':
reloadModulesForArcGISPro()
main()