52 Commits

Author SHA1 Message Date
Nyall Dawson
1280779617 Don't force use of In,Out in QgsFeatureSink methods 2017-04-26 11:32:34 +10:00
Nyall Dawson
8d598337f3 QgsVectorFileWriter is a QgsFeatureSink 2017-04-26 11:32:34 +10:00
Nyall Dawson
26495dbd81 [processing] Move dataobjects.getSupportedOutputVectorLayerExtensions
to QgsVectorFileWriter
2017-04-03 15:41:32 +10:00
Denis Rouzaud
7812d4fb17 remove the-prefix from source code
this might result in variables having the same name as some methods
2017-02-21 18:14:58 +01:00
Nyall Dawson
95d000f662 [FEATURE] Background saving of vector layers
Switches the vector layer save operation to a background task
using the task manager framework. Allows layers to saved without
blocking the interface.
2017-02-13 08:30:29 +10:00
Nyall Dawson
02ea2d7703 Fix typos 2016-11-08 09:05:47 +10:00
Nyall Dawson
44289084e9 Optimise passing of variables by ref/value 2016-10-24 10:36:23 +10:00
Even Rouault
34894c6f5a [FEATURE] Vector layer save as: offer file/layer overwriting, new layer creation, feature and field appending
When saving a vector layer into an existing file, depending on the capabilities
of the output driver, the user can now decide whether:
- to overwrite the whole file
- to overwrite only the target layer (layer name is now configurable)
- to append features to the existing target layer
- to append features, add new fields if there are any.

