Skip to content
Permalink
Browse files

Merge branch 'master' into delimited_text_bug_fixes_2

  • Loading branch information
ccrook committed May 1, 2013
2 parents 1fb1c9c + 3c68312 commit 78f511078b918b08c1993a34f2ac6b01735b8b38
Showing with 5,150 additions and 3,585 deletions.
  1. +1 −0 doc/AUTHORS
  2. +32 −32 doc/TRANSLATORS
  3. +4,040 −3,060 i18n/qgis_sv.ts
  4. +28 −33 python/console/console_editor.py
  5. +1 −3 python/console/console_sci.py
  6. +10 −0 python/core/composer/qgscomposeritem.sip
  7. +12 −0 python/core/composer/qgscomposermap.sip
  8. +30 −5 python/core/qgsmaprenderer.sip
  9. +0 −3 python/core/raster/qgsrasterbandstats.sip
  10. +1 −4 python/core/raster/qgsrasterdataprovider.sip
  11. +0 −10 python/core/raster/qgsrasteriterator.sip
  12. +3 −2 python/core/raster/qgsrasterlayer.sip
  13. +3 −3 python/core/raster/qgsrasternuller.sip
  14. +0 −15 python/core/raster/qgsrasterprojector.sip
  15. +16 −17 python/core/raster/qgsrasterviewport.sip
  16. +1 −1 python/gui/qgsrasterlayersaveasdialog.sip
  17. +1 −1 python/plugins/sextante/gui/AutofillDialog.py
  18. +15 −2 python/plugins/sextante/modeler/ModelerDialog.py
  19. +23 −0 src/app/composer/qgscomposermapwidget.cpp
  20. +2 −0 src/app/composer/qgscomposermapwidget.h
  21. +4 −4 src/app/legend/qgslegend.cpp
  22. +5 −2 src/app/qgisapp.cpp
  23. +26 −8 src/app/qgsdiagramproperties.cpp
  24. +2 −2 src/app/qgsmaptoolmovefeature.cpp
  25. +2 −2 src/app/qgsmaptoolrotatefeature.cpp
  26. +1 −1 src/app/qgsrasterlayerproperties.cpp
  27. +63 −7 src/core/composer/qgscomposermap.cpp
  28. +13 −0 src/core/composer/qgscomposermap.h
  29. +1 −1 src/core/diagram/qgshistogramdiagram.cpp
  30. +4 −1 src/core/qgsfeaturestore.h
  31. +23 −6 src/core/qgsmaprenderer.cpp
  32. +30 −5 src/core/qgsmaprenderer.h
  33. +0 −43 src/core/qgsvectordataprovider.h
  34. +18 −1 src/core/qgsvectorfilewriter.cpp
  35. +3 −0 src/core/qgsvectorfilewriter.h
  36. +1 −1 src/core/raster/qgshuesaturationfilter.cpp
  37. +4 −10 src/core/raster/qgsrasterbandstats.h
  38. +3 −2 src/core/raster/qgsrasterblock.cpp
  39. +2 −2 src/core/raster/qgsrasterdataprovider.cpp
  40. +4 −3 src/core/raster/qgsrasterdataprovider.h
  41. +2 −11 src/core/raster/qgsrasterdrawer.cpp
  42. +5 −43 src/core/raster/qgsrasterfilewriter.cpp
  43. +8 −5 src/core/raster/qgsrasterfilewriter.h
  44. +0 −1 src/core/raster/qgsrasterinterface.cpp
  45. +1 −9 src/core/raster/qgsrasteriterator.cpp
  46. +12 −11 src/core/raster/qgsrasteriterator.h
  47. +39 −33 src/core/raster/qgsrasterlayer.cpp
  48. +7 −6 src/core/raster/qgsrasterlayer.h
  49. +54 −15 src/core/raster/qgsrasternuller.cpp
  50. +9 −6 src/core/raster/qgsrasternuller.h
  51. +7 −6 src/core/raster/qgsrasterprojector.h
  52. +17 −18 src/core/raster/qgsrasterviewport.h
  53. +4 −5 src/gui/qgsrasterlayersaveasdialog.cpp
  54. +2 −2 src/gui/qgsrasterlayersaveasdialog.h
  55. +5 −4 src/gui/qgsrubberband.cpp
  56. +1 −1 src/plugins/georeferencer/qgsgcpcanvasitem.cpp
  57. +2 −2 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  58. +6 −13 src/providers/gdal/qgsgdalprovider.cpp
  59. +0 −13 src/providers/gdal/qgsgdalprovider.h
  60. +1 −1 src/providers/grass/qgsgrassrasterprovider.cpp
  61. +1 −1 src/providers/ogr/qgsogrprovider.cpp
  62. +1 −1 src/providers/wcs/qgswcsprovider.cpp
  63. +5 −3 src/providers/wms/qgswmsprovider.cpp
  64. +22 −0 src/ui/qgscomposermapwidgetbase.ui
  65. +59 −76 src/ui/qgsdiagrampropertiesbase.ui
  66. +4 −1 src/ui/qgsoptionsbase.ui
  67. +2 −0 tests/src/core/CMakeLists.txt
  68. +154 −0 tests/src/core/testqgsblendmodes.cpp
  69. +103 −0 tests/src/core/testqgscomposereffects.cpp
  70. +36 −0 tests/src/core/testqgscomposermap.cpp
  71. +4 −1 tests/src/core/testqgsrasterfilewriter.cpp
  72. +3 −3 tests/src/core/testqgsrasterlayer.cpp
  73. +1 −0 tests/src/python/CMakeLists.txt
  74. +93 −0 tests/src/python/test_qgscomposereffects.py
  75. +51 −1 tests/src/python/test_qgscomposermap.py
  76. +1 −1 tests/src/python/test_qgsrasterlayer.py
  77. BIN tests/testdata/control_images/expected_composereffects/composereffect_blend.png
  78. BIN tests/testdata/control_images/expected_composereffects/composereffect_transparency.png
  79. BIN tests/testdata/control_images/expected_composermap/composermap_landsat_overview_blend.png
  80. BIN tests/testdata/control_images/expected_composermap/composermap_landsat_overview_invert.png
  81. BIN tests/testdata/control_images/expected_raster_blendmodes/expected_raster_blendmodes.png
  82. BIN tests/testdata/control_images/expected_vector_blendmodes/expected_vector_blendmodes.png
