39 Commits

Author SHA1 Message Date
Matthias Kuhn
56163e2810 Modularize distance and area formatting 2017-03-08 11:36:28 +01:00
Harrissou Sant-anna
ef85cdcf83 Replace "eg" by "e.g." or "for example" 2016-12-30 00:03:22 +01:00
Nyall Dawson
fe65063c2b Remove many deprecated methods 2016-09-15 18:34:15 +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
b2235938e6 [FEATURE] Add km, yards and miles to distance unit options 2016-02-28 11:24:41 +11:00
Nyall Dawson
dfdcec8922 Fix project unit confusion (pt 3): add area unit settings with a
ton of available area units (eg m2, km2, mi2, ft2, yd2, ha, ac,
etc)

Adds a new option in both the QGIS setting and project properties to
set the units used for area measurements. Just like the distance
setting, this defaults to the units set in QGIS options, but can
then be overridden for specific projects.

The setting is respected for area calculations in:
- Attribute table field update bar
- Field calculator calculations
- Identify tool derived length and perimeter values

Also adds unit tests to ensure that area calculated by attribute table
update bar, field calculator and identify tool are consistent wrt
ellipsoidal calculations and area units.

TODO: make measure tool respect area setting

(refs #13209, #4252 and fixes #12939, #2402, #4857)
2016-02-15 12:47:36 +11:00
Juergen E. Fischer
a90be95f7b sip sync 2016-02-14 03:50:49 +01:00
Nyall Dawson
99cef42eef Improve QgsDistanceArea API to make it easier to determine units
for returned distances, add unit tests
2016-02-05 20:13:10 +11:00
Nyall Dawson
b6c714ac20 Improve API, docs for QgsDistanceArea 2016-02-03 18:57:10 +11:00
Nyall Dawson
fe221d54bf Don't return QStrings by reference, since they're implicitly shared
anyway
2015-10-28 09:47:44 +11:00
Nyall Dawson
2e1d2d1862 Fix calculation of area/length of mixed geometry collections 2015-10-16 21:38:13 +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
Nyall Dawson
c5bc778b1d Const correctness for QgsDistanceArea 2015-05-14 20:03:13 +10:00
Nyall Dawson
2863f20d67 Add a const geometry getter to QgsFeature 2015-05-11 19:46:32 +10:00
Martin Dobias
a19886d2f5 Fix #9951 (perimeter completely wrong with OTF on)
With OTF on and computation on an ellipsoid, the coordinates
were transformed twice(!) when measuring perimeter.
2014-06-10 16:23:02 +07:00
Juergen E. Fischer
c4c131ef75 sip sync 2014-05-27 23:32:42 +02:00
Juergen E. Fischer
74e7314c36 update sip bindings II 2014-01-27 09:22:53 +01:00
Radim Blazek
46a6224c2a missing QgsDistanceArea.setSourceCrs() in SIP 2014-01-09 17:58:57 +01:00
Alexander Bruy
5e45a22d06 remove deprecated methods from API 2012-12-23 10:40:23 +02:00
Alexander Bruy
ee9c811d43 fix QgsDistanceArea bindings 2012-12-12 20:29:30 +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
9e9d1ce84f fix sip error 2012-09-03 23:49:46 +02:00
Magnus Homann
bb3d86bc07 Adedd .sip define 2012-09-03 15:47:48 +02:00
Magnus Homann
182a64eb39 Basic test of QgsDistanceArea 2012-09-03 15:35:13 +02:00
Magnus Homann
1873866054 Renamed one member and its funtcion, and undo last commit 2012-08-23 08:48:42 +02:00
Magnus Homann
a1db95fc98 Moved convertMeasure to QgsDistanceArea 2012-08-23 08:48:42 +02:00
Magnus Homann
e455264ac6 Renamed accessor/mutator and deprecated old names 2012-08-23 08:48:42 +02:00
jef
a285aaaf4b [FEATURE] add $x, $y and $perimeter to field calculator
git-svn-id: http://svn.osgeo.org/qgis/trunk@15381 c8812cc2-4d05-0410-92ff-de0c093fc19c
2011-03-07 20:57:51 +00:00
jef
3fd6119492 deprecated special handling of EPSG - just one authority
git-svn-id: http://svn.osgeo.org/qgis/trunk@15246 c8812cc2-4d05-0410-92ff-de0c093fc19c
2011-02-22 23:32:33 +00:00
mhugent
505b76698b Apply patch #2936 (Units and decimal places of measure tools) from Stefan Ziegler with small modifications
git-svn-id: http://svn.osgeo.org/qgis/trunk@14191 c8812cc2-4d05-0410-92ff-de0c093fc19c
2010-09-04 13:08:17 +00:00
timlinux
5aeb250006 api cleanups for distance area
git-svn-id: http://svn.osgeo.org/qgis/trunk@9504 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-20 20:41:06 +00:00
timlinux
b6ec0534fb Further api updates in core
git-svn-id: http://svn.osgeo.org/qgis/trunk@9478 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-10-16 06:31:25 +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
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
9cfa4d82a4 updated bindings from changes in r8709
git-svn-id: http://svn.osgeo.org/qgis/trunk@8727 c8812cc2-4d05-0410-92ff-de0c093fc19c
2008-07-07 11:44:41 +00:00
wonder
e863ecc67f Changed usage of std::vector to QList in QgsDistance area.
Added the modified functions to Python bindings.


git-svn-id: http://svn.osgeo.org/qgis/trunk@6760 c8812cc2-4d05-0410-92ff-de0c093fc19c
2007-03-04 11:43:48 +00:00
wonder
661fd9bf23 Changed line endings from DOS-style to UNIX-style so SIP won't end up with syntax errors on unix
git-svn-id: http://svn.osgeo.org/qgis/trunk@6740 c8812cc2-4d05-0410-92ff-de0c093fc19c
2007-03-02 09:56:44 +00:00
wonder
9592a85583 Bindings: wrapped QgsDistanceArea
git-svn-id: http://svn.osgeo.org/qgis/trunk@6732 c8812cc2-4d05-0410-92ff-de0c093fc19c
2007-02-28 11:49:14 +00:00