소스 검색

wxGUI/profile: fix truncating values when exporting to csv (merge from trunk, https://trac.osgeo.org/grass/changeset/65508)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@65509 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 년 전
부모
커밋
635d54df63
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      gui/wxpython/wxplot/profile.py

+ 4 - 4
gui/wxpython/wxplot/profile.py

@@ -153,9 +153,9 @@ class ProfileFrame(BasePlotFrame):
                     insideRegion = False
                 # build string of coordinate points for r.profile
                 if self.coordstr == '':
-                    self.coordstr = '%d,%d' % (point[0], point[1])
+                    self.coordstr = '%f,%f' % (point[0], point[1])
                 else:
-                    self.coordstr = '%s,%d,%d' % (self.coordstr, point[0], point[1])
+                    self.coordstr = '%s,%f,%f' % (self.coordstr, point[0], point[1])
         
         if not insideRegion:
             GWarning(message = _("Not all points of profile lie inside computational region."),
@@ -176,7 +176,7 @@ class ProfileFrame(BasePlotFrame):
                                  parent = self,
                                  read = True,
                                  map = self.rasterList[0],
-                                 coordinates = '%d,%d' % (point[0],point[1]))
+                                 coordinates = '%f,%f' % (point[0], point[1]))
                 
                 val = ret.splitlines()[0].split('|')[3]
                 if val == None or val == '*':
@@ -368,7 +368,7 @@ class ProfileFrame(BasePlotFrame):
                     return
                 
                 for datapair in self.raster[r]['datalist']:
-                    fd.write('%d,%d\n' % (float(datapair[0]),float(datapair[1])))
+                    fd.write('%.6f,%.6f\n' % (float(datapair[0]),float(datapair[1])))
                 
                 fd.close()