@@ -53,3 +53,4 @@ Dave DeHaan <dave.dehaan@sap.com>
Matthias Kuhn <matthias.kuhn at gmx.ch>
Salvatore Larosa <lrssvtml at gmail.com>
Nyall Dawson <nyall.dawson at gmail.com>
Vinayan Parameswaran <vinayan123 at gmail dot com>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -82,9 +82,6 @@ def __init__(self, parent=None):
# Enable non-ascii chars for editor
self.setUtf8(True)

#self.insertInitText()
self.setLexers()

# Set the default font
font = QFont()
font.setFamily('Courier')
@@ -102,7 +99,7 @@ def __init__(self, parent=None):
self.setMarginsBackgroundColor(QColor("#f9f9f9"))
self.setCaretLineVisible(True)
self.setCaretLineBackgroundColor(QColor("#fcf3ed"))

# Clickable margin 1 for showing markers
# self.setMarginSensitivity(1, True)
# self.connect(self,
@@ -172,6 +169,7 @@ def __init__(self, parent=None):
self.uncommentScut.activated.connect(self.parent.pc.uncommentCode)

def settingsEditor(self):
# Set Python lexer
self.setLexers()
threshold = self.settings.value("pythonConsole/autoCompThresholdEditor", 2).toInt()[0]
radioButtonSource = self.settings.value("pythonConsole/autoCompleteSourceEditor", 'fromAPI').toString()
@@ -209,6 +207,9 @@ def setLexers(self):
from qgis.core import QgsApplication

self.lexer = QsciLexerPython()
self.lexer.setIndentationWarning(QsciLexerPython.Inconsistent)
self.lexer.setFoldComments(True)
self.lexer.setFoldQuotes(True)

