[SCM] qgis branch, master, updated. a2ee769957385f4e084c5e8b6ba178a8c877d1db

2012-03-20 Thread Alexander Bruy
The following commit has been merged in the master branch:
commit 3c7354e3d897bd9136a4312455bccd5b3b88ffc3
Author: Alexander Bruy alexander.b...@gmail.com
Date:   Thu Mar 1 13:02:00 2012 +0200

fix geometry column export when used calculation on ellipsoid

diff --git a/python/plugins/fTools/tools/doGeometry.py 
b/python/plugins/fTools/tools/doGeometry.py
index 560e6bf..978d786 100644
--- a/python/plugins/fTools/tools/doGeometry.py
+++ b/python/plugins/fTools/tools/doGeometry.py
@@ -508,37 +508,40 @@ class geometryThread( QThread ):
 return True
 
   def export_geometry_info( self ):
+ellips = None
+crs = None
+coordTransform = None
+
+# calculate with:
+# 0 - layer CRS
+# 1 - project CRS
+# 2 - ellipsoidal
+if self.myCalcType == 2:
+  settings = QSettings()
+  ellips = settings.value( /qgis/measure/ellipsoid, WGS84 ).toString()
+  crs = self.vlayer.crs().srsid()
+elif self.myCalcType == 1:
+  mapCRS = self.parent.iface.mapCanvas().mapRenderer().destinationCrs()
+  layCRS = self.vlayer.crs()
+  coordTransform = QgsCoordinateTransform( layCRS, mapCRS )
+
+inFeat = QgsFeature()
+outFeat = QgsFeature()
+inGeom = QgsGeometry()
+nElement = 0
+
+vprovider = self.vlayer.dataProvider()
+
+self.emit( SIGNAL( runStatus( PyQt_PyObject ) ), 0)
+self.emit( SIGNAL( runRange( PyQt_PyObject ) ), ( 0, 
vprovider.featureCount() ) )
+
 if self.writeShape:
-  vprovider = self.vlayer.dataProvider()
   allAttrs = vprovider.attributeIndexes()
   vprovider.select( allAttrs )
   ( fields, index1, index2 ) = self.checkGeometryFields( self.vlayer )
   writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
 vprovider.geometryType(), vprovider.crs() )
-  inFeat = QgsFeature()
-  outFeat = QgsFeature()
-  inGeom = QgsGeometry()
-  nFeat = vprovider.featureCount()
-  nElement = 0
-
-  # calculate with:
-  # 0 - layer CRS
-  # 1 - project CRS
-  # 2 - ellipsoidal
-  ellips = None
-  crs = None
-  coordTransform = None
-  if self.myCalcType == 2:
-settings = QSettings()
-ellips = settings.value( /qgis/measure/ellipsoid, WGS84 
).toString()
-crs = 
self.parent.iface.mapCanvas().mapRenderer().destinationCrs().srsid()
-  elif self.myCalcType == 1:
-mapCRS = self.parent.iface.mapCanvas().mapRenderer().destinationCrs()
-layCRS = self.vlayer.crs()
-coordTransform = QgsCoordinateTransform( layCRS, mapCRS )
-
-  self.emit( SIGNAL( runStatus( PyQt_PyObject ) ), 0)
-  self.emit( SIGNAL( runRange( PyQt_PyObject ) ), ( 0, nFeat ) )
+
   while vprovider.nextFeature(inFeat):
 self.emit( SIGNAL( runStatus( PyQt_PyObject ) ),  nElement )
 nElement += 1
@@ -546,6 +549,7 @@ class geometryThread( QThread ):
 
 if self.myCalcType == 1:
   inGeom.transform( coordTransform )
+
 ( attr1, attr2 ) = self.simpleMeasure( inGeom, self.myCalcType, 
ellips, crs )
 
 outFeat.setGeometry( inGeom )
@@ -558,34 +562,9 @@ class geometryThread( QThread ):
   return True
 else: # update existing file
   newFields = []
-  vprovider = self.vlayer.dataProvider()
   geomType = self.vlayer.geometryType()
   ( index1, index2 ) = self.findOrCreateFields()
 
