327 Commits

Author SHA1 Message Date
Blottiere Paul
384e85ca77 Add option on layer to read extent from xml in case of data source without metadata 2017-09-06 14:46:37 +01:00
Matthias Kuhn
4ea4478bad Thread safety for feature counter
Make sure that results from a feature counter will only be delivered on
the main thread and that they will be discarded if the layer is deleted
meanwhile.
2017-09-05 12:18:52 +02:00
Blottiere Paul
477775a5d7 [FEATURE] Joined fields are editable if the option is activated 2017-08-28 14:09:55 +01:00
Nyall Dawson
eb0c3015f9 Push minimumValues/maximumValues up to QgsFeatureSource base class
Allows these methods to be called on feature sources
2017-07-13 20:07:33 +10:00
Harrissou Sant-anna
9e6b8ed59d Use PostGIS and PostgreSQL spelling when appropriate 2017-07-07 01:26:38 +02:00
Harrissou Sant-anna
6fab688298 Use SpatiaLite right spelling when needed 2017-07-07 01:26:38 +02:00
Denis Rouzaud
5b8e2c2f27 remove QgsVectorLayer::hasGeometryType in favor of QgsMapLayer::isSpatial 2017-07-05 10:18:32 +02:00
Nyall Dawson
7ae1ee975d Add sourceName() method to QgsFeatureSource
Sometimes it's necessary to retrieve the name of a source...
2017-06-26 12:15:01 +10:00
Nyall Dawson
fc339f9ac5 Add a flag argument to QgsFeatureSink::addFeatures
Flags can be used to control how features are added to the sink.

For now, there's only a single flag available - FastInsert.
When FastInsert is set, faster inserts will be use at the cost
of updating the passed features to reflect changes made at the
provider.

This includes skipping the update of the passed feature IDs
to match the resulting feature IDs for the feature within
the data provider.

Individual sink subclasses may or may not choose to respect
this flag, depending on whether or not skipping this update
represents a significant speed boost for the operation.

QgsVectorLayer always ignores the flag - feature ids are
required for the featureAdded signal to be correctly emitted,
and it's expected that performance critical applications will
add features directly to a data provider instead of
via QgsVectorLayer's edit buffer.
2017-06-15 17:04:27 +10:00
Nyall Dawson
de9e70e6ba Merge pull request #4684 from nyalldawson/processing_pt3
Add sourceExtent method to QgsFeatureSource
2017-06-06 21:50:45 +10:00
Martin Dobias
51e7efe218 Replace QString::null by QString() in core (deprecated since Qt 5.9) 2017-06-06 11:36:41 +02:00
Nyall Dawson
c6c20c6114 Add sourceExtent method to QgsFeatureSource 2017-06-06 17:26:07 +10:00
Nyall Dawson
3388857526 Move uniqueValues to QgsFeatureSource
Also change signature of QgsVectorLayer/QgsVectorDataProvider
uniqueValues method to match (and improve API)
2017-06-05 16:59:08 +10:00
Matthias Kuhn
a9d7630a69 Rename QgsPointV2 to QgsPoint and QgsPoint to QgsPointXY
Because 3D coordinates should be the default.

References https://github.com/qgis/qgis3.0_api/issues/36
2017-06-02 19:53:37 +02:00
Nyall Dawson
bcf4026f9d Flip QgsVectorLayer from transparency to opacity 2017-05-30 08:48:55 +10:00
Nyall Dawson
4647662664 Add crs, fields, wkbType and featureCount to QgsFeatureSource 2017-05-25 12:31:06 +10:00
Nyall Dawson
8bfeb8f73b QgsVectorLayer, QgsVectorDataProvider are QgsFeatureSources 2017-05-25 12:31:06 +10:00
Blottiere Paul
bb1738dcbb Update documentation and sip binding 2017-05-18 11:09:42 +02:00
Blottiere Paul
f92a38cf54 Clone more members in vector layer 2017-05-18 11:09:42 +02:00
Blottiere Paul
8a6137247a Remove the deep copy functionality 2017-05-18 11:09:41 +02:00
Blottiere Paul
42a967904a Update sip binding 2017-05-18 11:09:23 +02:00
Martin Dobias
21f03bc11c Clean up reading/writing of labeling configuration in vector layers
Historically the configuration used to be stored in layer's custom properties, but that does not scale
beyond simple rendering and so rule-based labeling introduced storage of configuration natively in XML elements.
That left us with two different ways of reading/writing labeling configurations. This work makes all configuration
to use native XML elements.

To keep compatibility of 2.x projects, reading of configuration from custom properties is preserved.

This commit also adds Python APIs for direct manipulation of labeling configuration through vector layer's
setLabeling() and labeling() calls.
2017-05-16 14:25:32 +08:00
Martin Dobias
24e06a4941 Remove unused mAnnotationForm member + getter/setter from QgsVectorLayer 2017-05-14 17:41:14 +08:00
Martin Dobias
23a7bd0fd9 Introduce QgsReadWriteContext that encapsulates QgsPathResolver
This should make the read/write methods more flexible if we need to give them extra context.
2017-05-13 18:09:26 +08:00
Martin Dobias
8ffd91ea90 Propagate path resolver through renderers, annotations, diagrams
This is necessary in order to be able to correctly translate between absolute and relative paths
deeper in the code - e.g. paths to SVG files used in marker or fill symbols.

Until now, relative paths were translated to absolute paths on the fly.
This is now changed - paths to files should be always absolute within QGIS objects - and paths
only get turned into relative when saving projects. When loading a project, relative paths
are translated to absolute paths immediately.