loadFont = self.settings.value("pythonConsole/fontfamilytextEditor", "Monospace").toString()
fontSize = self.settings.value("pythonConsole/fontsizeEditor", 10).toInt()[0]
@@ -257,6 +258,7 @@ def get_end_pos(self):
def contextMenuEvent(self, e):
menu = QMenu(self)
iconRun = QgsApplication.getThemeIcon("console/iconRunConsole.png")
iconRunScript = QgsApplication.getThemeIcon("console/iconRunScriptConsole.png")
iconCodePad = QgsApplication.getThemeIcon("console/iconCodepadConsole.png")
iconNewEditor = QgsApplication.getThemeIcon("console/iconTabEditorConsole.png")
iconCommentEditor = QgsApplication.getThemeIcon("console/iconCommentEditorConsole.png")
@@ -274,7 +276,7 @@ def contextMenuEvent(self, e):
runSelected = menu.addAction(iconRun,
"Enter selected",
self.runSelectedCode, 'Ctrl+E')
runScript = menu.addAction(iconRun,
runScript = menu.addAction(iconRunScript,
"Run Script",
self.runScriptCode, 'Shift+Ctrl+E')
menu.addSeparator()
@@ -343,18 +345,13 @@ def objectListEditor(self):
else:
listObj.show()
self.parent.pc.objectListButton.setChecked(True)

def codepad(self):
import urllib2, urllib
listText = self.selectedText().split('\n')
getCmd = []
for strLine in listText:
if strLine != "":
#if s[0:3] in (">>>", "..."):
# filter for special command (_save,_clear) and comment
if strLine[4] != "_" and strLine[:2] != "##":
strLine.replace(">>> ", "").replace("... ", "")
getCmd.append(unicode(strLine))
getCmd.append(unicode(strLine))
pasteText= u"\n".join(getCmd)
url = 'http://codepad.org'
values = {'lang' : 'Python',
@@ -387,32 +384,24 @@ def commentEditorCode(self, commentCheck):
if self.hasSelectedText():
startLine, _, endLine, _ = self.getSelection()
for line in range(startLine, endLine + 1):
selCmd = self.text(line)
self.setSelection(line, 0, line, selCmd.length())
self.removeSelectedText()
if commentCheck:
self.insert('#' + selCmd)
self.setCursorPosition(endLine, selCmd.length())
self.insertAt('#', line, 0)
else:
if selCmd.startsWith('#'):
self.insert(selCmd[1:])
else:
self.insert(selCmd)
self.setCursorPosition(endLine, self.text(line).length() - 1)
if not self.text(line).trimmed().startsWith('#'):
continue
self.setSelection(line, self.indentation(line),
line, self.indentation(line) + 1)
self.removeSelectedText()
else:
line, pos = self.getCursorPosition()
selCmd = self.text(line)
self.setSelection(line, 0, line, selCmd.length())
self.removeSelectedText()
if commentCheck:
self.insert('#' + selCmd)
self.setCursorPosition(line, selCmd.length())
self.insertAt('#', line, 0)
else:
if selCmd.startsWith('#'):
self.insert(selCmd[1:])
else:
self.insert(selCmd)
self.setCursorPosition(line, self.text(line).length() - 1)
if not self.text(line).trimmed().startsWith('#'):
return
self.setSelection(line, self.indentation(line),
line, self.indentation(line) + 1)
self.removeSelectedText()
self.endUndoAction()

def createTempFile(self):
@@ -430,7 +419,13 @@ def _runSubProcess(self, filename, tmp=False):
if dir not in sys.path:
sys.path.append(dir)
try:
p = subprocess.Popen(['python', str(filename)], shell=False, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
## set creationflags for runnning command without shell window
if sys.platform.startswith('win'):
p = subprocess.Popen(['python', str(filename)], shell=False, stdin=subprocess.PIPE,
stderr=subprocess.PIPE, stdout=subprocess.PIPE, creationflags=0x08000000)
else:
p = subprocess.Popen(['python', str(filename)], shell=False, stdin=subprocess.PIPE,
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
out, _traceback = p.communicate()

## Fix interrupted system call on OSX
@@ -73,9 +73,6 @@ def __init__(self, parent=None):
# Current line visible with special background color
self.setCaretWidth(2)

# Set Python lexer
self.setLexers()

self.settingsShell()

# Don't want to see the horizontal scrollbar at all
@@ -110,6 +107,7 @@ def __init__(self, parent=None):
self.completion_list_selected)

def settingsShell(self):
# Set Python lexer
self.setLexers()
threshold = self.settings.value("pythonConsole/autoCompThreshold", 2).toInt()[0]
self.setAutoCompletionThreshold(threshold)
@@ -305,6 +305,16 @@ class QgsComposerItem: QObject, QGraphicsRectItem
@note there is not setter since one can't manually set the id*/
QString uuid() const;

/** Gets the background color for this item
* @note introduced in 2.0
*/
const QColor backgroundColor() const;

/** Sets the background color for this item
* @note introduced in 2.0
*/
void setBackgroundColor( const QColor& backgroundColor );

/* Returns the current blending mode for the composer item
@note added in version 1.9*/
const QPainter::CompositionMode blendMode() const;
@@ -278,6 +278,18 @@ class QgsComposerMap : QgsComposerItem
void setOverviewFrameMapSymbol( QgsFillSymbolV2* symbol /Transfer/ );
QgsFillSymbolV2* overviewFrameMapSymbol();

/* Returns the blending mode for the overview frame
@note added in version 1.9*/
const QPainter::CompositionMode overviewBlendMode() const;
/* Sets the blending mode for the overview frame
@note added in version 1.9*/
void setOverviewBlendMode( const QPainter::CompositionMode blendMode );

/**Sets flag if overview frame should be inverted
@note this function was added in version 1.9*/
void setOverviewInverted( bool inverted );
bool overviewInverted() const;

/**Sets mId to a number not yet used in the composition. mId is kept if it is not in use.
Usually, this function is called before adding the composer map to the composition*/
void assignFreeId();
@@ -152,19 +152,44 @@ class QgsMapRenderer : QObject
QSize outputSize();
QSizeF outputSizeF();

//! transform extent in layer's CRS to extent in output CRS
/**
* @brief transform bounding box from layer's CRS to output CRS
* @see layerToMapCoordinates( QgsMapLayer* theLayer, QgsRectangle rect ) if you want to transform a rectangle
* @return a bounding box (aligned rectangle) containing the transformed extent
*/
QgsRectangle layerExtentToOutputExtent( QgsMapLayer* theLayer, QgsRectangle extent );

//! transform extent in output CRS to extent in layer's CRS
/**
* @brief transform bounding box from output CRS to layer's CRS
* @see mapToLayerCoordinates( QgsMapLayer* theLayer,QgsRectangle rect ) if you want to transform a rectangle
* @return a bounding box (aligned rectangle) containing the transformed extent
*/
QgsRectangle outputExtentToLayerExtent( QgsMapLayer* theLayer, QgsRectangle extent );

//! transform coordinates from layer's CRS to output CRS
/**
* @brief transform point coordinates from layer's CRS to output CRS
* @return the transformed point
*/
QgsPoint layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint point );

//! transform coordinates from output CRS to layer's CRS
/**
* @brief transform rectangle from layer's CRS to output CRS
* @see layerExtentToOutputExtent() if you want to transform a bounding box
* @return the transformed rectangle
*/
QgsRectangle layerToMapCoordinates( QgsMapLayer* theLayer, QgsRectangle rect );

/**
* @brief transform point coordinates from output CRS to layer's CRS
* @return the transformed point
*/
QgsPoint mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint point );

//! transform rect's coordinates from output CRS to layer's CRS
/**
* @brief transform rectangle from output CRS to layer's CRS
* @see outputExtentToLayerExtent() if you want to transform a bounding box
* @return the transformed rectangle
*/
QgsRectangle mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRectangle rect );

