예제 #1
0
 def remove_results(cls):
     '''
     remove result layers
     '''
     # ToDo: remove results from database (?)
     group = ProjectLayer.find(cls.results_group, groupname=cls.layer_group)
     if group:
         group[0].removeAllChildren()
예제 #2
0
 def show_dockwidget(self, widget):
     '''
     Show a dock-widget (domain or definition). Only one can be active at a
     time
     '''
     if self.active_dockwidget:
         self.active_dockwidget.close()
     else:
         tree_layer = ProjectLayer.find(ProjectDefinitions.layer_group)
         if tree_layer:
             tree_layer[0].setItemVisibilityChecked(False)
     self.active_dockwidget = widget
     widget.show()
예제 #3
0
 def close(self):
     '''
     close parameters and drawing tools
     '''
     # ToDo: implement this in project (collecting all used workscpaces)
     output = ProjectLayer.find('Umriss des Plangebiets')
     if output:
         layer = output[0].layer()
         layer.removeSelection()
     if hasattr(self, 'params'):
         self.params.close()
     self.bordertool.set_active(False)
     super().close()
예제 #4
0
    def change_area(self):
        '''
        set currently selected area as active area
        '''
        self.area = self.ui.area_combo.itemData(
            self.ui.area_combo.currentIndex())
        if not self.area:
            return

        output = ProjectLayer.find('Umriss des Plangebiets')
        if output:
            layer = output[0].layer()
            layer.removeSelection()
            layer.select(self.area.id)

        self.setup_params()
예제 #5
0
    def load_content(self):
        super().load_content()
        output = ProjectLayer.find('Projektdefinition')
        if output:
            output[0].setItemVisibilityChecked(True)
        self.areas = Teilflaechen.features(project=self.project)
        self.links = RouteLinks.features(project=self.project, create=True)
        self.traffic_load = TrafficLoadLinks.features(project=self.project,
                                                      create=True)
        self.transfer_nodes = TransferNodes.features(project=self.project,
                                                     create=True)
        self.itineraries = Itineraries.features(project=self.project,
                                                create=True)
        self.ways = Ways.features(project=self.project, create=True)
        self.connectors = Connectors.features(project=self.project,
                                              create=True)

        self.draw_nodes()
        self.fill_node_combo()
        self.setup_ways()
        self.setup_weights()
 def load_content(self):
     super().load_content()
     output = ProjectLayer.find('Projektdefinition')
     if output:
         output[0].setItemVisibilityChecked(True)
예제 #7
0
    def show_results(self):
        '''
        show the results from "Projektwirkung" as layers
        '''
        # hide layers messing up the readability of the results
        study_output = ProjectLayer.find(self.study_group)
        if study_output:
            study_output[0].setItemVisibilityChecked(False)
        nullfall_output = ProjectLayer.find(self.nullfall_group)
        if nullfall_output:
            nullfall_output[0].setItemVisibilityChecked(False)

        group_name = f'{self.layer_group}/{self.results_group}'
        planfall_markets = self.markets.filter(id_betriebstyp_planfall__gt=0)
        # check first one only
        checked = True
        for market in planfall_markets:
            if market.id_betriebstyp_nullfall == market.id_betriebstyp_planfall:
                continue
            output = ProjectLayer.from_table(self.relations.table,
                                             groupname=group_name)
            layer_name = f'Kaufkraftbindung {market.name} ({market.id})'
            output.draw(label=layer_name,
                        style_file='standortkonkurrenz_kk_bindung_2.qml',
                        filter=f'id_markt={market.id}',
                        expanded=False,
                        checked=checked)
            # zoom to first layer
            if checked:
                output.zoom_to()
            checked = False
        self.markets.filter()

        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(
            label='Umsatzveränderung der Bestandsmärke nach Zentren',
            style_file='standortkonkurrenz_umsatzveraenderung_zentren.qml',
            filter='nutzerdefiniert=1',
            expanded=False,
            checked=checked)
        checked = False
        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(
            label='Umsatzveränderung der Bestandsmärke nach Gemeinde/Verw-Gem.',
            style_file='standortkonkurrenz_umsatzveraenderung_vwg.qml',
            filter='nutzerdefiniert=-1 and auswahl!=0',
            expanded=False,
            checked=checked)
        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(label='Zentralität im Nullfall nach Gemeinde/Verw-Gem.',
                    style_file='standortkonkurrenz_zentralitaet_nullfall.qml',
                    filter='nutzerdefiniert=-1 and auswahl!=0',
                    expanded=False,
                    checked=checked)
        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(label='Zentralität im Planfall nach Gemeinde/Verw-Gem.',
                    style_file='standortkonkurrenz_zentralitaet_planfall.qml',
                    filter='nutzerdefiniert=-1 and auswahl!=0',
                    expanded=False,
                    checked=checked)
        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(
            label='Veränderung der Zentralität im Planfall gegenüber Nullfall',
            style_file='standortkonkurrenz_entwicklung_zentralitaet.qml',
            filter='nutzerdefiniert=-1 and auswahl!=0',
            expanded=False,
            checked=checked)
        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(
            label='Verkaufsflächendichte im Nullfall',
            style_file='standortkonkurrenz_verkaufsflaechendichte_nullfall.qml',
            filter='nutzerdefiniert=-1 and auswahl!=0',
            expanded=False,
            checked=checked)
        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(
            label='Verkaufsflächendichte im Planfall',
            style_file='standortkonkurrenz_verkaufsflaechendichte_planfall.qml',
            filter='nutzerdefiniert=-1 and auswahl!=0',
            expanded=False,
            checked=checked)
        output = ProjectLayer.from_table(self.centers.table,
                                         groupname=group_name)
        output.draw(label='Veränderung der Verkaufsflächendichte im Planfall '
                    'gegenüber Nullfall',
                    style_file='standortkonkurrenz_entwicklung_'
                    'verkaufsflaechendichte.qml',
                    filter='nutzerdefiniert=-1 and auswahl!=0',
                    expanded=False,
                    checked=checked)