All above is available for drivers like GPKG, SpatiaLite, FileGDB, ...
For drivers like Shapefile, MapInfo .tab, feature append is also available.
2016-10-13 11:38:41 +02:00
Nyall Dawson
9bc61e77c7 [processing] Create vector files using default dataset/layer options
Fixes missing CRS when saving to GML (fix #14544)
2016-08-12 07:01:04 +10:00
Juergen E. Fischer
0688621046 scripts/replacev2.sh run 2016-08-10 12:08:52 +02:00
Matthias Kuhn
bb79d13e82 Remove deprecated Qgis::WKBType and API cleanup (#3325)
* Remove deprecated Qgis::WKBType and API cleanup

Renames QgsWKBTypes to QgsWkbTypes

Replaces usage of the enums:

* Qgis::WKBType with QgsWkbTypes::Type
* Qgis::GeometryType with QgsWkbTypes::GeometryType

Their values should be forward compatible (a fact that was already
explited up to now by casting between the types)

Renames some SSLxxx to SslXxx and URIxxx to UriXxx

* Fix build warnings and simplify type handling

* Add a fixer to rewrite imports

* The forgotten rebase conflictThe forgotten rebase conflicts

* QgsDataSourcURI > QgsDataSourceUri

* QgsWKBTypes > QgsWkbTypes

* Qgis.WKBGeom > QgsWkbTypes.Geom

* Further python fixes

* Guess what... Qgis::wkbDimensions != QgsWkbTypes::wkbDimensions

* Fix tests

* Python 3 updates

* [travis] pull request caching cannot be disabled

so at least use it in r/w mode

* Fix python3 print in plugins
2016-08-04 09:10:08 +02:00
Nyall Dawson
f6b09eaee1 Add Distance*, Area*, Angle* prefixes to QgsUnitTypes enum values 2016-07-26 08:29:24 +10:00
Nyall Dawson
f6f5010131 Move QGis::UnitType to QgsUnitTypes::DistanceUnit
This change consolidates more unit handling and conversion into
QgsUnitTypes.

Additionally, UnknownUnit was renamed to UnknownDistanceUnit.
All methods which accepted QGis::UnitType parameters have been
updated to take QgsUnitTypes::DistanceUnit instead.

ALso remove the unit handling methods toLiteral, fromLiteral, tr,
fromTr, and fromUnitToUnitFactor from QGis. Their corresponding
counterparts in QgsUnitTypes should be used instead.
2016-07-25 14:47:16 +10:00
Nyall Dawson
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +10:00
Nyall Dawson
adafeda82a Avoid all use of QgsCoordinateTransform pointers, replace with
copies or references

Makes the code more robust, fixes leaks and avoids potential
null pointer dereferencing
2016-07-16 20:36:45 +10:00
Nyall Dawson
fd42ed3145 Use reference rather than pointer for crs in QgsVectorFileWriter
Since QgsCoordinateReferenceSystem is implicitly shared, it's a
safer approach
2016-07-15 05:57:03 +10:00
Even Rouault
3ee7d59e18 QgsVectorFileWriter::MetaData: add a compulsoryEncoding member
* Some formats require a compulsory encoding, typically UTF-8.
Change initMetadata() to indicate UTF-8 compulsory encoding for
GeoJSON, GeoRSS, GML, GPKG, GPX, KML, SQLite, SpatiaLite, FileGDB,
XLSX and ODS
* QgsVectorFileWriter::init(): make it override the user specified
encoding if the format has a compulsory encoding. And remove hard-coded
case for KML.
2016-05-19 11:38:42 +02:00
Even Rouault
038b3b7950 QgsVectorFileWriter: add capability to export displayed values of fields (typically coming from edit widgets) instead of their raw values 2016-05-14 12:33:10 +02:00
Juergen E. Fischer
99d5e42247 [FEATURE] vector file writer: allow selection of attributes to export 2016-04-03 01:56:21 +02:00
Juergen E. Fischer
a90be95f7b sip sync 2016-02-14 03:50:49 +01:00
Nyall Dawson
752f6bd150 Fix classes which violate rule of three, by implementing required
copy/= operators or making them private

This revealed (and fixes) some issues, including a potential crash
using server access control (refs #13919), and a potential crash with
diagrams
2016-01-22 18:45:45 +11:00
Matthias Kuhn
e351d24a7d More types support for QgsVectorFileWriter 2016-01-12 12:58:47 +01:00
Nyall Dawson
ffebfd9bb7 [FEATURE] Allow overide of geometry type in vector save as dialog
Also allows forcing output file to be multi type, or include z
dimension.

This makes it possible to do things like save a geometryless
table WITH a geometry type, so that geometries can then be
manually added to rows. Previously this was only possible to do in
QGIS by resorting to dummy joins or other hacks.
2015-11-24 06:30:15 +11:00
Nyall Dawson
c49b5b777f Change a lot of arguments to const references in core/gui
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
2015-10-07 12:02:04 +11:00
Juergen E. Fischer
9752c468c1 indentation update 2015-07-29 11:52:14 +02:00
Juergen E. Fischer
9ceb5ceab6 sip sync 2014-11-21 01:17:21 +01:00
Juergen E. Fischer
45c0be1059 sip: remove enum constants 2014-06-02 21:52:02 +02:00
Juergen E. Fischer
c4c131ef75 sip sync 2014-05-27 23:32:42 +02:00
Martin Dobias
8ac3a94b99 Fix #8898 (optional filter extent for vector save as) 2014-03-04 17:39:30 +07:00
Juergen E. Fischer
d4e369414b update sip bindings 2014-01-26 18:36:29 +01:00
Marco Hugentobler
5a2285e2aa Ask datum transformation if vector layer is saved in another CRS 2013-10-31 16:07:27 +01:00
Martin Dobias
5f304b34a1 Merge remote-tracking branch 'origin/master' into new_vector_api
Conflicts:
	python/core/qgsvectordataprovider.sip
	src/app/legend/qgslegendlayer.cpp
	src/app/qgisapp.cpp
	src/app/qgsmergeattributesdialog.cpp
	src/core/qgsvectordataprovider.cpp
	src/core/qgsvectordataprovider.h
	src/core/qgsvectorlayer.cpp
	src/gui/qgssearchquerybuilder.cpp
	src/providers/postgres/qgspostgresprovider.cpp
	src/providers/wfs/CMakeLists.txt
2013-01-23 23:46:56 +01:00
Alexander Bruy
5e45a22d06 remove deprecated methods from API 2012-12-23 10:40:23 +02:00
Martin Dobias
9317ffd89a Merge remote-tracking branch 'origin/master' into new_vector_api
Also disabled mapserver until compilation is fixed.
Fixed tests.

Conflicts:
	src/app/legend/qgslegendlayer.cpp
	src/app/qgsattributedialog.cpp
	src/app/qgsattributedialog.h
	src/app/qgslabelpropertydialog.cpp
	src/app/qgsmaptoollabel.cpp
	src/app/qgsvectorlayerproperties.cpp
	src/core/CMakeLists.txt
	src/core/composer/qgsatlascomposition.cpp
	src/core/qgsexpression.cpp
	src/core/qgspallabeling.cpp
	src/core/qgsvectorlayer.cpp
	src/core/qgsvectorlayer.h
	src/core/qgsvectorlayerimport.cpp
	src/mapserver/qgsprojectparser.cpp
	src/mapserver/qgswfsserver.cpp
	src/mapserver/qgswfsserver.h
	src/mapserver/qgswmsserver.cpp
	src/providers/postgres/qgspostgresprovider.cpp
	src/providers/spatialite/qgsspatialiteprovider.h
	tests/src/core/testqgsexpression.cpp
	tests/src/python/test_qgsmemoryprovider.py
2012-12-18 01:35:06 +01:00
Giuseppe Sucameli
3700d84306 fix build 2012-11-23 00:30:51 +01:00
Tim Sutton
7dd8a2ec5e Better annotation of vector file writer api changes 2012-11-22 10:35:20 +02:00
Martin Dobias
51122d263a Store attributes and fields in vectors instead of maps 2012-10-20 22:19:55 +02:00
Juergen E. Fischer
f3cb57b1eb SIP bindings update:
- update methods of existing classes
- add comment to methods missing in the sip bindings
- split up collective sip files into single files and use
  same directory structure in python/ as in src/
- add a lot of missing classes (some might not make sense because of
  missing python methods in those classes)
- remove some non-existing methods from the header files
- add scripts/sipdiff
- replace some usages of std::vector and std::set with QVector/QSet
2012-09-24 02:42:57 +02:00
Juergen E. Fischer
71c4c7f8ce [API] fix #5014 2012-04-14 20:50:34 +02:00
Martin Dobias
2d35b16aae Avoid a segfault when NULL layer is passed to vector writer 2011-08-04 19:50:19 +02:00
jef
ce8e3d5f05 add 'deprecated' annotation to SIP bindings
git-svn-id: http://svn.osgeo.org/qgis/trunk@15209 c8812cc2-4d05-0410-92ff-de0c093fc19c
2011-02-19 13:24:24 +00:00
jef
917f57c41b [FEATURE] allow OGR save as without attributes (for eg. DGN/DXF)
git-svn-id: http://svn.osgeo.org/qgis/trunk@14562 c8812cc2-4d05-0410-92ff-de0c093fc19c
2010-11-12 17:00:49 +00:00
jef
c07d26fbf6 [FEATURE] add support for OGR creation options to and improve error handling of file writer
git-svn-id: http://svn.osgeo.org/qgis/trunk@14166 c8812cc2-4d05-0410-92ff-de0c093fc19c
2010-08-28 23:14:16 +00:00
mhugent
d14a5e643a Apply patch #2452 (save as vector)
git-svn-id: http://svn.osgeo.org/qgis/trunk@13072 c8812cc2-4d05-0410-92ff-de0c093fc19c
2010-03-18 22:24:18 +00:00
jef
ea9ae01959 improve vector file writers error reporting
git-svn-id: http://svn.osgeo.org/qgis/trunk@12890 c8812cc2-4d05-0410-92ff-de0c093fc19c
2010-02-06 19:27:36 +00:00
mhugent
6c3323739c Committing Horsts OGR format patch from the QGIS hackfest in Vienna
git-svn-id: http://svn.osgeo.org/qgis/trunk@12026 c8812cc2-4d05-0410-92ff-de0c093fc19c
2009-11-08 17:52:40 +00:00
jef
8094f1d4c6 hackfest commit from timlinux:
- more API cleanups
- single click (instead of drag) to select a feature (fixes #1154)
- fixes for topological editing


git-svn-id: http://svn.osgeo.org/qgis/trunk@9471 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-10 20:02:22 +00:00
timlinux
2659556af1 zoomToActiveLayer instead of zoomActiveLayer. Also applied patch from Magnus Homann to correct issue where save as shapefile does not allow using CRS of project projection.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9334 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-09-15 20:51:01 +00:00
timlinux
a4bd78c9f8 Refactor spatial reference system to coordinate reference system (finalise fix of ticket #15). Also updated some more core api docs / module assignments.
git-svn-id: http://svn.osgeo.org/qgis/trunk@9108 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-08-21 21:11:56 +00:00
wonder
e32b9bf1e3 QgsVectorFileWriter:
- added missing deleteShapeFile() PyQGIS wrapper
- added some error handling when adding features
- improved deleteShapeFile method


git-svn-id: http://svn.osgeo.org/qgis/trunk@8621 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-06-08 00:55:29 +00:00