Skip to content

Commit

Permalink
extend default field width in fTools Export/Add Geometry column to fix
Browse files Browse the repository at this point in the history
…#3500

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15739 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
alexbruy committed Apr 17, 2011
1 parent 8762db3 commit cbbb79f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/plugins/fTools/tools/doGeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,33 +829,33 @@ def checkGeometryFields( self, vlayer ):
plp = "Poly"
( found, index1 ) = self.checkForField( nameList, "AREA" )
if not found:
field = QgsField( "AREA", QVariant.Double, "double", 10, 6, self.tr("Polygon area") )
field = QgsField( "AREA", QVariant.Double, "double", 21, 6, self.tr("Polygon area") )
index1 = len( fieldList.keys() )
fieldList[ index1 ] = field
( found, index2 ) = self.checkForField( nameList, "PERIMETER" )

if not found:
field = QgsField( "PERIMETER", QVariant.Double, "double", 10, 6, self.tr("Polygon perimeter") )
field = QgsField( "PERIMETER", QVariant.Double, "double", 21, 6, self.tr("Polygon perimeter") )
index2 = len( fieldList.keys() )
fieldList[ index2 ] = field
elif geomType == QGis.Line:
plp = "Line"
(found, index1) = self.checkForField(nameList, "LENGTH")
if not found:
field = QgsField("LENGTH", QVariant.Double, "double", 10, 6, self.tr("Line length") )
field = QgsField("LENGTH", QVariant.Double, "double", 21, 6, self.tr("Line length") )
index1 = len(fieldList.keys())
fieldList[index1] = field
index2 = index1
else:
plp = "Point"
(found, index1) = self.checkForField(nameList, "XCOORD")
if not found:
field = QgsField("XCOORD", QVariant.Double, "double", 10, 6, self.tr("Point x coordinate") )
field = QgsField("XCOORD", QVariant.Double, "double", 21, 6, self.tr("Point x coordinate") )
index1 = len(fieldList.keys())
fieldList[index1] = field
(found, index2) = self.checkForField(nameList, "YCOORD")
if not found:
field = QgsField("YCOORD", QVariant.Double, "double", 10, 6, self.tr("Point y coordinate") )
field = QgsField("YCOORD", QVariant.Double, "double", 21, 6, self.tr("Point y coordinate") )
index2 = len(fieldList.keys())
fieldList[index2] = field
return (fieldList, index1, index2)
Expand Down

0 comments on commit cbbb79f

Please sign in to comment.