This should lower the overall confusion about relative/absolute paths within QGIS, and also
allow having different base directories for relative paths (e.g. QML or QPT files may use relative paths
to their directory - rather than to the project directory)
2017-05-13 18:02:19 +08:00
Alessandro Pasotti
074c41a157 Tiny typo fix - SIP part 2017-05-11 18:28:01 +02:00
Matthias Kuhn
ed747edc94 Improve docs and python bindings for feature count 2017-05-11 12:42:26 +02:00
Matthias Kuhn
964d9ac70a Send feature counting to background task 2017-05-11 12:42:26 +02:00
Martin Dobias
0a0c33dcf2 Remove QgsGeometryCache class
The geometry cache was only used for few geometry editing operations anyway. In earlier versions
of QGIS the geometry cache was also used by old snapping classes which have been replaced
by QgsPointLocator that also keeps a spatial index of geometries and it is not rebuilt on every re-render.

Reasons for removal:
- geometry cache was repopulated on every redraw of layers in editing mode, slowing down rendering
- data structure for the cache was a simple map with features accessed by their ID (no spatial index)
- the cache was only getting refreshed for the current view of the main map canvas (not a generic cache)
- not used for snapping anymore where caching was important to avoid roundtrips to data provider
2017-05-06 10:34:23 +08:00
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Denis Rouzaud
897e2f0410 [sipify] do not take // comments into docstrings 2017-04-30 16:34:08 +02:00
Denis Rouzaud
b0d4a4c201 sipify geometry classes 2017-04-30 11:29:45 +02:00
Nyall Dawson
0b0ccc9e9d Rename QgsVectorLayer::selectedFeaturesIterator to getSelectedFeatures
It's more in line with QgsVectorLayer::getFeatures, hence a more
discoverable API
2017-04-27 11:16:10 +10:00
Denis Rouzaud
4cc4a27068 [sipify] operators, remove argument
* skip some operators
 * allow to remove an argument with SIP_PYARGREMOVE
2017-04-26 15:06:16 +02:00
Nyall Dawson
e273ec7345 Remove invalid doxygen note
It's only flipping a bool, and possibly in some circumstances
it's more efficient to add features one by one rather than storing
large number of features in a temporary list
2017-04-26 11:32:35 +10:00
Nyall Dawson
1280779617 Don't force use of In,Out in QgsFeatureSink methods 2017-04-26 11:32:34 +10:00
Nyall Dawson
c4578c3c1d QgsVectorLayer is a QgsFeatureSink
Also cleanup API for addFeature(s) in QgsVectorLayer, by removing
the unused extra argument from addFeature() and be removing the
makeSelected argument from addFeatures() (code should be adapted
to manually select added features after adding if desired - this
was only used in a single place in the QGIS code and I suspect
this was unintentional in any case)
2017-04-26 11:32:34 +10:00
Denis Rouzaud
1bfa539df1 [sipify] remove extra blank line 2017-04-24 07:39:30 +02:00
Denis Rouzaud
8f2a5c7c00 sipify all 2017-04-20 14:21:36 +02:00
Martin Dobias
24c5b0326f Rewrite addTopologicalPoints() and remove legacy snapping code + unit test 2017-04-19 11:24:20 +08:00
Nyall Dawson
3535ee2d55 Allow QgsDataProvider access through QgsMapLayer
Avoids having to cast to QgsRasterLayer/QgsVectorLayer before
accessing the common QgsDataProvider members
2017-04-18 11:14:01 +10:00
Nyall Dawson
87a670848b [sipify] Always add virtual keyword for overridden methods
sip often requires the virtual keyword to be present, or
it chokes on covariant return types in overridden methods
2017-04-18 11:14:01 +10:00
Martin Dobias
7b202edf04 Remove QgsVectorLayer::snapPoint() and unused code in QgsSelectedFeature 2017-04-17 17:37:16 +08:00
Martin Dobias
316d9c3359 R.I.P. QgsSnapper and QgsMapCanvasSnapper
These classes have been replaced by more efficient and flexible classes
(see QgsPointLocator, QgsSnappingUtils, QgsMapCanvasSnappingUtils)
2017-04-17 17:08:48 +08:00
Nyall Dawson
6a72c945af [sipify] Don't autocreate Docstrings for overridden members
Skip the autocreated Docstrings with rtype annotations if the
member is overridden - better to use the base class
Docstring in this case.
2017-04-17 11:03:02 +10:00
Nyall Dawson
f2a7dcbdd7 Rename QgsMapLayer::metadata -> htmlMetadata()
Frees up metadata() for use as a structured metadata getter
2017-04-10 18:45:00 +10:00
Nyall Dawson
9dabb9dd20 Avoid some "" literals and QString::nulls in layer API
Use QString() instead
2017-04-10 17:17:17 +10:00
Nyall Dawson
bfd37e1122 [sipify] Add return types for functions in docstrings
and change \return -> :return: in docystrings
2017-04-08 09:48:48 +10:00
Matthias Kuhn
58d2d6d7f9 sipify_all 2017-04-07 12:26:30 +02:00
Nyall Dawson
4eeacb8fdf [sipify] Replace :: with . during doxygen->docstring conversion
e.g.

You can use QgsXmlUtils::writeVariant to save it to an XML document
->
You can use QgsXmlUtils.writeVariant to load it from an XML document
2017-04-05 10:32:27 +10:00