//! sets whether to use projections for this layer set
@@ -27,9 +27,6 @@ class QgsRasterBandStats
/*! Compares region, size etc. not collected statistics */
bool contains( const QgsRasterBandStats &s ) const;

/** \brief The name of the band that these stats belong to. */
QString bandName;

/** \brief The gdal band number (starts at 1)*/
int bandNumber;

@@ -82,7 +82,7 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
virtual void setUserNoDataValue( int bandNo, QgsRasterRangeList noData );

/** Get list of user no data value ranges */
virtual QgsRasterRangeList userNoDataValue( int bandNo ) const;
virtual QgsRasterRangeList userNoDataValues( int bandNo ) const;

virtual QList<QgsColorRampShader::ColorRampItem> colorTable( int bandNo ) const;

@@ -181,9 +181,6 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
*/
virtual bool setNoDataValue( int bandNo, double noDataValue );

/**Returns the formats supported by create()*/
virtual QStringList createFormats() const;

/** Remove dataset*/
virtual bool remove();

@@ -4,16 +4,6 @@ class QgsRasterIterator
#include <qgsrasteriterator.h>
%End
public:
//Stores information about reading of a raster band. Columns and rows are in unsampled coordinates
struct RasterPartInfo
{
int currentCol;
int currentRow;
int nCols;
int nRows;
QgsRasterBlock *block;
QgsRasterProjector* prj; //raster projector (or 0 if no reprojection is done)
};

