5 changes: 0 additions & 5 deletions python/gui/symbology-ng/qgssymbollayerv2widget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,6 @@ class QgsSVGFillSymbolLayerWidget : QgsSymbolLayerV2Widget
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();

protected:
void insertIcons();
void updateOutlineIcon();
void updateParamGui();
};

//////////
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/Delaunay.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Delaunay triangulation"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
output = self.getOutputValue(self.OUTPUT)

Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/DensifyGeometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Simplified layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
useSelection = self.getParameterValue(self.USE_SELECTION)
vertices =self.getParameterValue(self.VERTICES)
Expand Down
2 changes: 0 additions & 2 deletions python/plugins/sextante/ftools/ExtentFromLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
settings = QSettings()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT_LAYER))
useSelection = self.getParameterValue(self.USE_SELECTION)
byFeature = self.getParameterValue(self.BY_FEATURE)
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/ExtractNodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value("/UI/encoding", "System").toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
output = self.getOutputValue(self.OUTPUT)

Expand Down
2 changes: 2 additions & 0 deletions python/plugins/sextante/ftools/FToolsAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from sextante.ftools.NearestNeighbourAnalysis import NearestNeighbourAnalysis

# data management tools
from sextante.ftools.ReprojectLayer import ReprojectLayer

# geometry tools
from sextante.ftools.Delaunay import Delaunay
Expand Down Expand Up @@ -79,6 +80,7 @@ def __init__(self):
BasicStatisticsNumbers(), NearestNeighbourAnalysis(),
MeanCoords(), LinesIntersection(), UniqueValues(), PointDistance(),
# data management
ReprojectLayer(),
# geometry
ExportGeometryInfo(), Centroids(), Delaunay(), VoronoiPolygons(),
SimplifyGeometries(), DensifyGeometries(), MultipartToSingleparts(),
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/LinesIntersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layerA = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT_A))
layerB = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT_B))
fieldA = self.getParameterValue(self.FIELD_A)
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/LinesToPolygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value("/UI/encoding", "System").toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
output = self.getOutputValue(self.OUTPUT)

Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/MeanCoords.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(MeanCoords.OUTPUT, "Result"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.POINTS))
weightField = self.getParameterValue(self.WEIGHT)
uniqueField = self.getParameterValue(self.UID)
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/MultipartToSingleparts.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
output = self.getOutputValue(self.OUTPUT)

Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/PolygonsToLines.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value("/UI/encoding", "System").toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
output = self.getOutputValue(self.OUTPUT)

Expand Down
90 changes: 90 additions & 0 deletions python/plugins/sextante/ftools/ReprojectLayer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
ReprojectLayer.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Alexander Bruy'
__date__ = 'October 2012'
__copyright__ = '(C) 2012, Alexander Bruy'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

import os.path

from PyQt4 import QtGui
from PyQt4.QtCore import *

from qgis.core import *

from sextante.core.GeoAlgorithm import GeoAlgorithm
from sextante.core.QGisLayers import QGisLayers
from sextante.core.SextanteLog import SextanteLog

from sextante.parameters.ParameterVector import ParameterVector
from sextante.parameters.ParameterCrs import ParameterCrs

from sextante.outputs.OutputVector import OutputVector

class ReprojectLayer(GeoAlgorithm):

INPUT = "INPUT"
TARGET_CRS = "TARGET_CRS"
OUTPUT = "OUTPUT"

def getIcon(self):
return QtGui.QIcon(os.path.dirname(__file__) + "/icons/reproject.png")

def defineCharacteristics(self):
self.name = "Reproject layer"
self.group = "Data management tools"

self.addParameter(ParameterVector(self.INPUT, "Input layer", ParameterVector.VECTOR_TYPE_ANY))
self.addParameter(ParameterCrs(self.TARGET_CRS, "Target CRS", "4326"))

self.addOutput(OutputVector(self.OUTPUT, "Reprojected layer"))

def processAlgorithm(self, progress):
layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
crsId = self.getParameterValue(self.TARGET_CRS)
targetCrs = QgsCoordinateReferenceSystem(int(crsId))

output = self.getOutputValue(self.OUTPUT)

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(layer.pendingFields(),
layer.wkbType(), targetCrs)

layer.select(layer.pendingAllAttributesList())

current = 0
total = 100.0 / float(layer.featureCount())

layerCrs = layer.crs()
crsTransform = QgsCoordinateTransform(layerCrs, targetCrs)

f = QgsFeature()
outFeat = QgsFeature()
while layer.nextFeature(f):
geom = f.geometry()
geom.transform(crsTransform)
outFeat.setGeometry(geom)
outFeat.setAttributeMap(f.attributeMap())
writer.addFeature(outFeat)

current += 1
progress.setPercentage(int(current * total))

del writer
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/SimplifyGeometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Simplified layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
useSelection = self.getParameterValue(self.USE_SELECTION)
tolerance =self.getParameterValue(self.TOLERANCE)
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/SinglePartsToMultiparts.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Output layer"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))
output = self.getOutputValue(self.OUTPUT)
fieldName = self.getParameterValue(self.FIELD)
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/SumLines.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Result"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

lineLayer = QGisLayers.getObjectFromUri(self.getParameterValue(self.LINES))
polyLayer = QGisLayers.getObjectFromUri(self.getParameterValue(self.POLYGONS))
lengthFieldName = self.getParameterValue(self.LEN_FIELD)
Expand Down
3 changes: 0 additions & 3 deletions python/plugins/sextante/ftools/VoronoiPolygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ def defineCharacteristics(self):
self.addOutput(OutputVector(self.OUTPUT, "Voronoi polygons"))

def processAlgorithm(self, progress):
settings = QSettings()
encoding = settings.value( "/UI/encoding", "System" ).toString()

layer = QGisLayers.getObjectFromUri(self.getParameterValue(self.INPUT))

output = self.getOutputValue(self.OUTPUT)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 17 additions & 16 deletions src/core/raster/qgsrasterblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CORE_EXPORT QgsRasterBlock
* @param theDataType raster data type
* @param theWidth width of data matrix
* @param theHeight height of data matrix
* @param theNoDataValue the value representing no data (NULL)
* @param theNoDataValue the value representing no data (NULL)
*/
QgsRasterBlock( DataType theDataType, int theWidth, int theHeight, double theNoDataValue = std::numeric_limits<double>::quiet_NaN() );

Expand All @@ -82,7 +82,7 @@ class CORE_EXPORT QgsRasterBlock
* @param theDataType raster data type
* @param theWidth width of data matrix
* @param theHeight height of data matrix
* @param theNoDataValue the value representing no data (NULL)
* @param theNoDataValue the value representing no data (NULL)
* @return true on success
*/
bool reset( DataType theDataType, int theWidth, int theHeight, double theNoDataValue = std::numeric_limits<double>::quiet_NaN() );
Expand Down Expand Up @@ -129,6 +129,7 @@ class CORE_EXPORT QgsRasterBlock

int dataTypeSize( int bandNo ) const
{
Q_UNUSED( bandNo );
return typeSize( mDataType );
}

Expand All @@ -153,7 +154,7 @@ class CORE_EXPORT QgsRasterBlock
*/
void setNoDataValue( double noDataValue ) { mNoDataValue = noDataValue; }

/** Test if value is nodata comparing to noDataValue
/** Test if value is nodata comparing to noDataValue
* @param value tested value
* @param noDataValue no data value
* @return true if value is nodata */
Expand All @@ -173,7 +174,7 @@ class CORE_EXPORT QgsRasterBlock
/** \brief Read a single value
* @param index data matrix index
* @return value */
double value( size_t index) const;
double value( size_t index ) const;

/** \brief Read a single color
* @param row row index
Expand All @@ -184,7 +185,7 @@ class CORE_EXPORT QgsRasterBlock
/** \brief Read a single value
* @param index data matrix index
* @return color */
QRgb color( size_t index) const;
QRgb color( size_t index ) const;

/** \brief Check if value at position is no data
* @param row row index
Expand Down Expand Up @@ -223,14 +224,14 @@ class CORE_EXPORT QgsRasterBlock
* @return true on success */
bool setColor( size_t index, QRgb color );

/** \brief Get pointer to data
/** \brief Get pointer to data
* @param row row index
* @param column column index
* @retun pointer to data
*/
char * bits( int row, int column );

/** \brief Get pointer to data
/** \brief Get pointer to data
* @param index data matrix index
* @retun pointer to data
*/
Expand All @@ -244,12 +245,12 @@ class CORE_EXPORT QgsRasterBlock

/** \brief Convert data to different type.
* @param destDataType dest data type
* @return true on success
* @return true on success
*/
bool convert( QgsRasterBlock::DataType destDataType );

QImage image() const;
bool setImage( const QImage * image );
QImage image() const;
bool setImage( const QImage * image );

/** \brief Test if value is within the list of ranges
* @param value value
Expand Down Expand Up @@ -285,11 +286,11 @@ class CORE_EXPORT QgsRasterBlock

private:

static QImage::Format imageFormat ( QgsRasterBlock::DataType theDataType );
static DataType dataType ( QImage::Format theFormat );
static QImage::Format imageFormat( QgsRasterBlock::DataType theDataType );
static DataType dataType( QImage::Format theFormat );


// Valid
// Valid
//bool isValid;

// Data type
Expand All @@ -298,11 +299,11 @@ class CORE_EXPORT QgsRasterBlock
// Data type size in bytes, to make bits() fast
int mTypeSize;

// Width
// Width
int mWidth;

// Height
int mHeight;
// Height
int mHeight;

// No data value
double mNoDataValue;
Expand Down