Sfoglia il codice sorgente

Create REF_POINTS file for i.image.2target module

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71073 15284696-431f-4ddb-bdfa-cd5b030d7da7
Yann Chemin 8 anni fa
parent
commit
b77b562728
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      gui/wxpython/iphoto2image/ip2i_manager.py

+ 9 - 0
gui/wxpython/iphoto2image/ip2i_manager.py

@@ -341,6 +341,12 @@ class GCP(MapFrame, ColumnSorterMixin):
                                    self.xymapset,
                                    'camera',
                                    self.camera),
+            'ref_points': os.path.join(self.grassdatabase,
+                                   self.xylocation,
+                                   self.xymapset,
+                                   'group',
+                                   self.xygroup,
+                                   'REF_POINTS'),
             'points': os.path.join(self.grassdatabase,
                                    self.xylocation,
                                    self.xymapset,
@@ -370,6 +376,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         # make a backup of the current points file if exists
         if os.path.exists(self.file['points']):
             shutil.copy(self.file['points'], self.file['points_bak'])
+            shutil.copy(self.file['points'], self.file['ref_points'])
             GMessage (_("A POINTS file exists, renaming it to POINTS_BAK"))
 
         #"""Make a POINTS file """
@@ -844,6 +851,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         # if event != None save also to backup file
         if event:
             shutil.copy(self.file['points'], self.file['points_bak'])
+            shutil.copy(self.file['points'], self.file['ref_points'])
             self._giface.WriteLog(
                 _('POINTS file saved for group <%s>') %
                 self.xygroup)
@@ -1117,6 +1125,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 # restore POINTS file from backup
                 if os.path.exists(self.file['points_bak']):
                     shutil.copy(self.file['points_bak'], self.file['points'])
+                    shutil.copy(self.file['points_bak'], self.file['ref_points'])
 
             if os.path.exists(self.file['points_bak']):
                 os.unlink(self.file['points_bak'])