Beispiel #1
0
    def onGeoreference(self, evt):
        bbox = None
        dlg = wx.TextEntryDialog(
                self, _("Please specify bounding box for '%s' as 4 numbers\nFormat: 'north south east west'\n\nAlternatively you can create a world file (.wld) or (.tab) by an external GIS software") % config.files[ self.lc.GetFirstSelected() ][0],
                _('Georeference with bounding box'), '90 -90 180 -180')

        #dlg.SetValue("Python is the best!")

        if dlg.ShowModal() == wx.ID_OK:
            str = dlg.GetValue()
            str.replace(',','.')
            print str
            try:
                bbox = map(float, str.split())
            except:
                return
        
            # Delete the old temporary files
            if config.files[ self.lc.GetFirstSelected() ][2] != config.files[ self.lc.GetFirstSelected() ][0]:
                os.unlink(config.files[ self.lc.GetFirstSelected() ][2])
                
            filename = config.files[ self.lc.GetFirstSelected() ][0]
            from gdalpreprocess import singlefile
            filerecord = singlefile(filename, bbox)
            if filerecord:
                config.files[self.lc.GetFirstSelected() ] = filerecord
                self.lc.Refresh(False)
                config.bboxgeoref = True
            
        dlg.Destroy()
Beispiel #2
0
	def onGeoreference(self, evt):
		bbox = None
		dlg = wx.TextEntryDialog(
				self, _("Please specify bounding box for '%s' as 4 numbers\nFormat: 'north south east west'\n\nAlternatively you can create a world file (.wld) or (.tab) by an external GIS software") % config.files[ self.lc.GetFirstSelected() ][0],
				_('Georeference with bounding box'), '90 -90 180 -180')

		#dlg.SetValue("Python is the best!")

		if dlg.ShowModal() == wx.ID_OK:
			str = dlg.GetValue()
			str.replace(',','.')
			print str
			try:
				bbox = map(float, str.split())
			except:
				return
		
			# Delete the old temporary files
			if config.files[ self.lc.GetFirstSelected() ][2] != config.files[ self.lc.GetFirstSelected() ][0]:
				os.unlink(config.files[ self.lc.GetFirstSelected() ][2])
				
			filename = config.files[ self.lc.GetFirstSelected() ][0]
			from gdalpreprocess import singlefile
			filerecord = singlefile(filename, bbox)
			if filerecord:
				config.files[self.lc.GetFirstSelected() ] = filerecord
				self.lc.Refresh(False)
				config.bboxgeoref = True
			
		dlg.Destroy()
Beispiel #3
0
	def _add(self, filename):
		filename = filename.encode('utf8')
		
		if len(config.files) > 0:
			wx.MessageBox(_("""Unfortunately the merging of files is not yet implemented in the MapSlicer GUI. Only the first file in the list is going to be rendered."""), _("Not yet implemented :-("), wx.ICON_ERROR)

		filerecord = gdalpreprocess.singlefile(filename)
		if filerecord:
			config.files = []
			config.files.append(filerecord)
Beispiel #4
0
    def _add(self, filename):
        filename = filename.encode('utf8')

        if len(config.files) > 0:
            wx.MessageBox(
                _("""Unfortunately the merging of files is not yet implemented in the MapSlicer GUI. Only the first file in the list is going to be rendered."""
                  ), _("Not yet implemented :-("), wx.ICON_ERROR)

        filerecord = gdalpreprocess.singlefile(filename)
        if filerecord:
            config.files = []
            config.files.append(filerecord)
Beispiel #5
0
    def _add(self, filename):

        if len(config.files) > 0:
            wx.MessageBox(_("""Unfortunately the merging of files is not yet implemented in the MapTiler GUI. Only the first file in the list is going to be rendered."""), _("Not yet implemented :-("), wx.ICON_ERROR)
        
        filename = filename.encode('utf8')
        from gdalpreprocess import singlefile
        filerecord = singlefile(filename)
        if filename:
            config.files = []
            config.files.append(filerecord)
        
            self.lc.SetItemCount(len(config.files))
            self.lc.Refresh(False)
            if len(config.files):
                self.bdel.Enable()
            self.resume = False
Beispiel #6
0
	def _add(self, filename):

		if len(config.files) > 0:
			wx.MessageBox(_("""Unfortunately the merging of files is not yet implemented in the MapTiler GUI. Only the first file in the list is going to be rendered."""), _("Not yet implemented :-("), wx.ICON_ERROR)
		
		filename = filename.encode('utf8')
		from gdalpreprocess import singlefile
		filerecord = singlefile(filename)
		if filename:
			config.files = []
			config.files.append(filerecord)
		
			self.lc.SetItemCount(len(config.files))
			self.lc.Refresh(False)
			if len(config.files):
				self.bdel.Enable()
			self.resume = False
Beispiel #7
0
	def _add(self, filename):

		if len(config.files) > 0:
			wx.MessageBox(_("""Unfortunately the merging of files is not yet implemented in the MapSlicer GUI. Only the first file in the list is going to be rendered."""), _("Not yet implemented"), wx.ICON_ERROR)

		filename = filename.encode('utf8')

		try:
			filerecord = gdalpreprocess.singlefile(filename)
			if filename:
				config.files = []
				config.files.append(filerecord)

				self.lc.SetItemCount(len(config.files))
				self.lc.Refresh(False)
				if len(config.files):
					self.bdel.Enable()
				self.resume = False
		except gdalpreprocess.PreprocessError, e:
			wx.MessageBox(str(e), _("Can't add a file"), wx.ICON_ERROR)
Beispiel #8
0
    def _add(self, filename):

        if len(config.files) > 0:
            wx.MessageBox(
                _("""Unfortunately the merging of files is not yet implemented in the MapSlicer GUI. Only the first file in the list is going to be rendered."""
                  ), _("Not yet implemented"), wx.ICON_ERROR)

        filename = filename.encode('utf8')

        try:
            filerecord = gdalpreprocess.singlefile(filename)
            if filename:
                config.files = []
                config.files.append(filerecord)

                self.lc.SetItemCount(len(config.files))
                self.lc.Refresh(False)
                if len(config.files):
                    self.bdel.Enable()
                self.resume = False
        except gdalpreprocess.PreprocessError, e:
            wx.MessageBox(str(e), _("Can't add a file"), wx.ICON_ERROR)