-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_console.py
260 lines (232 loc) · 21.6 KB
/
test_console.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
import codecs, os
import psycopg2
from pyspatialite import dbapi2 as sqlite
from PyQt4.QtCore import QTimer, QFileInfo
from PyQt4.QtGui import QColor, QApplication
import qgis
from qgis.core import (
QgsApplication,
QgsDataSourceURI, QgsMapLayerRegistry,
QgsGeometry, QgsCoordinateTransform
)
from qgis.gui import QgsRubberBand, QgsMessageBar
class AddLayerSQL():
def __init__(self, nameModulus, sqlProperties, layerProperties):
self.nameModulus = nameModulus
#
self.mlr = QgsMapLayerRegistry.instance()
self.canvas = qgis.utils.iface.mapCanvas()
self.msgBar = qgis.utils.iface.messageBar()
#
self.geom = QgsGeometry.fromWkt( sqlProperties[ 'geomWkt' ] )
self.geomName = sqlProperties[ 'geomName' ]
self.sql = sqlProperties['sql']
self.layerSrc = self.mlr.mapLayer( sqlProperties[ 'layer_id' ] )
#
self.nameLayerSQL = layerProperties[ 'name' ]
self.styleLayerSQL = layerProperties[ 'style' ]
def _addHighlightGeom(self):
def highlight():
rb = QgsRubberBand( self.canvas, QGis.Polygon)
rb.setBorderColor( QColor( 255, 0, 0 ) )
rb.setWidth( 2 )
rb.setToGeometry( geomRB, None )
return rb
crsCanvas = self.canvas.mapSettings().destinationCrs()
crsLayer = self.layerSrc.crs()
if not crsCanvas == crsLayer:
geomRB = QgsGeometry( self.geom )
ct = QgsCoordinateTransform( crsLayer, crsCanvas )
geomRB.transform( ct )
else:
geomRB = self.geom
return highlight()
def _removeHighlightGeom(self, rb, seconds):
def removeRB():
rb.reset( True )
self.canvas.scene().removeItem( rb )
QTimer.singleShot( seconds * 1000, removeRB )
def addLayer(self):
def connectPostgres( uri ):
tConn = ( uri.host(), uri.port(), uri.username(), uri.password(), uri.database() )
sConn = "host='%s' port='%s' user='%s' password='%s' dbname='%s'" % tConn
driver = psycopg2
return {
'driver': driver,
'conn': psycopg2.connect( sConn ),
'sqlStyleTable': "SELECT FROM WHERE AND name='%s'"
}
def connectSqlite( uri ):
tableStyle = 'layer_styles'
sConn = uri.database()
driver = sqlite
return {
'driver': driver,
'conn': sqlite.connect( sConn ),
'sqlStyleTable': "SELECT name FROM sqlite_master WHERE type='table' AND name='%s'" % tableStyle,
'tableStyle': 'layer_styles'
}
def runSQL(sql, cur, drv_conn):
msgError = None
try:
cur.execute( sql )
except drv_conn['driver'].Error as e:
msgError = e.message
#
if not msgError is None:
clip = QApplication.clipboard()
msg = "Error in query '%s'.\nError: %s\n\n%s" % ( self.nameLayerSQL, msgError, sql )
clip.setText( msg.decode( 'utf-8') )
msg = "Error in query '%s'. See Clipboard!" % self.nameLayerSQL
cur.close()
drv_conn['conn'].close()
return { 'isOk': False, 'msg': msg }
return { 'isOk': True }
def existFeatures():
drv_conn = f_connections[ name ]( uri )
cur = drv_conn['conn'].cursor()
#
result = runSQL( self.sql, cur, drv_conn )
if not result['isOk']:
return result
#
hasFeatures = False if cur.fetchone() is None else True
#
cur.close()
drv_conn['conn'].close()
return { 'isOk': True, 'hasFeatures': hasFeatures }
def addStyleLayerQuery():
def getStyleDB():
drv_conn = f_connections[ name ]( uri )
cur = drv_conn['conn'].cursor()
#
result = runSQL( drv_conn[ 'sqlStyleTable' ], cur, drv_conn )
if not result[ 'isOk']:
return result
#
hasTable = False if cur.fetchone() is None else True
if hasTable is None:
data = ( self.nameLayerSQL, drv_conn[ 'tableStyle' ] )
msg = "Error in query '%s' (for verify style). Not exist table '%s'!" % data
return { 'isOk': True, 'exits': False, 'msg': msg }
#
data = ( drv_conn[ 'tableStyle' ], self.styleLayerSQL )
sql = "SELECT styleQML FROM %s WHERE styleName = '%s'" % data
result = runSQL( sql, cur, drv_conn )
if not result[ 'isOk']:
return result
#
value = cur.fetchone()
if value is None:
data = ( self.nameLayerSQL, self.styleLayerSQL, rv_conn[ 'tableStyle' ] )
msg = "Error in query '%s' (for verify style). Not exist style '%s' in table '%s'!" % data
return { 'isOk': True, 'exits': False, 'msg': msg }
#
cur.close()
drv_conn['conn'].close()
#
return { 'isOk': True, 'exits': True, 'qml': value[0] }
#
def setStyleLayer(qml):
qmlFile = "%saddlayersql_action_temp.qml" % ( QgsApplication.qgisSettingsDirPath() )
if os.path.exists(qmlFile):
os.remove( qmlFile )
f = codecs.open( qmlFile, 'w', encoding='utf8')
f.write( qml )
f.close()
#
layerQuery.loadNamedStyle( qmlFile )
#
os.remove( qmlFile )
if self.styleLayerSQL is None:
return
# File
fileStyle = QFileInfo( self.styleLayerSQL )
if fileStyle.exists() and fileStyle.isFile():
layerQuery.loadNamedStyle( self.styleLayerSQL )
return
# DB *** Had self.styleLayerSQL and not is file -> Need be a DB
result = getStyleDB()
if not result['isOk'] or not result['exits']:
rb = self._addHighlightGeom()
self.msgBar.pushMessage( self.nameModulus, result['msg'], QgsMessageBar.WARNING, 5 )
self._removeHighlightGeom( rb, 5 )
return
#
setStyleLayer( result['qml'] )
f_connections = { 'postgres': connectPostgres, 'spatialite': connectSqlite }
prov = self.layerSrc.dataProvider()
name = prov.name()
if not name in f_connections.keys():
msg = "Provider '%s' of layer '%s' is not supported!" % ( name, self.layerSrc.name() )
self.msgBar.pushMessage( self.nameModulus, msg, QgsMessageBar.WARNING, 5 )
return
keyCol = table = ''
uri = QgsDataSourceURI( prov.dataSourceUri() )
if uri.host() == '':
table = "( %s )" % self.sql
else:
keyCol = '_uid_'
table = "( SELECT row_number() over () AS _uid_,* FROM ( %s ) AS _subq_1_ )" % self.sql
result = existFeatures()
if not result['isOk']:
rb = self._addHighlightGeom()
self.msgBar.pushMessage( self.nameModulus, result['msg'], QgsMessageBar.WARNING, 5 )
self._removeHighlightGeom( rb, 5 )
return
if not result['hasFeatures']:
rb = self._addHighlightGeom()
msg = "Not found features in query '%s'!" % self.nameLayerSQL
self.msgBar.pushMessage( self.nameModulus, msg, QgsMessageBar.WARNING, 5 )
self._removeHighlightGeom( rb, 5 )
return
schema = filter_sql = ''
uri.setDataSource( schema, table, self.geomName, filter_sql, keyCol )
layerQuery = QgsVectorLayer( uri.uri(), self.nameLayerSQL, name )
if not layerQuery.isValid(): # Never happing?
rb = self._addHighlightGeom()
msg = "Layer query '%s' not valid!" % self.nameLayerSQL
self.msgBar.pushMessage( self.nameModulus, msg, QgsMessageBar.WARNING, 5 )
self._removeHighlightGeom( rb, 2 )
return
msg = "Added %s (total %s)" % ( self.nameLayerSQL, layerQuery.featureCount() )
self.msgBar.pushMessage( self.nameModulus, msg, QgsMessageBar.INFO, 3 )
rb = self._addHighlightGeom()
addStyleLayerQuery()
self.mlr.addMapLayer( layerQuery )
qgis.utils.iface.setActiveLayer( self.layerSrc )
self._removeHighlightGeom( rb, 2 )
def getData():
feat_filter = '1304104'
layerSQL = "landsat_muni_%s" % feat_filter
style = 'add_landsat'
sql = """
SELECT
"img_catalogo_landsat"."id",
"img_catalogo_landsat"."image",
"img_catalogo_landsat"."data",
"img_catalogo_landsat"."orbita",
"img_catalogo_landsat"."ponto",
"img_catalogo_landsat"."geom"
FROM
"img_catalogo_landsat"
INNER JOIN
"municipio_ibge"
ON
"municipio_ibge"."geocodmu" = '%s' AND
MbrIntersects("img_catalogo_landsat"."geom", "municipio_ibge"."geom") AND
ST_Intersects("img_catalogo_landsat"."geom", "municipio_ibge"."geom")
""" % feat_filter
sqlProperties = {
'layer_id': iface.activeLayer().id(),
'geomWkt': 'MultiPolygon (((-61.30195750107590413 -3.50037755133874562, -61.21148304454020206 -3.49488313135887596, -61.20939672982259339 -3.48712000886869955, -61.2021252490350065 -3.47280053860212812, -61.20340292510820746 -3.46448138696565122, -61.19806901244569985 -3.44943071278051416, -61.19737241389910309 -3.44168091152443711, -61.19067572900402041 -3.4380802153437755, -61.18593090592511174 -3.43181685856950081, -61.1717594948172092 -3.4237653510737549, -61.15942516382560257 -3.41352974528956921, -61.15262420541330357 -3.40998987300564416, -61.13567818109461172 -3.40980738578936027, -61.12715170359972205 -3.41179345171353621, -61.12045490075069409 -3.41647351023072243, -61.10298373611178846 -3.43300859354838117, -61.10053477005521927 -3.44133622000267803, -61.1003998353481137 -3.44980108731469137, -61.09251523244402193 -3.45196962747610048, -61.08517516804040781 -3.45004071970170401, -61.07809601370191643 -3.44579422598450247, -61.07354404290219207 -3.4385123698872011, -61.07192732359831666 -3.42322900532241148, -61.07579029593261311 -3.39793602123602945, -61.07490230894961769 -3.38231612816491101, -61.08489623365331767 -3.3706551999567429, -61.08701105947901056 -3.36323568260291594, -61.09142501509310819 -3.35641887296150898, -61.11481312088920959 -3.33424478509745548, -61.11995710867478948 -3.32507834451168538, -61.11617748859801935 -3.31365442431443036, -61.11134841428562225 -3.30654455087567278, -61.11245439098119903 -3.29875596244807756, -61.10473128074810489 -3.29724939947125684, -61.09842356451410694 -3.29219670547144272, -61.10095040725489213 -3.28437186385113922, -61.10134109603440322 -3.27602193127643293, -61.09976124689269739 -3.26752525224652146, -61.11334932024279709 -3.25891109391998413, -61.11895879815921262 -3.25294956094440835, -61.12647948898631256 -3.25159452759771295, -61.13386845393781499 -3.2545218342260771, -61.15062595794081091 -3.25363095348370646, -61.17370263611682191 -3.24704297267842268, -61.1810956790321967 -3.24280120285154139, -61.18906855332370753 -3.24432311908701188, -61.19734483906709954 -3.24396928586875255, -61.21973416667110257 -3.23668644370346126, -61.22731817033009349 -3.2364172889351206, -61.24170875692151128 -3.22817584207748087, -61.24912420739531171 -3.22597898102933334, -61.26378829457280517 -3.21825903746057485, -61.27590639398080441 -3.2079342959810333, -61.28281995547521177 -3.20463871126937194, -61.29865217079301942 -3.20419541964217647, -61.30643084885610961 -3.20741260207483059, -61.31390411574540167 -3.20426645337236504, -61.31895658034211749 -3.1975180884393648, -61.32026205022479814 -3.18992989999147358, -61.31962541022789992 -3.15601538693092643, -61.32084599945671499 -3.14790675921809182, -61.33043324046091271 -3.13317283362604471, -61.34892625049720749 -3.11608939100583449, -61.35251064708241131 -3.10888166252959053, -61.35437347038551792 -3.0919863385238644, -61.35107060679041524 -3.06701812438914345, -61.35615207994651144 -3.03403670953540505, -61.35648605480851359 -3.00481017825167385, -61.37201140626049067 -2.99662649366877165, -61.37987414405240827 -2.99417543470597192, -61.38240399360861232 -2.98511778110638915, -61.38317712854549058 -2.97430417056521446, -61.39323113483301597 -2.94674800900727796, -61.40734533101120007 -2.89511933301603186, -61.40687551486541196 -2.88513963279423891, -61.41285087011981147 -2.87866968065331097, -61.41400733325038885 -2.86962126146153818, -61.42145632329379623 -2.86721540643298756, -61.43059381228601978 -2.86706666837039226, -61.43711869432050321 -2.86086356369357553, -61.43484222023710828 -2.85238480168176434, -61.43648165664821192 -2.84425836165217039, -61.44146218013030847 -2.83830498257435604, -61.45043275775311997 -2.8346164749697671, -61.45465397936371232 -2.82807095976088263, -61.46332113780520956 -2.82475944159725056, -61.47050891134431083 -2.81797103181232345, -61.47831714269862147 -2.81677244093656309, -61.48334807647410827 -2.80871311516696753, -61.48098487343332152 -2.79934878833870471, -61.48348511334281596 -2.78661607539982281, -61.46612820423160883 -2.76688315417492969, -61.45692357948039586 -2.76337988491368591, -61.44912137896291426 -2.76106122999879178, -61.43509838989550076 -2.76365163406826619, -61.42581940921279937 -2.76290863705067125, -61.41331982959259506 -2.76591995766516163, -61.40426290692410305 -2.76155485075870466, -61.40487723412530841 -2.75331799433729563, -61.40826485445199978 -2.74253405917762993, -61.40270907120139299 -2.73269489934272247, -61.39107074172670764 -2.73564349680269592, -61.38437085920811143 -2.74153320756991281, -61.37656552633610829 -2.74477413308531615, -61.36823487750190509 -2.7456684230028463, -61.34545840758021029 -2.74475778053714681, -61.33710024165039698 -2.74571487310221496, -61.32482179562580882 -2.74094609452509186, -61.31359650928249749 -2.73940162557798317, -61.28539442665891812 -2.74100822502057051, -61.27683968788659996 -2.7436616686917823, -61.26912918646382167 -2.74361061129463391, -61.25950866613140988 -2.74062666107718211, -61.25062637301161317 -2.74102929340703838, -61.24696126504410643 -2.752123258851495, -61.2441429823757062 -2.76960813691559071, -61.23517752610702303 -2.77542354833289062, -61.23211784699300608 -2.76776136925010086, -61.22195313909721648 -2.76451332008413786, -61.20368163437160547 -2.76972751210627699, -61.16565434369739762 -2.78549176958286937, -61.15854363976759345 -2.79065145456088981, -61.15306825788831446 -2.80263639061946712, -61.14412374461331012 -2.80795115861740285, -61.11485252266802348 -2.81518198257186469, -61.06134244847011416 -2.81376429929398153, -61.05315201897040822 -2.81727012820330636, -61.04078739589370883 -2.82672511804021553, -61.03381991801650486 -2.84190122517299804, -61.02489498278271896 -2.84576926096842087, -61.01645166419351085 -2.8522222510815487, -61.0083429563471995 -2.86295413788780762, -61.00656292386469204 -2.87515385589592753, -61.00050787409470843 -2.88367537531387708, -60.98456810836080422 -2.88625957653297238, -60.9729524705608199 -2.90179877109130313, -60.9616173092795961 -2.92788589448750702, -60.96676397667581426 -2.9337770486894037, -60.97886502021031419 -2.9401220392659555, -60.98106958997121296 -2.95159943564127936, -60.97678351620261594 -2.96522616655764182, -60.97731968449969742 -2.97749501611974843, -60.98784928247211212 -2.98253710531454352, -60.99470229948301636 -2.98796037939827563, -60.99057192982040476 -3.00030335869444098, -60.9836792292328056 -3.00561658511658614, -60.97603733358011624 -3.0064471750921995, -60.96772738205041264 -3.00408348260387736, -60.94756542381510656 -3.00336674694103056, -60.9380655389256134 -3.01616880131320109, -60.92326127552391313 -3.02225105718436193, -60.91787071862521685 -3.02757422667335696, -60.91357055018130495 -3.03446080187555101, -60.9088424659935157 -3.04897354189605529, -60.9017847681281097 -3.05285240666334712, -60.88778721863980792 -3.04459011114970846, -60.87412219064241725 -3.0526062560120657, -60.86886619414100608 -3.0465978726969829, -60.8606267294758112 -3.04955944037740601, -60.85581398146582188 -3.05663953168526348, -60.85437432906850574 -3.06490951100723219, -60.84767515764229273 -3.06959364014763914, -60.84264483189990358 -3.0709125010625451, -60.83201917372910827 -3.08212393345106772, -60.81936482358170792 -3.08350151462332356, -60.81496826304700676 -3.09528605627059594, -60.81030871339871169 -3.09930122324004476, -60.78575114286702075 -3.09943690817262052, -60.77817429469119048 -3.09816067717781252, -60.77169995930681523 -3.09328415711704174, -60.76328542910558639 -3.09282488508000686, -60.75501039003270876 -3.09590854177838581, -60.74740025937659738 -3.09617871733417704, -60.72581389973750277 -3.10391392795872356, -60.71798046387260683 -3.10430490605345089, -60.71103805270850273 -3.10901043779859698, -60.68945639568971728 -3.13323820418039212, -60.68676385917401461 -3.14045641150119614, -60.68701337618491465 -3.15441410416176815, -60.67852807636330681 -3.16403381369952275, -60.67788443012901212 -3.16075667742336019, -60.68124328916429988 -3.15589813576847877, -60.67985684366090027 -3.15168351376459777, -60.68368299711251268 -3.14588879985582714, -60.68257189938370999 -3.14420183602407288, -60.65272683482390903 -3.14081235346503451, -60.64441953830802845 -3.13887894159307734, -60.63698244138901572 -3.13512619707279061, -60.61406534304110494 -3.13045662070620345, -60.60687520125069483 -3.12716711091963218, -60.60056623266622466 -3.12134838719610208, -60.58628109144711971 -3.11567898972304747, -60.56242359240221163 -3.12153360367216637, -60.55447950481701724 -3.12007363393359416, -60.54789010547101213 -3.12407685158162307, -60.53350331401900064 -3.11634030578026611, -60.45900856850621352 -3.11727518052592512, -60.36685961447701487 -3.13342275855947605, -60.36498029417749933 -3.13469740585683443, -60.37399029395510297 -3.14176757476488255, -60.37849242114590709 -3.14889420814828913, -60.37414611721131052 -3.16700380787494584, -60.36956697556601625 -3.17210036665515815, -60.36449628764241027 -3.17354913463329114, -60.35945687218300293 -3.17886261059704722, -60.35610619622561757 -3.18532405443136479, -60.35423278408680403 -3.19978008541190118, -60.35202383544570637 -3.20187718855221259, -60.3455647577733032 -3.20375060069089157, -60.34265431660911361 -3.20669269044451521, -60.34103194231150269 -3.21189780798251423, -60.34339714579721203 -3.2159151579244627, -60.34384194974551008 -3.22053427584898078, -60.33842448408920234 -3.23432936756751932, -60.3343053029091223 -3.23880903007432241, -60.3321921751456216 -3.23909849963096175, -60.32709751094851214 -3.23490119105963991, -60.32255283890911102 -3.23455382759167165, -60.31777659122431601 -3.23698537186747259, -60.31540294085981913 -3.24048795350284724, -60.31603977388441251 -3.24830363153220159, -60.31103195055430888 -3.25768244516742378, -60.31124587133901116 -3.26902536913803221, -60.35475164678871351 -3.30497932295950481, -60.36253807629410062 -3.30389594659303931, -60.37095230342271179 -3.30544196599072926, -60.37917619950680148 -3.30410403008188247, -60.39600683399390846 -3.30598224465940138, -60.50053462356721212 -3.36800088114607021, -60.63990065123481088 -3.4481954897725835, -60.6319827453126905 -3.46392630607762841, -60.62870779062600946 -3.48076590971013733, -60.62842163064651402 -3.48871006209507772, -60.63687222124549692 -3.50890947412770604, -60.63326360992290631 -3.52431518322142212, -60.62736775003641299 -3.53951192604220388, -60.62826008346821283 -3.54712252208191536, -60.63723619910609841 -3.5600237544129536, -60.64164769945341504 -3.57529115834527422, -60.64750859878459721 -3.58157377258830811, -60.66411823878080867 -3.6091479787101366, -60.66678348015270217 -3.61663887770522141, -60.66256903402410927 -3.63218376530003129, -60.67173712180821354 -3.64512394363539993, -60.68278683865349876 -3.66768763525671027, -60.69376400907940194 -3.7063368559568266, -60.70004029476881868 -3.71145511071613887, -60.70789297401270801 -3.71550229278920652, -60.72412393523340768 -3.7202284587930925, -60.75112340541141265 -3.72409318764824526, -60.77604197701051447 -3.72505212501107552, -60.79259708798592499 -3.7298193749869295, -60.80664911925529736 -3.73659799364428746, -60.84231533587481522 -3.73767955812462205, -60.87545458864789083 -3.74358021046378919, -60.88229181145391777 -3.74768478685812489, -60.89684114088269951 -3.76711764254762915, -60.91912468342451348 -3.77514840723916745, -60.92634546023751341 -3.77102326128049192, -60.93070825982451311 -3.76468716238523893, -60.93839697780811093 -3.76156306996528089, -60.95626173471291054 -3.76300227282861366, -60.964459585122313 -3.76604229634348409, -60.97275641823922143 -3.76670334622853309, -60.98595295832041074 -3.7753790964498295, -61.00053676728580854 -3.78209332706765977, -61.01545881978810826 -3.7826115088732819, -61.02581695430450992 -3.79530264702314835, -61.03820802262371359 -3.81573879957581008, -61.04473633881701744 -3.82145689990930348, -61.06214791740220704 -3.79485445342420347, -61.0784525095195221 -3.79485723898899208, -61.08670835439319546 -3.7926610858592853, -61.09461619952770661 -3.79546306923861332, -61.10990203741291538 -3.79616907909040036, -61.12526267748699382 -3.7930547936690111, -61.13154545898231618 -3.78742235412730599, -61.13934991920712037 -3.79045253212547717, -61.14687352522059172 -3.78922415645667687, -61.15242684754521463 -3.78357991716586195, -61.1467347403994026 -3.77772914340645283, -61.14167932943261974 -3.76287500299813926, -61.14329046348989749 -3.75512561999087202, -61.15865298722940224 -3.75010994835439515, -61.15753672278181341 -3.74240097958772733, -61.14706358532308883 -3.72983229404833816, -61.14418313593051124 -3.72220999345595782, -61.14482044577280817 -3.70627565884903865, -61.15048492319891693 -3.70084598286913513, -61.33232344282001947 -3.69620065954973764, -61.40726624022630631 -3.62565947880648576, -61.39104015220820543 -3.60938660930636734, -61.37746208353841837 -3.6021964215654636, -61.36128998303210835 -3.60255804939396151, -61.32137235584310986 -3.6084497026141884, -61.30579483535491647 -3.60440311801897195, -61.29057029917680666 -3.60620126117978224, -61.29006742890402393 -3.58165030233140547, -61.29384717215331335 -3.56569815594783712, -61.29003850585809232 -3.55858652049258062, -61.29082048412860217 -3.54246788481146879, -61.30281869226259772 -3.5322370419554332, -61.29907291324660434 -3.51687092166333581, -61.29884768112280824 -3.50900541402920307, -61.30195750107590413 -3.50037755133874562)))',
'sql': sql,
'geomName': 'geom'
}
layerProperties = { 'name': layerSQL, 'style': style }
return ( sqlProperties, layerProperties )
nameModulus = "Action Add Landsat"
( sqlProperties, layerProperties ) = getData()
alq = AddLayerSQL( nameModulus, sqlProperties, layerProperties )
alq.addLayer()
#