示例#1
0
    def showParamsOfGeom(self):

        if self.ui.comboboxtext_rules.get_active() != -1:
            new_object.setTextviews('')

            tileBunch = new_object.getTileBunch(zentral_tile)
            texte = []
            #print tileBunch
            #try:
            if showBbox == True: postgre.makePostgresTableBbox()

            for tile in tileBunch:
                infos = []
                text = 'Tile= x:' + str(tile[0]) + ' | y:' + str(
                    tile[1]) + '\n'
                #infos of the tile that should be processed
                self.tileproj = rendering.GoogleProjection(maxZoom + 1)
                extent, z = new_object.getExtents(tile)

                if showBbox == True: postgre.writeBBoxToPostgres('555', extent)

                featCount = 0
                #print self.datasource[0]
                #print 'I am at showParamsOfGeom'
                if self.datasource[0] == 'shape':
                    featCount = gdal.getDataInfos(self.datasource[2]['file'],
                                                  extent, str(self.filter))
                elif self.datasource[0] == 'postgis':
                    featCount = postgre.getDataInfos(self.datasource[2],
                                                     extent, str(self.filter))
                text = text + 'Extent: \n'
                text = text + str(extent[0]) + ', ' + str(extent[1]) + '\n'
                text = text + str(extent[2]) + ', ' + str(extent[3]) + '\n'

                text = text + 'Features:' + str(featCount) + ' \n'

                text = text + 'Minimum Distance: \n'
                text = text + 'Contacted: \n'
                text = text + '...\n'
                texte.append(text)

            new_object.setTextviews(texte)
            if showBbox == True:
                if added == False:
                    added = True
                    global added
                    new_object.addBoxToMap()
示例#2
0
 def showParamsOfGeom(self):
     
     if self.ui.comboboxtext_rules.get_active() != -1:
             new_object.setTextviews('') 
         
             tileBunch = new_object.getTileBunch(zentral_tile)
             texte = []
        #print tileBunch
         #try:
             if showBbox == True: postgre.makePostgresTableBbox()
                 
             for tile in tileBunch:
                 infos = []
                 text = 'Tile= x:' + str(tile[0]) + ' | y:'+ str(tile[1]) +'\n'
                 #infos of the tile that should be processed
                 self.tileproj = rendering.GoogleProjection(maxZoom+1)
                 extent, z = new_object.getExtents(tile)
                 
                 if showBbox == True: postgre.writeBBoxToPostgres('555',extent)
                 
                 featCount = 0
                 #print self.datasource[0]
                 #print 'I am at showParamsOfGeom'
                 if self.datasource[0] == 'shape':
                     featCount = gdal.getDataInfos(self.datasource[2]['file'], extent, str(self.filter))
                 elif self.datasource[0] == 'postgis':
                     featCount = postgre.getDataInfos(self.datasource[2], extent, str(self.filter))
                 text = text + 'Extent: \n'
                 text = text + str(extent[0]) + ', ' + str(extent[1])+'\n'
                 text = text + str(extent[2]) + ', ' + str(extent[3])+'\n'
                
                 text = text +'Features:'+ str(featCount)+' \n'
                 
                 text = text +'Minimum Distance: \n'
                 text = text +'Contacted: \n'
                 text = text +'...\n'
                 texte.append(text)
                
             new_object.setTextviews(texte)  
             if showBbox == True: 
                 if added == False:
                     added = True
                     global added
                     new_object.addBoxToMap()
示例#3
0
 def initializeInfoWindow(self, mapnik_map, tile_window, styling_window):
     self.mapnik_map = mapnik_map
     self.tile_window = tile_window
     self.styling_window = styling_window
     
     self.datasource = self.styling_window.datasource
     self.filter = self.styling_window.filter
     
     self.setTextviews('') 
        
     tileBunch, maxZoom = self.tile_window.getParameterForGeneralisation()
     text_array = []
         
     for tile in tileBunch:
         infos = []
         text = 'Tile= x:' + str(tile[0]) + ' | y:'+ str(tile[1]) +'\n'
         #infos of the tile that should be processed
         self.tileproj = rendering.GoogleProjection(maxZoom+1)
         extent, z, extent_geo = self.tile_window.getExtents(tile, self.tileproj)
         
         featCount = 0
         #print self.datasource[0]
         if self.datasource[0] == 'shape':
             featCount, inner_distance = gdal.getDataInfos(self.datasource[2]['file'], extent, str(self.filter))
         elif self.datasource[0] == 'postgis':
             featCount = postgre.getDataInfos(self.datasource[2], extent, str(self.filter))
         text = text + 'Extent: \n'
         text = text + str(extent[0]) + ', ' + str(extent[1])+'\n'
         text = text + str(extent[2]) + ', ' + str(extent[3])+'\n'
         text = text + str(extent_geo[0]) + ', ' + str(extent_geo[1])+'\n'
         text = text + str(extent_geo[2]) + ', ' + str(extent_geo[3])+'\n'
        
         text = text +'Features:'+ str(featCount)+' \n'
         
         if inner_distance != -1:
             text = text +'Minimum Distance (inner distance): %s\n'%(inner_distance)
         text = text +'Contacted: \n'
         text = text +'...\n'
         text_array.append(text)
        
     self.setTextviews(text_array)