4548 Commits

Author SHA1 Message Date
Matthias Kuhn
dc5eefb588 Merge pull request #5448 from signedav/relationshipstrength
Duplication Feature and its relating Features
2017-10-26 10:43:45 +02:00
Nyall Dawson
acbd9d18f5 Merge pull request #5432 from Gustry/allow_pipe_filepath
allow pipe character in filepath in processing
2017-10-26 19:09:03 +11:00
Alessandro Pasotti
ecf93e38ec Fix test after QgsFileDownloader move to core and API change 2017-10-26 10:07:12 +02:00
Blottiere Paul
861e05b406 Merge pull request #5376 from pblottiere/dirty
[FEATURE] Add a flag to dirty edit buffer when using executeSql in transactions
2017-10-26 07:07:14 +01:00
Nyall Dawson
611dca4a30 Merge pull request #5100 from Gustry/crs_description
add CRS description in the layer_property expression
2017-10-26 14:11:23 +11:00
Nyall Dawson
55203a0fc2 Merge pull request #5359 from nyalldawson/primitive
Rename (and make safe) QgsGeometry::geometry()
2017-10-26 11:04:34 +11:00
Nyall Dawson
837c1c56eb Fix tests 2017-10-26 08:44:38 +10:00
Nyall Dawson
a9f8e60064 Merge pull request #5428 from lbartoletti/triangleGML
ADD GML export to QgsTriangle
2017-10-26 08:38:10 +11:00
Nyall Dawson
c50ee6d42f Update python code to new API 2017-10-26 07:06:34 +10:00
Nyall Dawson
00e869039b Replace use of qt methods with std equivalents 2017-10-26 07:06:34 +10:00
Nyall Dawson
70361063d8 Rename QgsGeometry::geometry as QgsGeometry::get()
Because feature.geometry().geometry() is confusing, and impossible
to search for in python code (e.g. is input.geometry() a QgsGeometry
or a QgsAbstractGeometry?)

But more importantantly: also add a const version
QgsGeometry::constGet(). The non-const
version is slow, since it now forces a detach to avoid corrupting
geometries (since QgsGeometry is shared, it's not safe to directly
access its primitive QgsAbstractGeometry and start messing with
it without first detaching). This is a big risk in the 2.x API
which could potentially corrupt feature geometries with unexpected
outcomes.

Update all uses to constGet where possible.
2017-10-26 07:06:34 +10:00
lbartoletti
650a1227b6 Avoid crash when export as GML an empty geometry 2017-10-25 22:22:07 +02:00
David
f7073d0587 [FEATURE] Duplicate features including children (one level deep) when relation strength is competition - configuration for the relationsstrength in the relation GUI [needs-docs] 2017-10-25 17:04:48 +02:00
Blottiere Paul
385655fc45 Add some tests 2017-10-25 15:29:13 +01:00
lbartoletti
7922608ef3 Change the approach: returns an empty element 2017-10-25 15:01:28 +02:00
Etienne Trimaille
387057a1b8 add CRS description in the layer_property expression 2017-10-25 14:18:40 +02:00
Etienne Trimaille
fb4e84a052 allow pipe character in filepath in processing 2017-10-25 00:49:00 +02:00
Sandro Mani
ea0e09b322 Merge pull request #5410 from manisandro/geomchecker
[FEATURE][Geometry checker] Support checking multiple layers at once, add new checks
2017-10-23 23:32:45 +02:00
Nyall Dawson
46a6f25d6f Merge pull request #5418 from nyalldawson/from_polyline
Rename QgsGeometry::fromPolyline as QgsGeometry::fromPolylineXY
2017-10-24 08:21:30 +11:00
lbartoletti
52e9a48c09 Init z support and GML3 3D 2017-10-23 21:57:24 +02:00
Sandro Mani
9a2393ea92 [Geometry checker] Qt < 5.9 compatibility fix 2017-10-23 17:25:08 +02:00
Sandro Mani
15b5da8fea [Geometry checker] Fix incorrect change parametrization in QgsGeometryCheck::replaceFeatureGeometryPart 2017-10-23 17:25:08 +02:00
Sandro Mani
084660a47f [Geometry checker] More change tracking tests 2017-10-23 17:25:08 +02:00
Sandro Mani
876418c44e [Geometry checker] Add more fixError tests 2017-10-23 17:25:08 +02:00
Sandro Mani
4a6cdbe36b [Geometry checker] Add a first series of fixError tests 2017-10-23 17:25:08 +02:00
Sandro Mani
0ffd00da98 [Geometry checker] Add TestQgsGeometryChecks::createTestContext variant which copies the testdata to a temporary dir 2017-10-23 17:25:08 +02:00
Sandro Mani
d71f62c711 [Geometry checker] Make TestQgsGeometryChecks::searchCheckErrors return the list of matching errors instead of just the number of matches 2017-10-23 17:25:08 +02:00
Sandro Mani
1372536297 [Geometry checker] Add follow boundaries check 2017-10-23 17:25:08 +02:00
Sandro Mani
c44fa1da5c [Geometry checker] Finish gap check test 2017-10-23 17:25:08 +02:00
Sandro Mani
6b3309cd45 [Geometry checker] Add more tests 2017-10-23 17:25:08 +02:00
Sandro Mani
07dc429573 [Geometry checker] Some initial tests 2017-10-23 17:25:07 +02:00
lbartoletti
0d89504ee5 ADD GML export to QgsTriangle 2017-10-23 14:29:08 +02:00
Nyall Dawson
1d043f3c5a Update test 2017-10-23 20:35:54 +11:00
Nyall Dawson
a48c2e8fd4 Merge pull request #4947 from lbartoletti/regularShape_gui
[FEATURE][needs-docs] Add gui to draw Circle, Ellipse, Rectangle and Regular Polygon
2017-10-23 16:04:23 +11:00
Nyall Dawson
5d675720bb Optimise calculation of QgsGeometry::vertexNrFromVertexId
By moving logic to abstract geometry subclasses so that they
can trivially retrieve the vertex number, instead of relying
on the inefficient coordinateSequence method.

