2557 Commits

Author SHA1 Message Date
Nyall Dawson
87733851cf Followup 19ab72c, add unit test
Adds a unit test to ensure that all providers ignore invalid
ids when passed a FilterFids request.

Spoiler: they do
2016-08-06 08:16:09 +10:00
Denis Rouzaud
1db19ce8c0 Merge pull request #3356 from 3nids/remove_legendmodel
remove QgsLegendModel
2016-08-05 20:54:52 +02:00
Denis Rouzaud
bbb9b5322d remove QgsLegendModel 2016-08-05 20:53:58 +02:00
Matthias Kuhn
e82ce54a8e Don't rely on a particular order in filterFids tests (#3357) 2016-08-05 16:14:17 +02:00
Denis Rouzaud
acbf5cddb4 renamed QgsSymbologyV2Conversion to QgsSymbologyConversion 2016-08-05 08:32:13 +02:00
Denis Rouzaud
f2c3fb003e renamed QgsSymbolLevelsV2Dialog to QgsSymbolLevelsDialog 2016-08-05 08:22:43 +02:00
Denis Rouzaud
275736de92 removed V2 from QgsSymbolV2* 2016-08-05 08:22:21 +02:00
Denis Rouzaud
c16d1393a2 removed V2 from QgsSymbolLayerV2* 2016-08-05 08:18:01 +02:00
Nyall Dawson
1f02fd491d Implement provider side FilterFids iterators for OGR provider
Makes some operations with OGR sources magnitudes faster, ie
zoom to 20 selected features in a 4 million point dataset:

before: 14 seconds of blocked gui
after: instant