-  inFeat = QgsFeature()
-  inGeom = QgsGeometry()
-  nFeat = vprovider.featureCount()
-  nElement = 0
-
-  # calculate with:
-  # 0 - layer CRS
-  # 1 - project CRS
-  # 2 - ellipsoidal
-  ellips = None
-  crs = None
-  coordTransform = None
-  if self.myCalcType == 2:
-settings = QSettings()
-ellips = settings.value( /qgis/measure/ellipsoid, WGS84 
).toString()
-crs = 
self.parent.iface.mapCanvas().mapRenderer().destinationCrs().srsid()
-  elif self.myCalcType == 1:
-mapCRS = self.parent.iface.mapCanvas().mapRenderer().destinationCrs()
-layCRS = self.vlayer.crs()
-coordTransform = QgsCoordinateTransform( layCRS, mapCRS )
-
-  self.emit( SIGNAL( runStatus( PyQt_PyObject ) ), 0)
-  self.emit( SIGNAL( runRange( PyQt_PyObject ) ), ( 0, nFeat ) )
-
   while vprovider.nextFeature(inFeat):
 self.emit( SIGNAL( runStatus( PyQt_PyObject ) ),  nElement )
 nElement += 1

-- 
The Quantum GIS in Debian project

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel


[SCM] qgis branch, master, updated. a2ee769957385f4e084c5e8b6ba178a8c877d1db

2012-03-20 Thread Alexander Bruy
The following commit has been merged in the master branch:
commit c89fec8e755ac262fb8c465b653419706440987c
Author: Alexander Bruy alexander.b...@gmail.com
Date:   Tue Mar 6 20:33:46 2012 +0200

[FEATURE] fTools: allow to calculate extent not only for whole layer but
for individual features too

diff --git a/python/plugins/fTools/tools/doGeometry.py 
b/python/plugins/fTools/tools/doGeometry.py
index 978d786..d4d3e72 100644
--- a/python/plugins/fTools/tools/doGeometry.py
+++ b/python/plugins/fTools/tools/doGeometry.py
@@ -81,7 +81,8 @@ class GeometryDialog( QDialog, Ui_Dialog ):
self.tr( Please specify valid UID field ) )
 else:
   self.outShape.clear()
-  self.geometry( self.inShape.currentText(), self.lineEdit.value(), 
self.cmbField.currentText() )
+  self.geometry( self.inShape.currentText(), self.lineEdit.value(),
+self.cmbField.currentText() )
 
   def outFile( self ):
 self.outShape.clear()
@@ -97,6 +98,9 @@ class GeometryDialog( QDialog, Ui_Dialog ):
 self.lblCalcType.setVisible( False )
 self.cmbCalcType.setVisible( False )
 
+self.chkUseSelection.setVisible( False )
+self.chkByFeatures.setVisible( False )
+
 self.chkWriteShapefile.setVisible( False )
 if self.myFunction == 1: # Singleparts to multipart
   self.setWindowTitle( self.tr( Singleparts to multipart ) )
@@ -167,6 +171,8 @@ class GeometryDialog( QDialog, Ui_Dialog ):
 self.label_3.setText( self.tr( Input layer ) )
 self.label.setVisible( False )
 self.lineEdit.setVisible( False )
+self.chkByFeatures.setVisible( True )
+self.chkUseSelection.setVisible( True )
   self.lblOutputShapefile.setText( self.tr( Output polygon shapefile ) )
 self.resize( 381, 100 )
 self.populateLayers()
@@ -229,7 +235,8 @@ class GeometryDialog( QDialog, Ui_Dialog ):
 self.buttonOk.setEnabled( False )
 self.testThread = geometryThread( self.iface.mainWindow(), self, 
self.myFunction,
   vlayer, myParam, myField, 
self.shapefileName, self.encoding,
-  self.cmbCalcType.currentIndex(), 
self.chkWriteShapefile.isChecked() )
+  self.cmbCalcType.currentIndex(), 
self.chkWriteShapefile.isChecked(),
+  self.chkByFeatures.isChecked(), 
self.chkUseSelection.isChecked() )
 QObject.connect( self.testThread, SIGNAL( runFinished( PyQt_PyObject ) 
), self.runFinishedFromThread )
 QObject.connect( self.testThread, SIGNAL( runStatus( PyQt_PyObject ) ), 
self.runStatusFromThread )
 QObject.connect( self.testThread, SIGNAL( runRange( PyQt_PyObject ) ), 
self.runRangeFromThread )
@@ -288,7 +295,8 @@ class GeometryDialog( QDialog, Ui_Dialog ):
 
 class geometryThread( QThread ):
   def __init__( self, parentThread, parentObject, function, vlayer, myParam,
-myField, myName, myEncoding, myCalcType, myNewShape ):
+myField, myName, myEncoding, myCalcType, myNewShape, 
myByFeatures,
+myUseSelection ):
 QThread.__init__( self, parentThread )
 self.parent = parentObject
 self.running = False
@@ -300,6 +308,8 @@ class geometryThread( QThread ):
 self.myEncoding = myEncoding
 self.myCalcType = myCalcType
 self.writeShape = myNewShape