Has flow on speed boosts to many geometry operations like
calculation of closest points in a geometry, which will
benefit snapping related operations.
2017-10-23 08:03:22 +11:00
Nyall Dawson
2e8e72d02d Optimise determination of adjacent vertices and move to QgsAbstractGeometry
Previously the method in QgsGeometryUtils was relying on
QgsAbstractGeometry::coordinateSequence, which is an absolute
performance killer.

Instead move to optimised methods in the various abstract
geometry subclasses which rely only on trivial calculations.
2017-10-23 08:03:22 +11:00
Nyall Dawson
51fb66541d Fix QgsVectorFileWriter use of transactions while writing
Previously the writer was only using transactions in some
cases (when calling the static writeAsVectorFormat method).

This changes the writer to always use a transaction when
possible.

Fixes the map renderer job test using gpkg from timing out after
taking forever to running twice the speed of the shapefile
version. Similar benefits across other parts of qgis,
which are writing files without using the static method, e.g.
processing.
2017-10-22 21:43:36 +11:00
Nyall Dawson
c4f3832af2 Rename QgsGeometry::fromPolyline as QgsGeometry::fromPolylineXY
and add new QgsGeometry::fromPolyline which uses QgsPoint

We want to encourage people not to use the QgsPointXY method, as it drops
Z/M values. So it's moved across to a different name to make way
for a new QgsGeometry::fromPolyline which uses a QgsPoint list
instead of QgsPointXY, thus keeping Z/M values intact.

Similarly, QgsPolyline now is a list of QgsPoint (keeping z/m values)
and the old 2d QgsPolyline type was renamed to QgsPolylineXY.

Making the QgsPoint method the "preferred" method and making linestrings
just as easy to create from z/m dimensioned points as 2d points is
important to push people to write code which does not discard
these important dimensions.

As a bonus, the QgsPoint methods are more efficient anyway, since
they don't require creation of a temporary list.
2017-10-22 18:10:14 +10:00
Nyall Dawson
10a2867cab Partially revert 28daa1a0
Using gpkg for this test is causing intermittent travis
timeouts.

.
.
.
.

Team Shapefile FTW ;)
2017-10-22 12:09:43 +10:00
Nyall Dawson
15af45f6b6 Fix QgsGeometry::angleAtVertex returned wrong angle for start/end
of closed linestrings

The average angle of adjacent segments should be used in this case
2017-10-22 11:59:51 +11:00
Matthias Kuhn
6428fed8a3 Merge pull request #5385 from jachym/geopackage
Put GeoPackage at first place in the menu
2017-10-21 16:33:20 +02:00
Even Rouault
8f3d44d4e9 [OGR provider] Allow opening (GeoPackage) datasets with many layers
Currently each time you instanciate a QgsOgrProvider layer, a GDAL dataset is
created. In the case of GeoPackage, this means a SQLite connection and a file
handle. As GDAL enables Spatialite function on GeoPackage connections, we are
bound to Spatialite limits, and Spatialite has a hard limit on a maximum of
64 simultaneous connections. Thus we cannot open more than 64 layers of the
same GeoPackage.
This commits enables sharing of the same GDALDataset object among several
QgsOgrProvider object. Care is made to reuse a GDALDataset object only if the
QgsOgrProvider do not point to the same layer. Mutexes are also taken to
allow safe instanciation and use of QgsOgrProvider objects from multiple
threads (but a same QgsOgrProvider should not be used by more than one thread
at a time)
2017-10-20 17:37:42 +02:00
rldhont
7b455d8700 [Server][FEATURE] Handle request from QgsServer with a QgsProject
With this commit, it's posssible to handle a request from a QgsProject without writing it to the disk.

```python
server = QgsServer()
project = QgsProject()
vlayer = QgsVectorLayer("/path/to/shapefile/file.shp", "layer_name_you_like", "ogr")
project.addMapLayer(vlayer)

query_string = 'https://www.qgis.org/?SERVICE=WMS&VERSION=1.3&REQUEST=GetCapabilities'
request = QgsBufferServerRequest(query_string, QgsServerRequest.GetMethod, {}, data)
response = QgsBufferServerResponse()
server.handleRequest(request, response, project)
```
2017-10-20 09:44:24 +02:00
Matthias Kuhn
13a00aae30 Merge pull request #5399 from pblottiere/server_flaky_tests
[server] WIP : reactivate flaky server tests for WMS requests
2017-10-20 08:26:04 +02:00
Alessandro Pasotti
a411669dae Merge pull request #5226 from aaime/rule_labels
Also export rule based labelling in SLD. Follows up to ticket #8925
2017-10-19 17:58:25 +02:00
Blottiere Paul
3c18232c34 Unskip test_wms_getprint_srs (GetPrint has been refactored since) 2017-10-19 15:29:27 +01:00
Blottiere Paul
e90f601a15 Add some tests to validate assertXMLEqual 2017-10-19 15:29:27 +01:00
Blottiere Paul
e50a8aa31e Split WMS tests to detect flaky behavior 2017-10-19 15:29:27 +01:00
rldhont
e7d7295a64 Merge pull request #5405 from rldhont/server-wms-test-enhancement
[Server][Tests] Fix WMS tests locally
2017-10-19 15:51:37 +02:00
Jachym Cepicky
28daa1a0e0 Adding more default SHP->GPKG changes 2017-10-19 15:45:04 +02:00