-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged provider0_9-branch (r6844:6878) back to trunk.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6879 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
wonder
committed
Apr 11, 2007
1 parent
0a93d83
commit 5f75c23
Showing
55 changed files
with
2,072 additions
and
2,672 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
/** | ||
There are two possibilities how to use this class: | ||
1. static call to QgsVectorFileWriter::writeAsShapefile(...) which saves the whole vector layer | ||
2. create an instance of the class and issue calls to addFeature(...) | ||
|
||
Currently supports only writing to shapefiles, but shouldn't be a problem to add capability | ||
to support other OGR-writable formats. | ||
*/ | ||
class QgsVectorFileWriter | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsvectorfilewriter.h> | ||
#include <qgsfield.h> | ||
%End | ||
|
||
public: | ||
|
||
enum WriterError | ||
{ | ||
NoError = 0, | ||
ErrDriverNotFound, | ||
ErrCreateDataSource, | ||
ErrCreateLayer | ||
}; | ||
|
||
/** Write contents of vector layer to a shapefile */ | ||
static WriterError writeAsShapefile(QgsVectorLayer* layer, | ||
const QString& shapefileName, | ||
const QString& fileEncoding); | ||
|
||
|
||
/** create shapefile and initialize it */ | ||
QgsVectorFileWriter(const QString& shapefileName, | ||
const QString& fileEncoding, | ||
const QMap<int, QgsField>& fields, | ||
QGis::WKBTYPE geometryType, | ||
const QgsSpatialRefSys* srs); | ||
|
||
/** checks whether there were any errors in constructor */ | ||
WriterError hasError(); | ||
|
||
/** add feature to the currently opened shapefile */ | ||
bool addFeature(QgsFeature& feature); | ||
|
||
/** close opened shapefile for writing */ | ||
~QgsVectorFileWriter(); | ||
|
||
}; | ||
|
Oops, something went wrong.