예제 #1
0
    def on_nodes_to_shapefile(self, event=None):
        """
        Export Network nodes data to shape file.
        """
        print 'on_nodes_to_shapefile'

        dirpath = self._net.parent.get_workdirpath()
        defaultFile = self._net.parent.get_rootfilename() + '.nodes.shp'
        wildcards_all = 'All files (*.*)|*.*|SHP files (*.shp)|*.shp'
        dlg = wx.FileDialog(
            None,
            message='Export nodes to shapefile',
            defaultDir=dirpath,
            # defaultFile=defaultFile,
            wildcard=wildcards_all,
            style=wx.SAVE | wx.CHANGE_DIR)
        if dlg.ShowModal() == wx.ID_OK:
            filepath = dlg.GetPath()

        else:
            return

        shapeformat.nodes_to_shapefile(self._net,
                                       filepath,
                                       log=self._mainframe.get_logger())
예제 #2
0
파일: wxgui.py 프로젝트: fieryzig/sumo
    def on_nodes_to_shapefile(self, event=None):
        """
        Export Network nodes data to shape file.
        """
        print 'on_nodes_to_shapefile'

        dirpath = self._net.parent.get_workdirpath()
        defaultFile = self._net.parent.get_rootfilename()+'.nodes.shp'
        wildcards_all = 'All files (*.*)|*.*|SHP files (*.shp)|*.shp'
        dlg = wx.FileDialog(None, message='Export nodes to shapefile',
                            defaultDir=dirpath, defaultFile=defaultFile,
                            wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR)
        if dlg.ShowModal() == wx.ID_OK:
            filepath = dlg.GetPath()

        else:
            return

        shapeformat.nodes_to_shapefile(self._net,
                                       filepath,
                                       log=self._mainframe.get_logger())