Win!
2016-08-05 07:40:54 +10:00
Nyall Dawson
ed4d34fdbc QgsFields returns QgsField value instead of const references
(since QgsField is implicitly shared)
2016-08-05 06:08:07 +10:00
Nyall Dawson
967d37adc7 QgsFeature::fields() returns a value, not a pointer
Also remove all other QgsFields pointers and replace with
references/values, since QgsFields objects are implicitly shared
2016-08-05 06:07:02 +10:00
Denis Rouzaud
3e197ae74a remove QgsColorButton in favor of V2 2016-08-04 14:27:31 +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
Martin Dobias
9db9304627 Raster MTR improvements - part one (PR #3334) 2016-08-02 08:22:29 +02:00
Nyall Dawson
e259e62941 Merge pull request #3349 from nyalldawson/feature_geom
Mega API break - fix QgsFeature geometry getters/setters
2016-08-02 09:21:25 +10:00
Nyall Dawson
b7ca001c9c Add __nonzero__ and __bool__ methods to QgsGeometry 2016-08-02 08:39:58 +10:00
Martin Dobias
38b63edc46 Fix doc coverage test for "added in XXX" check 2016-08-01 23:05:37 +02:00
Matthias Kuhn
ea0f4da58c Sort attribute table by value for numerical columns
Fix #15318
Fix #15295
2016-08-01 16:31:16 +02:00
Nyall Dawson
4b78b1c208 Make all QgsGeometry methods return values, not pointers
Reduces likelihood of crashes and leaks
2016-08-01 22:41:55 +10:00
Matthias Kuhn
3e33e686c1 Rename visibility presets to map themes
Because it is not only more descriptive for what it does but also
sounds more interesting.

[needs-docs]
2016-08-01 12:23:44 +02:00
Nyall Dawson
bd7d913379 Refine QgsFeature geometry getters/setters
All pointer based methods have been removed.

Now we have only:

  void setGeometry( const QgsGeometry& geom )

and

  QgsGeometry geometry() const

Benefits include avoiding a whole lot of tricky pointer lifetime
issues, potential memory leaks, and finally closing #777, which
has survived for over 9 years!...

Impacts on PyQGIS code:
- no more need for the messy
  g = QgsGeometry( feature.geometry() )
  workaround, just use g = feature.geometry() instead
- IMPORTANT: you can no longer test whether a feature has geometry
 using `if f.geometry():`, since QgsFeature::geometry() will
 *always* return an object. Instead, use
 `if not f.geometry().isEmpty():`, or preferably the new method
 `if not f.hasGeometry():`

Fix #777
2016-08-01 16:25:46 +10:00
Nyall Dawson
aceddae65a QgsFeature cleanup, part 1
Deprecate some QgsFeature methods which take or return pointers,
update other classes as required
2016-07-31 21:23:07 +10:00
Nyall Dawson
429fe2d4ce Merge pull request #3335 from nyalldawson/vector_layer
QgsVectorDataProvider::Capability improvements
2016-07-29 05:10:37 +10:00
Nyall Dawson
10c92394e7 [FEATURE] API + expression function for merging linestrings
Adds a new method to QgsGeometry for merging linestrings.
By passing a multilinestring, any connected lines will
be joined into single linestrings. Behind the scenes this
uses GEOS' line merge.

A corresponding expression function "line_merge" has also
been added.
2016-07-28 20:33:27 +10:00
Nyall Dawson
1a4ceb1680 [FEATURE] Expression function for calculating geometry boundary
The new 'boundary(...)' function returns a geometry's topological
boundary, ie for polygons this is a multilinestring representing
the polygons rings
2016-07-28 08:16:57 +10:00
Nyall Dawson
85f37eebb3 Add method to QgsAbstractGeometryV2 for boundary
Returns the closure of the combinatorial boundary of the
geometry (ie the topological boundary of the geometry).
For instance, a polygon geometry will have a boundary
consisting of the linestrings for each ring in the polygon.

Follows OGC / SQL/MM specs for boundary calculation
2016-07-28 08:16:57 +10:00
Nyall Dawson
6c0d97a06b Merge pull request #3337 from nyalldawson/remove_psuedo_shader
Remove the broken, unused QgsPseudoColorShader class
2016-07-27 07:11:55 +10:00
Nyall Dawson
3d6688cce5 Add labeling tests for letter/word spacing 2016-07-27 06:37:16 +10:00
Nyall Dawson
5228de353c Update curved label test reference images 2016-07-27 06:37:16 +10:00
Nyall Dawson
68b621ace6 Merge pull request #3314 from nyalldawson/units
Consolidate unit handling in QgsUnitTypes
2016-07-26 11:14:35 +10:00
Nyall Dawson
ba26bc887a Remove the broken, unused QgsPseudoColorShader class 2016-07-26 10:11:57 +10:00
Nyall Dawson
f6b09eaee1 Add Distance*, Area*, Angle* prefixes to QgsUnitTypes enum values 2016-07-26 08:29:24 +10:00
Nyall Dawson
ce6bd6c973 Move QgsSymbolV2::OutputUnit enum to QgsUnitTypes
And rename to QgsUnitTypes::RenderUnits. This enum is used in
much more contexts than just symbols, so QgsUnitTypes is a
better fit for it.

All methods which previously accepted QgsSymbolV2::OutputUnit
parameters or QgsSymbolV2::OutputUnitList parameters now take
QgsUnitTypes::RenderUnit or QgsUnitTypes::RenderUnitList
parameters respectively.
2016-07-25 15:22:12 +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
58856fe82f Remove some deprecated QgsVectorDataProvider::Capabilities
Also make capabilities() return a QFlags
QgsVectorDataProvider::Capabilities, rather than an integer
value (for type safety)
2016-07-25 12:14:00 +10:00
Nyall Dawson
bb36c6048d Remove QgsCRSCache
No longer required now that QgsCoordinateReferenceSystem
internally uses caches for CRS initialization.
2016-07-25 10:15:46 +10:00
Nyall Dawson
ac36cb5dd2 Make QgsCoordinateReferenceSystem use an internal cache
for initializing CRS objects.

This avoids the need for the separate QgsCRSCache class,
and means that the caching benefits are available without the
need for calling methods from QgsCrsCache.
2016-07-25 10:14:19 +10:00
Nyall Dawson
bb220a0b43 Add some static methods for creating QgsCoordinateReferenceSystem
This avoids the need for

  QgsCoordinateReferenceSystem crs;
  crs.createFromSrsId(...)

and instead can be replaced with

  QgsCoordinateReferenceSystem crs = QgsCoordinateReferenceSystem::fromSrsId(...)
2016-07-25 10:14:19 +10:00
Nyall Dawson
ee62bdeeb4 Rename some QgsCoordinateReferenceSystem methods
- geographicFlag() -> isGeographic()
- axisInverted() -> hasAxisInverted()
2016-07-25 10:14:19 +10:00
Martin Dobias
ab4a83b49b Goodbye to QgsMapRenderer (#3333)
For the time being the class is kept in the server code while it is still being used there.
2016-07-24 22:40:52 +02:00
Matthias Kuhn
e9b4b0c666 Pass enums by value 2016-07-23 00:20:29 +02:00
Matthias Kuhn
82259f8775 Miss fixing docs 2016-07-22 22:51:44 +02:00
Nyall Dawson
791b2c3919 Merge pull request #3324 from nyalldawson/qgis
QGis class rename and cleanup
2016-07-22 19:28:06 +10:00
Nyall Dawson
12a2147427 [FEATURE] Add an option to show user color schemes menus
This adds the ability for users to set whether a user created
color scheme should show up in the color button drop-down menus.

It's accessed through the color picker dialog, on the lists tab.
Just add a new color scheme, then from the scheme menu tick the
new "show in buttons" option.

Handy if you have sets of common palettes and want them to be
instantly available through the color menu.
2016-07-22 07:32:07 +10:00
Even Rouault
68f63eb101 Try another method to avoid XML serialization issues with QT5 (#3323) 2016-07-21 17:24:37 +02:00
Nyall Dawson
713e22a9f5 Move some methods out of Qgis class 2016-07-21 22:14:46 +10:00
Nyall Dawson
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +10:00
Nyall Dawson
2685a90397 Make doc coverage test acceptable list case insensitive 2016-07-21 08:40:50 +10:00
Nyall Dawson
4cfacf14e3 Make API more consistent
- rename methods with XML to Xml, CRS to Crs, WMS to Wms, ID to Id
- rename methods with SRS to Crs
- rename methods with abbreviations like "dest" to "destination"
- rename methods with abbreviations like "src" to "source"
2016-07-21 08:40:50 +10:00
Nyall Dawson
92eec0e338 Revert "[labeling] Curved labels are now angled per character"
This reverts commit f6d07a33b71a9b19579d19dadbe777b1f14c6842.
2016-07-20 19:44:13 +10:00