+self.byFeatures = myByFeatures
+self.useSelection = myUseSelection
 
   def run( self ):
 self.running = True
@@ -319,7 +329,10 @@ class geometryThread( QThread ):
 elif self.myFunction == 8: # Delaunay triangulation
   success = self.delaunay_triangulation()
 elif self.myFunction == 9: # Polygon from layer extent
-  success = self.layer_extent()
+  if self.byFeatures:
+success = self.feature_extent()
+  else:
+success = self.layer_extent()
 elif self.myFunction == 10: # Voronoi Polygons
   success = self.voronoi_polygons()
 elif self.myFunction == 11: # Lines to polygons
@@ -860,6 +873,105 @@ class geometryThread( QThread ):
 
 return True
 
+  def feature_extent( self, ):
+vprovider = self.vlayer.dataProvider()
+vprovider.select( [] )
+
+self.emit( SIGNAL( runStatus( PyQt_PyObject ) ), 0 )
+
+fields = { 0 : QgsField( MINX, QVariant.Double ),
+   1 : QgsField( MINY, QVariant.Double ),
+   2 : QgsField( MAXX, QVariant.Double ),
+   3 : QgsField( MAXY, QVariant.Double ),
+   4 : QgsField( CNTX, QVariant.Double ),
+   5 : QgsField( CNTY, QVariant.Double ),
+   6 : QgsField( AREA, QVariant.Double ),
+   7 : QgsField( PERIM, QVariant.Double ),
+   8 : QgsField( HEIGHT, QVariant.Double ),
+   9 : QgsField( WIDTH, QVariant.Double ) }
+
+writer = QgsVectorFileWriter( self.myName, self.myEncoding, fields,
+  QGis.WKBPolygon, self.vlayer.crs() )
+inFeat

[SCM] qgis branch, master, updated. a2ee769957385f4e084c5e8b6ba178a8c877d1db

2012-03-20 Thread Alexander Bruy
The following commit has been merged in the master branch:
commit 91da6af5acf4ea09218a495a1ea85dc0ccae267e
Author: Alexander Bruy alexander.b...@gmail.com
Date:   Fri Mar 9 10:39:42 2012 +0200

fix #5097

diff --git a/python/plugins/fTools/tools/doMergeShapes.py 
b/python/plugins/fTools/tools/doMergeShapes.py
index fe600e0..a5a3b52 100644
--- a/python/plugins/fTools/tools/doMergeShapes.py
+++ b/python/plugins/fTools/tools/doMergeShapes.py
@@ -30,9 +30,11 @@ class Dialog( QDialog, Ui_Dialog ):
 QObject.connect( self.leOutShape, SIGNAL( editingFinished() ), 
self.updateOutFile )
 
   def inputDir( self ):
+settings = QSettings()
+lastDir = settings.value( /fTools/lastShapeDir, . ).toString()
 inDir = QFileDialog.getExistingDirectory( self,
   self.tr( Select directory with shapefiles to merge ),
-  . )
+  lastDir )
 
 if inDir.isEmpty():
   return
@@ -48,6 +50,8 @@ class Dialog( QDialog, Ui_Dialog ):
   self.inputFiles = None
   return
 
+settings.setValue( /fTools/lastShapeDir, inDir )
+
 self.progressFiles.setRange( 0, self.inputFiles.count() )
 self.leInputDir.setText( inDir )
 

-- 
The Quantum GIS in Debian project

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel


[SCM] qgis branch, master, updated. a2ee769957385f4e084c5e8b6ba178a8c877d1db

2012-03-20 Thread Alexander Bruy
The following commit has been merged in the master branch:
commit 9151fd583b5062a4e085bba70364cd3c0a0c4885
Author: Alexander Bruy alexander.b...@gmail.com
Date:   Thu Mar 15 15:15:21 2012 +0200

