Skip to content

Commit

Permalink
Merge branch 'master' of github.com:qgis/Quantum-GIS
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed May 27, 2012
2 parents c1df626 + 4295a68 commit 23afa09
Show file tree
Hide file tree
Showing 26 changed files with 1,266 additions and 1,824 deletions.
2 changes: 1 addition & 1 deletion debian/compat.sid
@@ -1 +1 @@
8
9
2 changes: 1 addition & 1 deletion debian/compat.wheezy
@@ -1 +1 @@
8
9
1 change: 1 addition & 0 deletions debian/libqgis-dev.install
Expand Up @@ -2,3 +2,4 @@ usr/include/qgis/*
usr/lib/libqgis_core.so
usr/lib/libqgis_gui.so
usr/lib/libqgis_analysis.so
usr/lib/libqgis_networkanalysis.so
3 changes: 0 additions & 3 deletions debian/libqgis{QGIS_ABI}-dev.install

This file was deleted.

15 changes: 13 additions & 2 deletions debian/rules
Expand Up @@ -43,6 +43,8 @@ CMAKE_OPTS := \
-D QGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
-D WITH_APIDOC=TRUE

MAKEFLAGS += VERBOSE=YES

ifneq (,$(findstring $(DISTRIBUTION),"squeeze wheezy lucid maverick natty oneiric precise"))
CMAKE_OPTS += -D WITH_PYSPATIALITE=TRUE
endif
Expand All @@ -57,18 +59,27 @@ else
CMAKE_OPTS += -D WITH_GLOBE=TRUE
endif

ifneq (,$(findstring $(DISTRIBUTION),"wheezy sid"))
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
endif

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
CXXFLAGS += -O0
else
CFLAGS += -O2
CXXFLAGS += -O2
endif

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CMAKE_OPTS += -D CMAKE_BUILD_TYPE=Debug -D ENABLE_TESTS=TRUE
MAKEFLAGS += VERBOSE=YES
endif

ifneq (,$(findstring profile,$(DEB_BUILD_OPTIONS)))
Expand Down Expand Up @@ -99,7 +110,7 @@ debian/build/CMakeCache.txt: $(TEMPLATES) CMakeLists.txt
# Add here commands to configure the package.
[ -d debian/build ] || mkdir debian/build
[ ! -e CMakeCache.txt ] || rm CMakeCache.txt
cd debian/build; cmake $(CMAKE_OPTS) ../..
cd debian/build; CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake $(CMAKE_OPTS) ../..

build: build-stamp

Expand Down
2,105 changes: 1,118 additions & 987 deletions i18n/qgis_fr.ts

Large diffs are not rendered by default.

54 changes: 36 additions & 18 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -970,9 +970,15 @@ def intersect( self ):
int_sym = geom.symDifference( tmpGeom )
int_geom = QgsGeometry( int_com.difference( int_sym ) )
try:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
# Geometry list: prevents writing error
# in geometries of different types
# produced by the intersection
# fix #3549
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except:
FEATURE_EXCEPT = False
continue
Expand All @@ -999,9 +1005,11 @@ def intersect( self ):
int_sym = geom.symDifference( tmpGeom )
int_geom = QgsGeometry( int_com.difference( int_sym ) )
try:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except:
EATURE_EXCEPT = False
continue
Expand Down Expand Up @@ -1037,9 +1045,11 @@ def intersect( self ):
int_sym = geom.symDifference( tmpGeom )
int_geom = QgsGeometry( int_com.difference( int_sym ) )
try:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except:
FEATURE_EXCEPT = False
continue
Expand All @@ -1066,9 +1076,11 @@ def intersect( self ):
int_sym = geom.symDifference( tmpGeom )
int_geom = QgsGeometry( int_com.difference( int_sym ) )
try:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except:
FEATURE_EXCEPT = False
continue
Expand Down Expand Up @@ -1180,12 +1192,18 @@ def union( self ):
except Exception, err:
FEATURE_EXCEPT = False
else:
try:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except Exception, err:
FEATURE_EXCEPT = False
# Geometry list: prevents writing error
# in geometries of different types
# produced by the intersection
# fix #3549
gList = ftools_utils.getGeomType( geom.wkbType() )
if int_geom.wkbType() in gList:
try:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except Exception, err:
FEATURE_EXCEPT = False
else:
# this only happends if the bounding box
# intersects, but the geometry doesn't
Expand Down
21 changes: 6 additions & 15 deletions python/plugins/fTools/tools/doValidate.py
Expand Up @@ -50,14 +50,13 @@ def __createMarker(self, point):
self.__marker.setIconType(gui.QgsVertexMarker.ICON_X)
self.__marker.setPenWidth(3)

def setGeom(self, x, y):
def setGeom(self, p):
if not self.__marker is None:
self.reset()
point = QgsPoint(x, y)
if self.__marker is None:
self.__createMarker(point)
self.__createMarker(p)
else:
self.__marker.setCenter(point)
self.__marker.setCenter(p)

def reset(self):
if not self.__marker is None:
Expand Down Expand Up @@ -136,18 +135,12 @@ def zoomToError(self, curr, prev):
mc = self.iface.mapCanvas()
mc.zoomToPreviousExtent()

if mc.mapRenderer().hasCrsTransformEnabled():
ct = QgsCoordinateTransform( self.vlayer.crs(), mc.mapRenderer().destinationCrs() )
else:
ct = None

e = item.data(Qt.UserRole).toPyObject()

if type(e)==QgsPoint:
if not ct is None:
e = ct.transform( e )
e = mc.mapRenderer().layerToMapCoordinates( self.vlayer, e )

self.marker.setGeom(e.x(), e.y())
self.marker.setGeom(e)

rect = mc.extent()
rect.expand( 0.25, e )
Expand All @@ -160,9 +153,7 @@ def zoomToError(self, curr, prev):
if not ok or not self.vlayer.featureAtId( fid, ft, True):
return

rect = ft.geometry().boundingBox()
if not ct is None:
rect = ct.transformBoundingBox( rect )
rect = mc.mapRenderer().layerExtentToOutputExtent( self.vlayer, ft.geometry().boundingBox() )
rect.expand(1.05)

# Set the extent to our new rectangle
Expand Down
8 changes: 8 additions & 0 deletions python/plugins/fTools/tools/ftools_utils.py
Expand Up @@ -344,6 +344,14 @@ def getUniqueValuesCount( vlayer, fieldIndex, useSelection ):
count += 1
return count

def getGeomType(gT):
if gT == 3 or gT == 6:
gTypeListPoly = [ QGis.WKBPolygon, QGis.WKBMultiPolygon ]
return gTypeListPoly
elif gT == 2 or gT == 5:
gTypeListLine = [ QGis.WKBLineString, QGis.WKBMultiLineString ]
return gTypeListLine

def getShapesByGeometryType( baseDir, inShapes, geomType ):
outShapes = QStringList()
for fileName in inShapes:
Expand Down
4 changes: 1 addition & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -6176,10 +6176,9 @@ void QgisApp::showStatusMessage( QString theMessage )
statusBar()->showMessage( theMessage );
}

// Show the maptip using tooltip
void QgisApp::showMapTip()

{
/* Show the maptip using tooltip */
// Stop the timer while we look for a maptip
mpMapTipsTimer->stop();

