74 Commits

Author SHA1 Message Date
Nyall Dawson
4ab4a1fcad Spell check 'mitre' -> 'miter' (i.e. use en-us variation) 2017-08-07 18:08:57 +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
Denis Rouzaud
2e7de50b42 run astyle on src/* 2017-03-03 09:09:37 +01:00
Nyall Dawson
49aae6e908 Rename QgsGeometry::isEmpty to isNull
Differentiates missing geometries from empty geometries (eg
empty geometry collections)
2017-01-30 21:58:23 +10:00
Denis Rouzaud
0a63d1f2c2 [spellcheck] properly look into various cases and add more fixes" 2017-01-16 16:39:20 +01:00
Harrissou Sant-anna
f9578bf60b Replace selectedFeaturesIds by selectedFeatureIds 2016-12-07 00:19:11 +01:00
Martin Dobias
9872b4848d Remove caching of GEOS representation within QgsGeometry (legacy) 2016-11-14 13:36:12 +08:00
Martin Dobias
d729951dcd Remove caching of WKB from QgsGeometry (was kept just for compatibility)
Also improves the API to export/import WKB as QByteArray
2016-11-14 13:36:12 +08:00
Nyall Dawson
4166a3ea62 Fix most clazy qstring-unneeded-heap-allocations warnings
By flipping string literals to QStringLiteral/QLatin1String

see

https://woboq.com/blog/qstringliteral.html
2016-10-24 15:26:24 +10:00
Matthias Kuhn
b6779f63ff Rename QgsFields::fieldNameIndex() to lookupField()
To have two clearly different names for tolerant/intolerant index lookup
2016-10-01 15:39:03 +02:00
Nyall Dawson
616a80f48e Bump minimum GEOS version to 3.3 2016-08-17 06:43:02 +10:00
Nyall Dawson
5f6dfaed38 Remove QgsGeometry pointers from QgsGeometryAnalyzer 2016-08-15 09:47:04 +10: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
4b78b1c208 Make all QgsGeometry methods return values, not pointers
Reduces likelihood of crashes and leaks
2016-08-01 22:41:55 +10: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
1a2231f10c Rename QGis class to Qgis, for capitalisation consistency 2016-07-21 22:01:38 +10:00
Nyall Dawson
c628c0f434 Rework includes to forward declare as much as possible
Should speed up recompilation when headers change
2016-07-18 19:10:19 +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
Nyall Dawson
1287f8ccbd Store object instead of pointer to crs in QgsMapLayer 2016-05-25 15:41:05 +10:00
Juergen E. Fischer
2ea3d7744d port more WKB parsing to Qgs(Const)WkbPtr including bounds checking 2016-02-09 14:20:07 +01:00
Juergen E. Fischer
71dc339106 more stl to qt ports and size_t => int fixups 2015-12-26 00:59:09 +01:00
Sebastian Dietrich
c28c493b65 fix all occurrences of multiple statements in a single line
This was accomplished by running scripts/astyle-all.sh.
2015-12-21 01:21:06 +01:00
Nyall Dawson
576875e998 Followup 320c696 use clang-modernize to replace 0/NULL use with nullptr 2015-12-15 11:24:51 +11:00
Nyall Dawson
1969e09b6f Also avoid detaching QgsFields and QgsAttributes where possible 2015-10-20 20:36:08 +11:00
Nyall Dawson
2e1d2d1862 Fix calculation of area/length of mixed geometry collections 2015-10-16 21:38:13 +11:00
Matthias Kuhn
cf2f6b17fa Alias without pending prefix for QgsVectorLayer methods
* pendingAllAttributesList -> attributeList
 * pendingPkAttributesList -> pkAttributeList
 * pendingFeatureCount -> featureCount

featureCount will now always return the features on the layer and NOT the
committed features count as before.
This changes its behavior but this way it is coherent with the other methods
which work on the layer.
2015-08-04 15:13:31 +02:00
Matthias Kuhn
e832b2a28a Add QgsVectorLayer::fields() as alias to pendingFields()
pendingFields() is not very intuitive and leads to confusion for new developers.
2015-08-04 15:13:31 +02:00
Denis Rouzaud
9e3183c63f Revert "sort includes"
This reverts commit 2b7d3d3c73b50ba6dc74abec6dd652ff1b87c0ec.
2015-06-10 14:54:47 +02:00
Denis Rouzaud
2b7d3d3c73 sort includes 2015-06-10 13:59:08 +02:00
Nyall Dawson
2863f20d67 Add a const geometry getter to QgsFeature 2015-05-11 19:46:32 +10:00
Nyall Dawson
7e66e33485 More memory leak fixes identified by Coverity 2015-02-04 17:19:03 +11:00
Juergen E. Fischer
d8cc79ac44 indentation update 2014-09-26 22:00:00 +02:00
Even Rouault
6354dd3a31 Use GEOS reentrant API (_r functions) and update requirement to GEOS >= 3.1.0
Currently QGIS uses the 'classic' GEOS API that uses a global context.
This can conflict with libraries that would also use the global context
and potentially finalize it whereas QGIS will still use it later.

See https://groups.google.com/forum/#!topic/spatialite-users/9YSU6c5AVQ4 for
such an example of such a recent issue with Spatialite.

The _r API is available since GEOS 3.1.0, which is already an ancient GEOS
version. For example, old-old-stable Ubuntu (Lucid 10.04) and Debian (squeeze)
ship with GEOS 3.1.0 or later.

Such move has also been done in GDAL 1.11
(http://lists.osgeo.org/pipermail/gdal-dev/2013-August/036877.html)
and MapServer 7.0 (https://github.com/mapserver/mapserver/issues/4733)

There's no easy way unfortunately to check at compile time that you don't
use the non _r API. I have patched my geos_c.h header to #ifdef that API (quite
painfull to do..). A postprocessing check can be done however with :

objdump -T output/lib/*.so | grep -v Base | grep GEOS | grep -v _r | grep -v "_ZN" | grep -v GEOSversion

It should return nothing.
2014-06-17 22:18:15 +02:00
Marco Hugentobler
b480d171c0 Event layer function: catch various error cases for line offsets 2014-06-04 14:23:43 +02:00
Juergen E. Fischer
f041072e66 fix some warnings 2014-06-02 21:52:01 +02:00
Marco Hugentobler
302480d8a6 Fix offset in event layer function 2014-05-28 15:57:07 +02:00
Marco Hugentobler
9b89c62170 GeometryAnalyzer: cache geometries in eventLayer function for better performance with 2.x versions 2014-03-14 17:09:14 +01:00
Juergen E. Fischer
0a1d44fc63 make qgis_app a shared library and fix some more stl warnings with msvc 2013-09-07 00:22:10 +02:00
Matthias Kuhn
55135d6007 const-correctness for QgsGeometry 2013-06-25 12:16:36 +02:00
Radim Blazek
f40e3a6fea renamed doubleNear to qgsDoubleNear, QgsMalloc to qgsMalloc, QgsCalloc to qgsCalloc, QgsFree to qgsFree 2013-04-12 19:20:31 +02:00
Juergen E. Fischer
dc728f6c39 update calls to new api 2013-01-29 01:58:32 +01:00
Martin Dobias
51122d263a Store attributes and fields in vectors instead of maps 2012-10-20 22:19:55 +02:00
Martin Dobias
8bf959093f QgsFeature: use a vector of attributes instead of a map (for faster access) 2012-10-19 00:31:03 +02:00
Juergen E. Fischer
2e52cb524f fix windows build and a couple of warnings 2012-08-01 11:57:27 +02:00
Marco Hugentobler
a4017a233b Fix beforeVertex - afterVertex mistake for linear referencing 2012-04-16 11:35:32 +02:00
Marco Hugentobler
f2443737e0 Fix direction for eventLayer offset 2012-04-01 13:24:04 +02:00
Tim Sutton
2e5112dc58 Mark unused var 2012-03-31 23:31:03 +02:00
Marco Hugentobler
0d745fa522 Intendention update and remove legacy code 2012-03-31 22:47:48 +02:00
Marco Hugentobler
dd9b98a1b3 [FEATURE]: geometry offset for event layer function 2012-03-31 22:10:04 +02:00