also count points that intersects polygon bounds (fix #5163)

diff --git a/python/plugins/fTools/tools/doPointsInPolygon.py 
b/python/plugins/fTools/tools/doPointsInPolygon.py
index 3e4ee3a..42e9686 100644
--- a/python/plugins/fTools/tools/doPointsInPolygon.py
+++ b/python/plugins/fTools/tools/doPointsInPolygon.py
@@ -141,7 +141,7 @@ class Dialog(QDialog, Ui_Dialog):
 for i in pointList:
 pointProvider.featureAtId( int( i ), inFeatB , True, 
allAttrs )
 tmpGeom = QgsGeometry( inFeatB.geometry() )
-if inGeom.contains(tmpGeom.asPoint()):
+if inGeom.intersects(tmpGeom.asPoint()):
 count = count + 1
 outFeat.setAttributeMap(atMap)
 outFeat.addAttribute(index, QVariant(count))

-- 
The Quantum GIS in Debian project

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel


[SCM] qgis tag, 1.7.5_20120320, created. final-1_7_1-247-gc936d03

2012-03-20 Thread Alexander Bruy
The tag, 1.7.5_20120320 has been created
at  c936d031ec77863c5fdef8feec9cacee4ecd143c (commit)

- Shortlog 
commit c936d031ec77863c5fdef8feec9cacee4ecd143c
Author: Alexander Bruy alexander.b...@gmail.com
Date:   Thu Mar 15 15:15:21 2012 +0200

also count points that intersects polygon bounds (fix #5163)
---

-- 
The Quantum GIS in Debian project

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel


[SCM] qgis branch, qgis.org-1.7, created. 2bf42287f9276602e80d489dda15d27c8faac206

2012-03-07 Thread Alexander Bruy
The branch, qgis.org-1.7 has been created
at  2bf42287f9276602e80d489dda15d27c8faac206 (commit)

- Shortlog 
commit 2bf42287f9276602e80d489dda15d27c8faac206
Author: pcav cavall...@faunalia.it
Date:   Thu Mar 1 16:17:21 2012 +0100

Adder option to r.mask GRASS module

commit a6634628f7f1b27ed614884f2480e1aa6745c087
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 18:22:54 2012 +0100

Adapting GRASS module list to previous changes

commit 9c62dfb14aeeec8fb95880ad6440e5e0a0e3cd64
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 18:22:14 2012 +0100

Simplify slope and aspect GRASS modules

commit b6df9e6e9160f265cbb17444289d2d8d16701edf
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 13:15:53 2012 +0100

Improved v.random GRASS module

commit 801b93a68c64acc5ef5c76f0949a6616319ae04f
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 11:37:33 2012 +0100

More options for the v.surf GRASS module

commit 2422ef5c81b280323bbc4db0c8d5f75d60d18b13
Author: Tim Sutton t...@linfiniti.com
Date:   Fri Feb 24 12:22:42 2012 +0200

Added some comments explaining how alpha works

commit 4b88ec35e3e78c6cbc0a58daa217d56d4d2a4228
Author: Sergey Yakushev yakush...@gmail.com
Date:   Fri Jan 6 01:21:38 2012 +0600

RoadGraph: fix runtime warnings

---

-- 
The Quantum GIS in Debian project

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel


[SCM] qgis branch, upstream, created. 2bf42287f9276602e80d489dda15d27c8faac206

2012-03-07 Thread Alexander Bruy
The branch, upstream has been created
at  2bf42287f9276602e80d489dda15d27c8faac206 (commit)

- Shortlog 
commit 2bf42287f9276602e80d489dda15d27c8faac206
Author: pcav cavall...@faunalia.it
Date:   Thu Mar 1 16:17:21 2012 +0100

Adder option to r.mask GRASS module

commit a6634628f7f1b27ed614884f2480e1aa6745c087
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 18:22:54 2012 +0100

Adapting GRASS module list to previous changes

commit 9c62dfb14aeeec8fb95880ad6440e5e0a0e3cd64
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 18:22:14 2012 +0100

Simplify slope and aspect GRASS modules

commit b6df9e6e9160f265cbb17444289d2d8d16701edf
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 13:15:53 2012 +0100

Improved v.random GRASS module

commit 801b93a68c64acc5ef5c76f0949a6616319ae04f
Author: pcav cavall...@faunalia.it
Date:   Fri Feb 24 11:37:33 2012 +0100

More options for the v.surf GRASS module

commit 2422ef5c81b280323bbc4db0c8d5f75d60d18b13
Author: Tim Sutton t...@linfiniti.com
Date:   Fri Feb 24 12:22:42 2012 +0200

Added some comments explaining how alpha works

commit 4b88ec35e3e78c6cbc0a58daa217d56d4d2a4228
Author: Sergey Yakushev yakush...@gmail.com
Date:   Fri Jan 6 01:21:38 2012 +0600

RoadGraph: fix runtime warnings

---

-- 
The Quantum GIS in Debian project

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel


[SCM] qgis tag, 1.7.4+1.7.5%7E20120305, created. final-1_7_1-234-g2bf4228

2012-03-07 Thread Alexander Bruy
The tag, 1.7.4+1.7.5%7E20120305 has been created
at  2bf42287f9276602e80d489dda15d27c8faac206 (commit)

- Shortlog 
commit 2bf42287f9276602e80d489dda15d27c8faac206
Author: pcav cavall...@faunalia.it
Date:   Thu Mar 1 16:17:21 2012 +0100

Adder option to r.mask GRASS module
---

-- 
The Quantum GIS in Debian project

___
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel