1 change: 1 addition & 0 deletions python/plugins/sextante/core/SextanteVectorWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(self, fileName, encoding, fields, geometryType, crs, options=None):
uri += "?crs=" + crs.authid()
self.memLayer = QgsVectorLayer(uri, self.fileName, "memory")
self.writer = self.memLayer.dataProvider()
# FIXME: addAttributes was deprecated and removed
self.writer.addAttributes(fields.values())
self.memLayer.updateFieldMap()
else:
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/sextante/gdal/warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def defineCharacteristics(self):
self.name = "Warp (reproject)"
self.group = "[GDAL] Projections"
self.addParameter(ParameterRaster(warp.INPUT, "Input layer", False))
self.addParameter(ParameterCrs(warp.SOURCE_SRS, "Source SRS (EPSG Code)", "4326"))
self.addParameter(ParameterCrs(warp.DEST_SRS, "Destination SRS (EPSG Code)", "4326"))
self.addParameter(ParameterCrs(warp.SOURCE_SRS, "Source SRS (EPSG Code)", "EPSG:4326"))
self.addParameter(ParameterCrs(warp.DEST_SRS, "Destination SRS (EPSG Code)", "EPSG:4326"))
self.addParameter(ParameterSelection(warp.METHOD, "Resampling method", warp.METHOD_OPTIONS))
self.addOutput(OutputRaster(warp.OUTPUT, "Output layer"))

Expand All @@ -60,9 +60,9 @@ def processAlgorithm(self, progress):
self.crs = QgsCoordinateReferenceSystem(int(srs))
commands = ["gdalwarp"]
commands.append("-s_srs")
commands.append("EPSG:" + str(self.getParameterValue(warp.SOURCE_SRS)))
commands.append(str(self.getParameterValue(warp.SOURCE_SRS)))
commands.append("-t_srs")
commands.append("EPSG:" + str(srs))
commands.append(str(srs))
commands.append("-r")
commands.append(warp.METHOD_OPTIONS[self.getParameterValue(warp.METHOD)])
commands.append("-of")
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/sextante/gui/CrsSelectionDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CrsSelectionDialog(QDialog):

def __init__(self):
QDialog.__init__(self)
self.epsg = None
self.authid = None
layout = QVBoxLayout()
self.selector = QgsProjectionSelector(self)
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Close)
Expand All @@ -44,9 +44,9 @@ def __init__(self):
self.connect(buttonBox, SIGNAL("rejected()"), self.cancelPressed)

def okPressed(self):
self.epsg = self.selector.selectedEpsg()
self.authid = self.selector.selectedAuthId()
self.close()

def cancelPressed(self):
self.epsg = None
self.close()
self.authid = None
self.close()
10 changes: 5 additions & 5 deletions python/plugins/sextante/gui/CrsSelectionPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CrsSelectionPanel(QtGui.QWidget):

def __init__(self, default):
super(CrsSelectionPanel, self).__init__(None)
self.epsg = default
self.authid = default
self.horizontalLayout = QtGui.QHBoxLayout(self)
self.horizontalLayout.setSpacing(2)
self.horizontalLayout.setMargin(0)
Expand All @@ -48,12 +48,12 @@ def __init__(self, default):
def showSelectionDialog(self):
dialog = CrsSelectionDialog()
dialog.exec_()
if dialog.epsg:
self.epsg = str(dialog.epsg)
if dialog.authid:
self.authid = str(dialog.authid)
self.setText()

def setText(self):
self.text.setText("EPSG:" + str(self.epsg))
self.text.setText(str(self.authid))

def getValue(self):
return self.epsg
return self.authid
4 changes: 2 additions & 2 deletions python/plugins/sextante/parameters/ParameterCrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

class ParameterCrs(Parameter):

def __init__(self, name="", description="", default = "4326"):
'''The value is the EPSG code of the CRS'''
def __init__(self, name="", description="", default = "EPSG:4326"):
'''The value is the auth id of the CRS'''
Parameter.__init__(self, name, description)
self.value = None
self.default = default
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/sextante/tests/qgis_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def __init__(self, canvas):
self.canvas = canvas
self.testRaster = QgsRasterLayer('data/raster', "raster")
self.testVector = QgsVectorLayer('data/vector', "vector", 'ogr')
QgsMapLayerRegistry.instance().addMapLayer(self.testRaster)
QgsMapLayerRegistry.instance().addMapLayer(self.testVector)
QgsMapLayerRegistry.instance().addMapLayers([self.testRaster,self.testVector])

self.statusBar = type('FakeStatusBar', (),
{'showMessage' : lambda _, m: None
Expand Down
1 change: 1 addition & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ TARGET_LINK_LIBRARIES(qgis_core
${GEOS_LIBRARY}
${GDAL_LIBRARY}
${SPATIALINDEX_LIBRARY}
${EXPAT_LIBRARY}
)

IF (WITH_INTERNAL_SPATIALITE)
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ADD_SUBDIRECTORY(sqlanywhere)
ADD_SUBDIRECTORY(roadgraph)
ADD_SUBDIRECTORY(zonal_statistics)
ADD_SUBDIRECTORY(georeferencer)
ADD_SUBDIRECTORY(gps_importer)

IF (WITH_SPATIALITE)
ADD_SUBDIRECTORY(offline_editing)
Expand All @@ -28,10 +29,6 @@ IF (GRASS_FOUND)
ADD_SUBDIRECTORY(grass)
ENDIF (GRASS_FOUND)

IF (EXPAT_FOUND)
ADD_SUBDIRECTORY(gps_importer)
ENDIF (EXPAT_FOUND)

IF (WITH_GLOBE)
ADD_SUBDIRECTORY(globe)
ENDIF (WITH_GLOBE)
Expand Down
7 changes: 2 additions & 5 deletions src/providers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ ADD_SUBDIRECTORY(gdal)
ADD_SUBDIRECTORY(mssql)
ADD_SUBDIRECTORY(ows)
ADD_SUBDIRECTORY(wcs)
ADD_SUBDIRECTORY(gpx)
ADD_SUBDIRECTORY(wfs)

IF (POSTGRES_FOUND)
ADD_SUBDIRECTORY(postgres)
Expand All @@ -21,11 +23,6 @@ IF (SPATIALITE_FOUND OR WITH_INTERNAL_SPATIALITE)
ADD_SUBDIRECTORY(spatialite)
ENDIF (SPATIALITE_FOUND OR WITH_INTERNAL_SPATIALITE)

IF (EXPAT_FOUND)
ADD_SUBDIRECTORY(gpx)
ADD_SUBDIRECTORY(wfs)
ENDIF (EXPAT_FOUND)

IF (GRASS_FOUND)
ADD_SUBDIRECTORY(grass)
ENDIF (GRASS_FOUND)