Expand All @@ -6189,7 +6188,6 @@ void QgisApp::showMapTip()
QPoint myPointerPos = mMapCanvas->mouseLastXY();

// Make sure there is an active layer before proceeding

QgsMapLayer* mypLayer = mMapCanvas->currentLayer();
if ( mypLayer )
{
Expand Down
15 changes: 0 additions & 15 deletions src/app/qgshighlight.cpp
Expand Up @@ -69,11 +69,6 @@ void QgsHighlight::paintPoint( QPainter *p, QgsPoint point )
{
QPolygonF r( 5 );

if ( mLayer )
{
point = mMapCanvas->mapRenderer()->layerToMapCoordinates( mLayer, point );
}

double d = mMapCanvas->extent().width() * 0.005;
r[0] = toCanvasCoordinates( point + QgsVector( -d, -d ) ) - pos();
r[1] = toCanvasCoordinates( point + QgsVector( d, -d ) ) - pos();
Expand All @@ -90,11 +85,6 @@ void QgsHighlight::paintLine( QPainter *p, QgsPolyline line )

for ( int i = 0; i < line.size(); i++ )
{
if ( mLayer )
{
line[i] = mMapCanvas->mapRenderer()->layerToMapCoordinates( mLayer, line[i] );
}

polygon[i] = toCanvasCoordinates( line[i] ) - pos();
}

Expand All @@ -115,11 +105,6 @@ void QgsHighlight::paintPolygon( QPainter *p, QgsPolygon polygon )

for ( int j = 0; j < polygon[i].size(); j++ )
{
if ( mLayer )
{
polygon[i][j] = mMapCanvas->mapRenderer()->layerToMapCoordinates( mLayer, polygon[i][j] );
}

ring[ j ] = toCanvasCoordinates( polygon[i][j] ) - pos();
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmessageoutput.cpp
Expand Up @@ -67,7 +67,7 @@ void QgsMessageOutputConsole::showMessage( bool )
{
mMessage.replace( "<br>", "\n" );
mMessage.replace( "&nbsp;", " " );
mMessage.replace( QRegExp("<\/?[^>]+>"), "" );
mMessage.replace( QRegExp("</?[^>]+>"), "" );
}
QgsMessageLog::logMessage( mMessage, mTitle.isNull() ? QObject::tr( "Console" ) : mTitle );
emit destroyed();
Expand Down
12 changes: 7 additions & 5 deletions src/core/qgsvectorfilewriter.cpp
Expand Up @@ -21,6 +21,7 @@
#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsvectorfilewriter.h"

Expand Down Expand Up @@ -468,7 +469,7 @@ bool QgsVectorFileWriter::addFeature( QgsFeature& feature )
.arg( ogrField )
.arg( QMetaType::typeName( attrValue.type() ) )
.arg( attrValue.toString() );
QgsDebugMsg( mErrorMessage );
QgsMessageLog::logMessage( mErrorMessage, QObject::tr( "OGR" ) );
mError = ErrFeatureWriteFailed;
return false;
}
Expand All @@ -493,21 +494,21 @@ bool QgsVectorFileWriter::addFeature( QgsFeature& feature )

if ( !mGeom2 )
{
QgsDebugMsg( QString( "Failed to create empty geometry for type %1 (OGR error: %2)" ).arg( geom->wkbType() ).arg( CPLGetLastErrorMsg() ) );
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
mError = ErrFeatureWriteFailed;
QgsMessageLog::logMessage( mErrorMessage, QObject::tr( "OGR" ) );
OGR_F_Destroy( poFeature );
return false;
}

OGRErr err = OGR_G_ImportFromWkb( mGeom2, geom->asWkb(), geom->wkbSize() );
if ( err != OGRERR_NONE )
{
QgsDebugMsg( QString( "Failed to import geometry from WKB: %1 (OGR error: %2)" ).arg( err ).arg( CPLGetLastErrorMsg() ) );
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
mError = ErrFeatureWriteFailed;
QgsMessageLog::logMessage( mErrorMessage, QObject::tr( "OGR" ) );
OGR_F_Destroy( poFeature );
return false;
}
Expand All @@ -520,10 +521,10 @@ bool QgsVectorFileWriter::addFeature( QgsFeature& feature )
OGRErr err = OGR_G_ImportFromWkb( mGeom, geom->asWkb(), geom->wkbSize() );
if ( err != OGRERR_NONE )
{
QgsDebugMsg( QString( "Failed to import geometry from WKB: %1 (OGR error: %2)" ).arg( err ).arg( CPLGetLastErrorMsg() ) );
mErrorMessage = QObject::tr( "Feature geometry not imported (OGR error: %1)" )
.arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
mError = ErrFeatureWriteFailed;
QgsMessageLog::logMessage( mErrorMessage, QObject::tr( "OGR" ) );
OGR_F_Destroy( poFeature );
return false;
}
Expand All @@ -539,7 +540,8 @@ bool QgsVectorFileWriter::addFeature( QgsFeature& feature )
mErrorMessage = QObject::tr( "Feature creation error (OGR error: %1)" ).arg( QString::fromUtf8( CPLGetLastErrorMsg() ) );
mError = ErrFeatureWriteFailed;

QgsDebugMsg( mErrorMessage );
QgsMessageLog::logMessage( mErrorMessage, QObject::tr( "OGR" ) );

OGR_F_Destroy( poFeature );
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions src/crssync/main.cpp
Expand Up @@ -40,6 +40,9 @@ int main( int argc, char ** argv )
{
QgsApplication a( argc, argv, false );

if ( !QgsApplication::isRunningFromBuildDir() )
a.setPrefixPath( CMAKE_INSTALL_PREFIX, true );

std::cout << "Synchronizing CRS database with PROJ definitions." << std::endl;

CPLPushErrorHandler( showError );
Expand Down

0 comments on commit 23afa09

Please sign in to comment.