QgsRasterIterator( QgsRasterInterface* input );
~QgsRasterIterator();
@@ -190,7 +190,8 @@ class QgsRasterLayer : QgsMapLayer
QString providerType() const;

/** \brief Returns the number of raster units per each raster pixel. In a world file, this is normally the first row (without the sign) */
double rasterUnitsPerPixel();
double rasterUnitsPerPixelX();
double rasterUnitsPerPixelY();

/** \brief Mutator for contrast enhancement algorithm
* @param theAlgorithm Contrast enhancement algorithm
@@ -200,7 +201,7 @@ class QgsRasterLayer : QgsMapLayer
* @param theGenerateLookupTableFlag Generate llokup table. */


void setContrastEnhancementAlgorithm( QgsContrastEnhancement::ContrastEnhancementAlgorithm theAlgorithm,
void setContrastEnhancement( QgsContrastEnhancement::ContrastEnhancementAlgorithm theAlgorithm,
QgsRaster::ContrastEnhancementLimits theLimits = QgsRaster::ContrastEnhancementMinMax,
QgsRectangle theExtent = QgsRectangle(),
int theSampleSize = QgsRasterLayer::SAMPLE_SIZE,
@@ -21,10 +21,10 @@ class QgsRasterNuller : QgsRasterInterface

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height ) / Factory /;

void setNoData( QList<QgsRasterNuller::NoData> noData );
void setNoData( int bandNo, QgsRasterRangeList noData );

QList<QgsRasterNuller::NoData> noData() const;
QgsRasterRangeList noData( int bandNo ) const;

/** \brief Set output no data value. */
void setOutputNoData( double noData );
void setOutputNoDataValue( int bandNo, double noData );
};
@@ -50,21 +50,6 @@ class QgsRasterProjector : QgsRasterInterface
/** \brief set maximum source resolution */
void setMaxSrcRes( double theMaxSrcXRes, double theMaxSrcYRes );

/** get source extent */
QgsRectangle srcExtent();

/** get/set source width/height */
int srcRows();
int srcCols();
void setSrcRows( int theRows );
void setSrcCols( int theCols );

/** \brief Get source row and column indexes for current source extent and resolution */
void srcRowCol( int theDestRow, int theDestCol, int *theSrcRow, int *theSrcCol );

int dstRows() const;
int dstCols() const;

QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;
};

@@ -4,28 +4,27 @@ struct QgsRasterViewPort
%TypeHeaderCode
#include <qgsrasterviewport.h>
%End
/** \brief Coordinate (in output device coordinate system) of top left corner
* of the part of the raster that is to be rendered.*/
QgsPoint mTopLeftPoint;
/** \brief Coordinate (in output device coordinate system) of bottom right corner
* of the part of the raster that is to be rendered.*/
QgsPoint mBottomRightPoint;

// NOT IN MAP SPACE BUT DEVICE SPACE
/** \brief Coordinate (in geographic coordinate system) of top left corner of the part of the raster that
* is to be rendered.*/
QgsPoint topLeftPoint;
/** \brief Coordinate (in geographic coordinate system) of bottom right corner of the part of the raster that
* is to be rendered.*/
QgsPoint bottomRightPoint;
/** \brief Distance in map units from left edge to right edge for the part of the raster that
* is to be rendered.*/
/** \brief Width, number of columns to be rendered */
int mWidth;
/** \brief Distance in map units from bottom edge to top edge for the part of
* the raster that is to be rendered.*/
/** \brief Height, number of rows to be rendered */
int mHeight;

int drawableAreaXDim;
/** \brief Distance in map units from bottom edge to top edge for the part of the raster that
* is to be rendered.*/
int drawableAreaYDim;

// intersection of current map extent and layer extent
/** \brief Intersection of current map extent and layer extent */
QgsRectangle mDrawnExtent;

// Source coordinate system
/** \brief Source coordinate system */
QgsCoordinateReferenceSystem mSrcCRS;

// Target coordinate system
/** \brief Target coordinate system */
QgsCoordinateReferenceSystem mDestCRS;

};
@@ -46,7 +46,7 @@ class QgsRasterLayerSaveAsDialog : QDialog
QgsCoordinateReferenceSystem outputCrs();
QStringList createOptions() const;
QgsRectangle outputRectangle() const;
QList<QgsRasterNuller::NoData> noData() const;
QgsRasterRangeList noData() const;

QList< int > pyramidsList() const;
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const;

0 comments on commit 78f5110

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