Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/Quantum-GIS

  • Loading branch information
timlinux committed May 27, 2012
2 parents c1df626 + 4295a68 commit 23afa094ce9438881db976441b4a08852679216b
@@ -1 +1 @@
8
9
@@ -1 +1 @@
8
9
@@ -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

This file was deleted.

@@ -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
@@ -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)))
@@ -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

Large diffs are not rendered by default.

@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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:
@@ -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 )
@@ -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
@@ -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:
@@ -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();

@@ -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 )
{
@@ -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();
@@ -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();
}

@@ -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();
}

@@ -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();
@@ -21,6 +21,7 @@
#include "qgsfeature.h"
#include "qgsgeometry.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsvectorfilewriter.h"

@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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 );

0 comments on commit 23afa09

Please sign in to comment.
You can’t perform that action at this time.