Skip to content

Instantly share code, notes, and snippets.

View jef-n's full-sized avatar

Jürgen Fischer jef-n

  • norBIT GmbH
  • East Frisia
View GitHub Profile
diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp
index a1ecaa2..8c8d3e8 100644
--- a/src/providers/postgres/qgspostgresprovider.cpp
+++ b/src/providers/postgres/qgspostgresprovider.cpp
@@ -1949,7 +1949,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
}
for ( int i = 0; i < fieldId.size(); i++ )
- params << paramValue( attributevec[ fieldId[i] ].toString(), defaultValues[i] );
+ params << paramValue( attributevec.value( fieldId[i], defaultValues[i] ).toString(), defaultValues[i] );
diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp
index fd6ef38..dbaa30d 100644
--- a/src/app/qgisapp.cpp
+++ b/src/app/qgisapp.cpp
@@ -265,8 +265,6 @@ class QTreeWidgetItem;
const int BEFORE_RECENT_PATHS = 123;
const int AFTER_RECENT_PATHS = 321;
-
-
diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp
index e2b8219..8b5d267 100755
--- a/src/providers/postgres/qgspostgresprovider.cpp
+++ b/src/providers/postgres/qgspostgresprovider.cpp
@@ -538,7 +538,7 @@ void QgsPostgresProvider::select( QgsAttributeList fetchAttributes, QgsRectangle
{
qBox = QString( "setsrid('BOX3D(%1)'::box3d,%2)" )
.arg( rect.asWktCoordinates() )
- .arg( mDetectedSrid );
+ .arg( mRequestedSrid );
From b3101d96bca779e9809a089ae7a890d44c667be0 Mon Sep 17 00:00:00 2001
From: "Juergen E. Fischer" <jef@norbit.de>
Date: Thu, 19 Jan 2012 21:35:28 +0100
Subject: [PATCH] postgres provider: support tables with mixed srids
---
src/providers/postgres/qgspgtablemodel.cpp | 9 +++++++--
src/providers/postgres/qgspostgresconn.cpp | 13 +++++++++----
src/providers/postgres/qgspostgresconn.h | 2 +-
src/providers/postgres/qgspostgresdataitems.cpp | 14 ++++++++++----
def pbnPlay(self):
self.slider.setRange(0, 100)
self.slider.setValue(0)
self.timer = QTimer()
self.timer.timeout.connect(self.stepForward)
self.timer.start(1000)
def stepForward(self):
self.slider.setValue( self.slider.value() + 1 )
if self.slider.value() >= self.slider.maximum():
@jef-n
jef-n / gist:1709985
Created January 31, 2012 11:21
SIP 4.13.1 fix
--- ../orig/sip4-4.13.1/sipgen/parser.y 2011-12-19 13:29:28.000000000 +0100
+++ sipgen/parser.y 2012-02-03 22:05:25.810230624 +0100
@@ -792,7 +792,8 @@ exception: TK_EXCEPTION scopedname base
/* Complete the definition. */
xd->iff->module = currentModule;
- appendCodeBlock(&xd->iff->hdrcode, $5.type_header_code);
+ if( $5.token == TK_TYPEHEADERCODE )
+ appendCodeBlock(&xd->iff->hdrcode, $5.type_header_code);
xd->pyname = pyname;
diff --git a/src/core/qgsapplication.cpp b/src/core/qgsapplication.cpp
index 32f3eaf..a37fd18a 100644
--- a/src/core/qgsapplication.cpp
+++ b/src/core/qgsapplication.cpp
@@ -47,7 +47,7 @@ QString ABISYM( QgsApplication::mLibraryPath );
QString ABISYM( QgsApplication::mLibexecPath );
QString ABISYM( QgsApplication::mThemeName );
QStringList ABISYM( QgsApplication::mDefaultSvgPaths );
-QString ABISYM( QgsApplication::mConfigPath ) = QDir::homePath() + QString( "/.qgis/" );
+QString ABISYM( QgsApplication::mConfigPath );
@jef-n
jef-n / gist:1996329
Created March 7, 2012 21:22
better support for wfxext:replace
Index: ogr/ogrsf_frmts/nas/nashandler.cpp
===================================================================
--- ogr/ogrsf_frmts/nas/nashandler.cpp (revision 24046)
+++ ogr/ogrsf_frmts/nas/nashandler.cpp (working copy)
@@ -1,7 +1,7 @@
/**********************************************************************
- * $Id: gmlhandler.cpp 13760 2008-02-11 17:48:30Z warmerdam $
+ * $Id$
*
- * Project: GML Reader
const char *axis0 = OSRGetAxis( mCRS, mGeoFlag ? "GEOGCS" : "PROJCS", 0, &orientation );
mAxisInverted = mGeoFlag
? (orientation == OAO_East || orientation == OAO_West || orientation == OAO_Other )
: (orientation == OAO_North || orientation == OAO_South );
diff --git a/src/core/qgsdistancearea.cpp b/src/core/qgsdistancearea.cpp
index 269e0ae..bbcb5d5 100644
@@ -808,14 +808,22 @@ QString QgsDistanceArea::textUnit( double value, int decimals, QGis::UnitType u,
case QGis::Feet:
if ( isArea )
{
- if ( keepBaseUnit || qAbs( value ) <= ( 528.0*528.0 ) )
+ if ( keepBaseUnit || qAbs( value ) <= 0.5*43560.0 )
{
+ // < 0.5 acre show sq ft