Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve split with lines #3539

Closed
wants to merge 1,005 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
1005 commits
Select commit Hold shift + click to select a range
63e3fd3
[BUGFIX][QGIS Server] Revert layer order in WMS GetContext request
rldhont Nov 8, 2016
6cf47be
Apply some @m-kuhn comments (#3736)
sbrunner Nov 8, 2016
c282e26
Use QPointer for storing layer pointers in expression scope
m-kuhn Oct 27, 2016
5093ec6
Improve num_selected and is_selected function help
m-kuhn Oct 27, 2016
164a85a
[virtual] Fix encoding issue
Nov 9, 2016
45711d3
[processing] use algorithm description in modeler dependencies dialog
nirvn Nov 10, 2016
6b2b4c5
[FEATURE][expression] strpos() and regexp_match() improvements
nirvn Nov 8, 2016
6ea0049
Merge pull request #3732 from nirvn/strpos_regexp_match_upgrade
nyalldawson Nov 10, 2016
be6672d
Merge pull request #3741 from nirvn/processing_dependencies_improvement
alexbruy Nov 10, 2016
51a5657
Merge pull request #3727 from arnaud-morvan/processing_ogr2ogr_defaults
alexbruy Nov 10, 2016
73b283c
update FindQCA.cmake for Arch Linux
jef-n Nov 10, 2016
b0644ea
WMS server: add user setting if custom datasources are allowed in wms…
mhugent Nov 10, 2016
88587fd
Add override keywords
mhugent Nov 10, 2016
1cd1158
Merge pull request #3745 from mhugent/server_datasources
mhugent Nov 10, 2016
10648df
[processing] Start of tests for modeler
nyalldawson Nov 10, 2016
dc800db
Fix iteration of features
ahuarte47 Nov 10, 2016
cc0b2e6
Merge pull request #3746 from ahuarte47/Issue_SinglePartsToMultiparts
nyalldawson Nov 10, 2016
a3ae0b2
[processing] Restore spin box widget for number inputs outside modeller
nyalldawson Nov 11, 2016
1ef7ed5
Merge pull request #3703 from aaime/svg_params
nyalldawson Nov 11, 2016
72118f9
[processing] When an algorithm has string parameters, also
nyalldawson Nov 9, 2016
132e76a
[FEATURE][processing] New input type for expressions
nyalldawson Nov 3, 2016
5625d6e
Expression parameters don't have to have parent layers
nyalldawson Nov 11, 2016
156fce9
Add unit tests for processing expression parameter
nyalldawson Nov 11, 2016
be2223f
[processing] check for parent alg dependencies in hasDependencies()
nirvn Nov 11, 2016
35d106b
Fix Qt 5.7 build warnings
m-kuhn Nov 11, 2016
f3d7e39
[processing] harmonize modeler UI behavior with QGIS
nirvn Nov 11, 2016
a4cc572
Merge pull request #3748 from nirvn/processing_harmony
alexbruy Nov 11, 2016
28d7cea
Some fixes to processing expression parameters
nyalldawson Nov 11, 2016
054d430
[spatialite] Don't skip default values
m-kuhn Nov 11, 2016
45617fb
Fix more Qt5.7 warnings
m-kuhn Nov 11, 2016
4981bfc
Fix memory leak
m-kuhn Nov 11, 2016
4e96912
[bugfix][forwardport] File downloader for identify dialog hyperlinks
elpaso Nov 9, 2016
fb124ba
Merge pull request #3751 from elpaso/downloader_master
elpaso Nov 11, 2016
b069e95
typo fix
DelazJ Nov 11, 2016
c180cf3
Merge pull request #3753 from DelazJ/patch-17
mach0 Nov 11, 2016
08231b8
Merge pull request #3742 from nirvn/processing_fix_hasdependencies
nyalldawson Nov 12, 2016
159fda6
[processing] add test for gdal_polygonize
alexbruy Oct 27, 2016
5991ecc
[processing] simple test for ogr buffering
alexbruy Oct 27, 2016
a6bd9f0
Revert "Fix extraction of ogr LayerName from multi-layer dataset URIs"
alexbruy Nov 1, 2016
31a6189
[processing] add test for OGR polygon buffering
alexbruy Nov 1, 2016
23de13c
[processing] add test for OGR buffer with dissolve
alexbruy Nov 1, 2016
52e29b9
[processing] fix deprecation warnings in GDAL test
alexbruy Nov 1, 2016
d08c02d
[processing] disable polygonize test, as it is not stable
alexbruy Nov 1, 2016
397df65
[processing] add test for points along lines
alexbruy Nov 1, 2016
02ed0aa
[processing] fix OGR offset curve and one-side buffer
alexbruy Nov 1, 2016
32094e9
[processing] add test for OGR offset lines
alexbruy Nov 1, 2016
d239a97
[processing] test for OGR one-side buffer
alexbruy Nov 1, 2016
a8feec8
[processing] friendly names for some QGIS tests
alexbruy Nov 1, 2016
256efcc
[processing] remove unnecessary schemas from test data
alexbruy Nov 1, 2016
e1ee477
[processing] use numeric parameter for buffer distance
alexbruy Nov 1, 2016
652addb
[processing] don't pass layer name when '-sql' parameter is used
alexbruy Nov 1, 2016
85d1fd7
[processing] cleanup test data
alexbruy Nov 2, 2016
b6d5f35
[processing] cleanup OGR dissolve algorithm code
alexbruy Nov 10, 2016
dff239c
[processing] improve temp file names generation
alexbruy Nov 10, 2016
426c5be
[processing] compare only geometry in tests
alexbruy Nov 11, 2016
2287230
[processing] fix parameter definition in offset curve algorithm
alexbruy Nov 11, 2016
75bd622
[processing] restore and fix extraction of OGR layer names
alexbruy Nov 11, 2016
fcc96de
[processing] fix indentation
alexbruy Nov 11, 2016
af16bbf
[processing] don't print Processing version
alexbruy Nov 11, 2016
0589566
[processing] mark buffer lines test as expected failure
alexbruy Nov 11, 2016
d81533e
fix failing test
alexbruy Nov 12, 2016
fbc12a8
Allow showing 'not set' in QgsProjectionSelectionWidget
nyalldawson Nov 11, 2016
3ef7b3b
[processing] Use standard QGIS projection selection widget for CRS pa…
nyalldawson Nov 11, 2016
f24cda4
[processing] Add unit tests for retrieving param from script code
nyalldawson Nov 13, 2016
dbf6107
[processing] Add button for projection selection dialog to
nyalldawson Nov 13, 2016
8b1adc5
Merge pull request #3635 from arnaud-morvan/processing_postgis_connect
rouault Nov 13, 2016
d729951
Remove caching of WKB from QgsGeometry (was kept just for compatibility)
wonder-sk Nov 13, 2016
9872b48
Remove caching of GEOS representation within QgsGeometry (legacy)
wonder-sk Nov 13, 2016
514d443
Fix oracle provider and remove dead code
wonder-sk Nov 14, 2016
1d3f1f0
Fix QgsGeometryUtils::sqrDistToLine returns bad values (eg nan values)
nyalldawson Nov 10, 2016
d5c307e
Add method to find distance from a point to a poylgon's boundary
nyalldawson Nov 10, 2016
d6f09c0
[FEATURE] Add method to calculate pole of inaccessibility for polygons
nyalldawson Nov 10, 2016
b440939
Fix test failure, report distance from pole
nyalldawson Nov 10, 2016
880647e
Add some tags to algorithm
nyalldawson Nov 10, 2016
1f81a7c
[FEATURE] pole_of_inaccessibility expression function
nyalldawson Nov 10, 2016
798bc09
Fix conversion from WKB to string in postgres provider (follow up d72…
wonder-sk Nov 14, 2016
6e9631e
Merge pull request #3701 from alexbruy/processing-ogr-tests
alexbruy Nov 14, 2016
7ae6269
[BUGFIX][QGIS Server] Transform feature collections bbox to ESPG:4326
rldhont Nov 14, 2016
7299e6b
Fix typo
rldhont Nov 14, 2016
968e02d
Propagate layer/group name changes in the layer tree (fixes #15844)
wonder-sk Nov 14, 2016
b13b4f9
Fix QGIS Server build error
rldhont Nov 14, 2016
9ad365e
Fix setDestinationCRS
rldhont Nov 14, 2016
9afd6b0
[processing] fix test
alexbruy Nov 14, 2016
9950b08
Fix missing docs and sip coverage (followup 968e02d6)
wonder-sk Nov 14, 2016
645514a
Remove setLayerName(), layerName() from QgsLayerTreeLayer
wonder-sk Nov 14, 2016
8898c94
Fix build
wonder-sk Nov 14, 2016
dd68d81
Update tsstat.pl
mach0 Nov 14, 2016
85c8c97
Allow empty field name ('not set' option) in QgsFieldModel, QgsFieldC…
nyalldawson Nov 14, 2016
d3f5314
[processing] Use standard field combo box for field choices
nyalldawson Nov 14, 2016
4a5faa0
Remove duplicate selectionChanged signal from QgsVectorLayer
nyalldawson Nov 14, 2016
5d78d60
Remove duplicate QgsDataProvider::dataChanged( int ) signal
nyalldawson Nov 14, 2016
29d33b4
[processing] Polygons to line fixes
nyalldawson Nov 14, 2016
d237e27
Followup 29d33b4
nyalldawson Nov 15, 2016
8908eea
Fix rubber band in node tool not getting updated correctly
wonder-sk Nov 15, 2016
c87839f
[processing] fix ExtentSelectionPanel's getValue()
nirvn Nov 15, 2016
4a4ffa4
[processing] fix grass/grass7 installation check
nirvn Nov 15, 2016
38a4aac
Fix test for request size vs cache size
nyalldawson Aug 10, 2016
afd5d1e
Recognise that a cache can be filled using a FilterNone request
nyalldawson Aug 10, 2016
5e3d8fe
Use cached feature iterator if cache has all needed features
nyalldawson Aug 10, 2016
08eaeaa
Increase maximum number of cached features
nyalldawson Aug 10, 2016
b0801f3
Avoid warning noise during attribute table load
nyalldawson Aug 10, 2016
5346023
Don't query list of visible features when showing selected features
nyalldawson Aug 10, 2016
b5c1d0f
QgsCacheIndexFeatureId can also handle non-FilterFid requests
nyalldawson Aug 10, 2016
8f8624a
Improve test debugging
nyalldawson Nov 15, 2016
9ddf78e
minimal textual fix
rduivenvoorde Nov 15, 2016
a373f95
[FEATURE] add functionnality to copy/move feature to move feature map…
3nids Nov 1, 2016
6bfd0fd
fix exception when selecting string function
aroche Nov 15, 2016
adcb772
Merge pull request #3761 from nirvn/processing_parameterextent_fix
alexbruy Nov 15, 2016
6c4eeda
Merge pull request #3762 from nirvn/processing_fix_grass
alexbruy Nov 15, 2016
e9c4090
fix build of qspatialite and ocispatial sql drivers
jef-n Nov 15, 2016
1d538a6
Add Translator
mach0 Nov 15, 2016
87d2ac3
Add @map_extent variable containing geometry of current map extent
nyalldawson Nov 16, 2016
6727ea7
Merge pull request #3764 from nyalldawson/cache_fix2
nyalldawson Nov 16, 2016
5e487cf
[FEATURE] Style management re-work and upgrade
nirvn Nov 7, 2016
5b4a88f
[feature] Add layer scoped actions
m-kuhn Oct 31, 2016
e7d8b2c
Rename scopes to "Field", "Feature", "Layer"
m-kuhn Nov 3, 2016
08d350c
Fix bindings and docs
m-kuhn Nov 3, 2016
a6eb7b6
Convert action ids to uuid
m-kuhn Nov 3, 2016
f18d1c3
Rename listActions to actions and fix test
m-kuhn Nov 3, 2016
f5f2850
More api break documentation
m-kuhn Nov 8, 2016
b32a719
[symbology] draw effect(s) when rendering preview icon
nirvn Nov 15, 2016
f2e3d53
oracle provider: fix retrieval of column comments for geometryless ta…
jef-n Nov 16, 2016
582a56d
fix f2e3d53 indentation
jef-n Nov 16, 2016
ff691a6
Merge pull request #3747 from nyalldawson/num_input
volaya Nov 16, 2016
3242321
[FEATURE] Add method to get list of unique strings matching
nyalldawson Aug 22, 2016
4682eaf
Add QgsVectorLayer::uniqueStringsMatching() to retrieve
nyalldawson Nov 8, 2016
747097d
New method QgsVectorLayerUtils::createUniqueValue
nyalldawson Nov 8, 2016
95271c8
Fix clearing constraints
nyalldawson Nov 8, 2016
b5864cd
[FEATURE] Improve handling of defaults (inc provider default clauses,
nyalldawson Nov 8, 2016
091f488
Make sure primary keys are always marked with a unique, not null
nyalldawson Nov 9, 2016
631bd48
Port remaining map tools, paste features, offline editing
nyalldawson Nov 9, 2016
249c8dc
Prioritise provider default literals over reused values when
nyalldawson Nov 13, 2016
60bbd09
Avoid double-evaluating postgres default values
nyalldawson Nov 14, 2016
af016cf
Don't use auto generated widgets for fields with provider default
nyalldawson Nov 14, 2016
33ee514
Disable failing PyQgsOfflineEditingWFS test
m-kuhn Nov 16, 2016
6638569
oracle provider: allow switching workspaces through property
jef-n Nov 16, 2016
959f97f
Allow not set choice in QgsMapLayerComboBox
nyalldawson Nov 16, 2016
ec49341
Allow showing CRS in QgsMapLayerComboBox
nyalldawson Nov 16, 2016
9ee7873
Allow showing additional items in QgsMapLayerComboBox
nyalldawson Nov 16, 2016
5c3aea3
Allow filtering QgsMapLayerComboBox by data provider
nyalldawson Nov 16, 2016
f78f2a0
[processing] Use native QGIS map layer combobox
nyalldawson Nov 16, 2016
fc65334
[processing] Add file picker to vector/raster/table parameters
nyalldawson Nov 16, 2016
1da400a
Rename enum values for consistency
nyalldawson Nov 16, 2016
089b663
Show layer path tooltips in QgsMapLayerComboBox
nyalldawson Nov 16, 2016
964ecfd
Fix build
nyalldawson Nov 16, 2016
e624518
Merge pull request #3755 from nirvn/style_manager_upgrade
nyalldawson Nov 17, 2016
fb8b931
[processing] Fix error with field widget wrapper
nyalldawson Nov 17, 2016
24ffa15
[FEATURE][processing] Extract by attribute can extract for null/notnu…
nyalldawson Nov 17, 2016
a8a05ba
[symbology] add padding value for symbol/coloramp preview
nirvn Nov 17, 2016
6b6896b
Merge pull request #3777 from nirvn/symbols_preview_padding
nyalldawson Nov 17, 2016
1ffdadd
[travis] Preload libSegFault to debug crashes
m-kuhn Nov 16, 2016
aea5770
typo fix
mach0 Nov 17, 2016
bf43d3d
typo change Ctl to Ctrl
mach0 Nov 17, 2016
10db745
Fix attribute table actions
m-kuhn Nov 17, 2016
ebcfa72
Add a simple layer scoped action example
m-kuhn Nov 17, 2016
5f8fd2b
Fix some leftover faulty attribute scopes
m-kuhn Nov 17, 2016
263ba81
Fix ui build warnings
nyalldawson Nov 17, 2016
5e1a69f
[FEATURE][processing] Create attribute index algorithm
nyalldawson Nov 18, 2016
13a0e48
[style manager] improve UI
nirvn Nov 18, 2016
034e4f3
[Irregular verb]
Nov 18, 2016
72b4e72
Merge pull request #3783 from nyalldawson/create_attribute_index
alexbruy Nov 18, 2016
5f3ba72
[style manager] sort displayed symbols, insure tags are added only once
nirvn Nov 18, 2016
8fcf834
tests for two additional QgsStyle functions: tag() & symbolHasTag()
nirvn Nov 18, 2016
14cfa26
Deprecate SplitLinesWithLines the proper way
Nov 18, 2016
f2ed214
[FEATURE] Speed up algo by fetching features only once
Nov 18, 2016
fc18fd9
Merge pull request #3778 from nirvn/style_manager_ui_imp
nyalldawson Nov 18, 2016
f70a3b9
[processing] move custom parameter definition inside corresponding
alexbruy Nov 18, 2016
9679b6a
[style dock] add minimum height to svg image list (#3786)
nirvn Nov 19, 2016
cac8de5
Swap order of layers in relation add dialog
nyalldawson Nov 19, 2016
b4533cd
Use standard map layer and field combo boxes in relation add dialog
nyalldawson Nov 19, 2016
a958c8a
[style] add createMemoryDB() to QgsStyle to create temporary db
nirvn Nov 19, 2016
08f8ca7
[FEATURE][style manager] import/export of symbols' tags
nirvn Nov 19, 2016
19368cf
[style manager] inform users of successful import
nirvn Nov 19, 2016
cc985c2
use temporary memory db for style tests (avoids clash with default sy…
nirvn Nov 19, 2016
2260780
[style manager] decrease font size and add name & tags tooltip
nirvn Nov 20, 2016
4c2725b
Use Qt5 non-OpenSSL define in testing for SSL support
dakcarto Nov 20, 2016
e9fa3e0
Check for Qt5 subdirectory in PYQT5_SIP_DIR
dakcarto Nov 20, 2016
74dfd1f
Check for Qt5-specific version of Mac qca framework
dakcarto Nov 20, 2016
9bb3235
Update finding QCA OSSL plugin for Qt5 and C++11
dakcarto Nov 20, 2016
a510516
[auth] Remove dependency on SSL cert utils from auth config class
dakcarto Nov 20, 2016
5df9cbc
Remove Python framework options/finding for Mac; add Homebrew support
dakcarto Nov 20, 2016
64b6a44
Skip missing functionality in identity dialog if QWebKit not installed
dakcarto Nov 20, 2016
c123d3b
Add a CMake debug include, with simple variables dump for development
dakcarto Nov 20, 2016
2270603
Merge pull request #3788 from nyalldawson/rel_dialog
nyalldawson Nov 20, 2016
eca83e3
Add CMAKE_POSITION_INDEPENDENT_CODE flag to QCA test for OSSL plugin
dakcarto Nov 21, 2016
6d0e8e6
Make max canvas scale 1600% (fix #15861)
nyalldawson Nov 21, 2016
eda412d
Fix ui build warning
nyalldawson Nov 21, 2016
ee71077
Merge pull request #3789 from nirvn/style_import_export_imp
nyalldawson Nov 21, 2016
e27e533
[FEATURE] Speed up algo by using QgsGeometryEngine
Nov 21, 2016
3c3e17a
[network analysis] expose speed properter in C++ and Python API
alexbruy Nov 16, 2016
14c930a
[API][network analysis] move network analysis into analysis library to
alexbruy Nov 16, 2016
5cbf9d5
remove references to networkanalysis from scrips and packaging files
alexbruy Nov 16, 2016
d0f8863
doxymentation
alexbruy Nov 16, 2016
137b198
add note to the API breaks doc
alexbruy Nov 17, 2016
5992f74
[API] rename QgsArcProperter to QgsStrategy
alexbruy Nov 17, 2016
c1b6edc
update API breaks document
alexbruy Nov 17, 2016
f77ab4d
add note to doxygen comments
alexbruy Nov 17, 2016
00eb261
fix warnings
alexbruy Nov 17, 2016
f9be179
make cost() method pure virtual
alexbruy Nov 19, 2016
a61e8bb
rename QgsStrategy to QgsNetworkStrategy to avoid possible future
alexbruy Nov 19, 2016
9dffe64
replace hardcoded magic numbers with enum
alexbruy Nov 19, 2016
d657c77
rename enum and its values
alexbruy Nov 21, 2016
b421a53
rename QgsLineVectorLayerDirector to QgsVectorLayerDirector
alexbruy Nov 21, 2016
fb5cdd8
remove word "road" from doxygen comments
alexbruy Nov 21, 2016
82082b4
add doxygen note
alexbruy Nov 21, 2016
22dc096
Enable WFS test with a fix to prevent crash on exit (#3774)
m-kuhn Nov 21, 2016
8c8be00
Remove redundant setLayer slots from QgsField(ComboBox|ExpressionWidget)
nyalldawson Nov 21, 2016
3dcf03c
Merge pull request #3773 from alexbruy/network-analysis
nyalldawson Nov 21, 2016
271e67e
[processing] Fix import to postgis alg when table name not set (fix #…
nyalldawson Nov 21, 2016
188033a
[FEATURE] Expression variables for project CRS
nyalldawson Nov 22, 2016
e5f62e4
Remove legacy QgsLegendInterface, move still valid methods to QgisInt…
wonder-sk Nov 21, 2016
377cba0
[processing] Use real map settings scope instead of custom canvasexte…
nyalldawson Nov 16, 2016
86ab302
Remove layer extent and statistic variables from processing contexts
nyalldawson Nov 16, 2016
20dc7fb
[FEATURE] raster_statistic expression function for retrieving
nyalldawson Nov 22, 2016
33caf66
Merge pull request #3766 from nyalldawson/processing_context2
nyalldawson Nov 22, 2016
0c58555
[symbology] respect mixed unit when applying symbol from list widget …
nirvn Nov 22, 2016
d716640
Remove usage of legendInterface() from plugins (followup e5f62e49)
wonder-sk Nov 22, 2016
efd2992
package symbology-ng-style.xml instead of the .db file
nirvn Nov 21, 2016
bc130be
[style] improve creation of default style db
nirvn Nov 21, 2016
0a0b3a7
[style] speed up importXML() by using SQL transaction
nirvn Nov 21, 2016
e226529
[style manager] refresh symbols shipped by default & add tags
nirvn Nov 21, 2016
8dbe6ea
Merge pull request #3793 from nirvn/default_styles_imp
m-kuhn Nov 22, 2016
2894236
[virtual] disable FilterRect when no unique id is present. Should fix…
Nov 22, 2016
e3e70f7
[FEATURE] Broaden allowed geometries by checking WKBTypes
Nov 22, 2016
b7fa540
[db manager] Fix virtual layer uid handling
Nov 22, 2016
dc82ad4
fix typo
alexbruy Nov 22, 2016
ee80be4
Fix misleading indentation warnings caused by messy qtermwidget code …
nyalldawson Nov 22, 2016
311f482
Move profiler instance to QgsApplication
NathanW2 Jun 5, 2016
d712b49
Merge pull request #3790 from dakcarto/qt5py3-mac-fixes
dakcarto Nov 23, 2016
3c51a93
[processing] Fix very broken delete columns algorithm
nyalldawson Nov 23, 2016
489e00d
[processing] Enhance create points layer alg
nyalldawson Nov 23, 2016
2652aa5
[processing] improve the modeler dialog UI and icons
nirvn Nov 23, 2016
eeafe67
Merge pull request #3795 from nirvn/modeler_toolbar
alexbruy Nov 23, 2016
d559d7f
Partially revert 9bb3235
m-kuhn Nov 23, 2016
f71430e
[processing] [FEATURE] SplitWithLines
Sep 28, 2016
a972c6d
[processing] update test for splitwithlines
Sep 29, 2016
ae02f51
[BUG] Prevent division by zero
Sep 29, 2016
621e366
Speed up algorithm
Sep 29, 2016
2f445a3
check if geometry is multipart without wkb types
Sep 29, 2016
a4f4595
Renew test result
Sep 29, 2016
7eabb35
[TEST] resurrect SplitLinesWithLines.py
Sep 30, 2016
81d7d18
rename test
Oct 4, 2016
1838a71
remove all splitWithLines tests
Oct 5, 2016
3dd57e8
[Irregular verb]
Nov 18, 2016
c20d2cb
Deprecate SplitLinesWithLines the proper way
Nov 18, 2016
44a5f07
[FEATURE] Speed up algo by fetching features only once
Nov 18, 2016
09e9e51
[FEATURE] Speed up algo by using QgsGeometryEngine
Nov 21, 2016
783553f
[FEATURE] Broaden allowed geometries by checking WKBTypes
Nov 22, 2016
7f5a011
Reactivate test for SplitWithLines
Nov 23, 2016
c710f3c
Merge branch 'improveSplitWithLines' of github.com:bstroebl/QGIS into…
Nov 23, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/help/qgis.yaml
Expand Up @@ -457,8 +457,8 @@ qgis:snappointstogrid: >
This algorithm modifies the position of points in a vector layer, so they fall in the coordinates of a grid.


qgis:splitlineswithlines: >
This algorithm split the lines in a line layer using the lines in another line layer to define the breaking points. Intersection between geometries in both layers are considered as split points.
qgis:splitwithlines: >
This algorithm splits the lines or polygons in one layer using the lines in another layer to define the breaking points. Intersection between geometries in both layers are considered as split points.

qgis:splitvectorlayer: >
This algorithm takes a vector layer and an attribute and generates a set of vector layers in an outut folder. Each of the layers created in that folder contains all features from the input layer with the same value for the specified attribute.
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
Expand Up @@ -138,7 +138,7 @@
from .SelectByExpression import SelectByExpression
from .SelectByAttributeSum import SelectByAttributeSum
from .HypsometricCurves import HypsometricCurves
from .SplitLinesWithLines import SplitLinesWithLines
from .SplitWithLines import SplitWithLines
from .FieldsMapper import FieldsMapper
from .Datasources2Vrt import Datasources2Vrt
from .CheckValidity import CheckValidity
Expand Down Expand Up @@ -205,7 +205,7 @@ def __init__(self):
PostGISExecuteSQL(), ImportIntoPostGIS(),
SetVectorStyle(), SetRasterStyle(),
SelectByExpression(), HypsometricCurves(),
SplitLinesWithLines(), CreateConstantRaster(),
SplitWithLines(), CreateConstantRaster(),
FieldsMapper(), SelectByAttributeSum(), Datasources2Vrt(),
CheckValidity(), OrientedMinimumBoundingBox(), Smooth(),
ReverseLineDirection(), SpatialIndex(), DefineProjection(),
Expand Down
141 changes: 0 additions & 141 deletions python/plugins/processing/algs/qgis/SplitLinesWithLines.py

This file was deleted.

173 changes: 173 additions & 0 deletions python/plugins/processing/algs/qgis/SplitWithLines.py
@@ -0,0 +1,173 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
SplitWithLines.py
---------------------
Date : November 2014
Revised : September 2016
Copyright : (C) 2014 by Bernhard Ströbl
Email : bernhard dot stroebl at jena dot de
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Bernhard Ströbl'
__date__ = 'November 2014'
__copyright__ = '(C) 2014, Bernhard Ströbl'

# This will get replaced with a git SHA1 when you do a git archive

__revision__ = '$Format:%H$'

from qgis.core import Qgis, QgsFeatureRequest, QgsFeature, QgsGeometry, QgsWkbTypes
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.parameters import ParameterVector
from processing.core.outputs import OutputVector
from processing.core.ProcessingLog import ProcessingLog
from processing.tools import dataobjects
from processing.tools import vector


class SplitWithLines(GeoAlgorithm):

INPUT_A = 'INPUT_A'
INPUT_B = 'INPUT_B'

OUTPUT = 'OUTPUT'

def defineCharacteristics(self):
self.name, self.i18n_name = self.trAlgorithm('Split with lines')
self.group, self.i18n_group = self.trAlgorithm('Vector overlay tools')
self.addParameter(ParameterVector(self.INPUT_A,
self.tr('Input layer, single geometries only'), [dataobjects.TYPE_VECTOR_POLYGON,
dataobjects.TYPE_VECTOR_LINE]))
self.addParameter(ParameterVector(self.INPUT_B,
self.tr('Split layer'), [dataobjects.TYPE_VECTOR_LINE]))

self.addOutput(OutputVector(self.OUTPUT, self.tr('Splitted')))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Splitted" -> "split"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


def processAlgorithm(self, progress):
layerA = dataobjects.getObjectFromUri(self.getParameterValue(self.INPUT_A))
splitLayer = dataobjects.getObjectFromUri(self.getParameterValue(self.INPUT_B))

sameLayer = self.getParameterValue(self.INPUT_A) == self.getParameterValue(self.INPUT_B)
fieldList = layerA.fields()

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fieldList,
layerA.wkbType(), layerA.crs())

spatialIndex = vector.spatialindex(splitLayer)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this + line 71 means that all features are fetched from the provider twice - this could be a performance killer on large layers. I'd suggest you could create the spatialIndex here, and then add features to the index from within the loop at line 72. The index creation will be slower then the current approach, but the boost from only fetching features once should more than offset this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that it would be wise to use the tools processing provides for certain tasks and thus did not think about implementing it myself.
Fixed anyways

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The inbuilt processing methods are fine for simple use cases (eg looping once through features and applying an operation to each), but to really optimise complex algs you need to use the qgis api itself.

splitGeoms = {}

for aSplitFeature in vector.features(splitLayer):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could speed this up a bit by passing a feature request to vector.features which uses setSubsetOfAttributes([]) to avoid fetching the unused attributes.

splitGeoms[aSplitFeature.id()] = aSplitFeature.geometry()
# honor the case that user has selection on split layer and has setting "use selection"

outFeat = QgsFeature()
features = vector.features(layerA)
total = 100.0 / float(len(features))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll need to handle the case that len(features)==0

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, although this would only happen with an empty layer. This was basically a copy-paste operation from some other algo, so I expect to see this line in others, too. But will fix

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's how I know to look out for it... I hit it in some other algorithm with the same block

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

allowedWkbTypes = [2, #WkbLineString
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fragile, and doesn't handle Z/M geometries - I'd suggest instead checking the QgsGeometry.type() for QgsWkbTypes.LineGeometry and PolygonGeometry instead, and then using QgsGeometry.isMultipart() to avoid the multipart types.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be either Line (type = 1) or Polygon (type = 2) anyways because INPUT_A is set to be either TYPE_VECTOR_POLYGON or TYPE_VECTOR_LINE?
I could skip that altogether and when handling the geometry itself check if it is multipart.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically I would prefer to disable multi-layers to be used as input in the first place, but there is no method to do so AFAIK.

3, # WkbPolygon
-2147483646, #WkbLineString25D
-2147483645] # WkbPolygon25D
# MultiGeometries are not allowed because the result of a splitted ring is not clearly defined:
# 1) add both parts as new features
# 2) store one part as a new feature and the other one as ring of the multi geometry
# 2a) which part is which, seems arbitrary

multiGeoms = 0 # how many multi geometries were encountered

for current, inFeatA in enumerate(features):
inGeom = inFeatA.geometry()

if allowedWkbTypes.count(inGeom.wkbType()) == 0:
multiGeoms += 1
else:
attrsA = inFeatA.attributes()
outFeat.setAttributes(attrsA)
inGeoms = [inGeom]
lines = spatialIndex.intersects(inGeom.boundingBox())

if len(lines) > 0: # has intersection of bounding boxes
splittingLines = []

for i in lines:
try:
splitGeom = splitGeoms[i]
except:
continue

# check if trying to self-intersect
if sameLayer:
if inFeatA.id() == i:
continue

if inGeom.intersects(splitGeom):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to make this algorithm magnitudes faster you could use prepared geometries here - have a look at https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/Union.py#L110 and https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/Union.py#L119 for how this is done

Copy link
Author

@bstroebl bstroebl Nov 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson I tried to implement this but get a runtime error
TypeError: QgsGeometryEngine.intersects(QgsAbstractGeometry, str errorMsg=None): argument 1 has unexpected type 'QgsGeometry'
api doc tells me that the first argument should be a QgsAbstractGeometryV2
The difference between my script and union is that union uses
QgsVectorLayer.getFeatures()
while I use processing's
vector.features()
which should be used, see https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/vector.py#L93
Could that be the reason for the runtime error? If yes shouldn't the vector.features() method be improved?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to call if engine.intersects(splitGeom.geometry()):. Note the extract .geometry() there, which retrieves the actual geometry itself (a QgsAbstractGeometry) from within the QgsGeometry "container". It's not very nice API, but hopefully we can clean this up a bit for 3.0...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That did the trick!

splittingLines.append(splitGeom)

if len(splittingLines) > 0:
for splitGeom in splittingLines:
splitterPList = vector.extractPoints(splitGeom)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to optimise further - you could set splitterPList to None here, and then only extract the points when splitterPList is required (ie, if it's still None). Extracting points is slow and they may not be used if none of the intersects checks on line 126 pass.

outGeoms = []

while len(inGeoms) > 0:
inGeom = inGeoms.pop()
inPoints = vector.extractPoints(inGeom)

if inGeom.intersects(splitGeom):
try:
result, newGeometries, topoTestPoints = inGeom.splitGeometry(splitterPList, False)
except:
ProcessingLog.addToLog(ProcessingLog.LOG_WARNING,
self.tr('Geometry exception while splitting'))
result = 1

# splitGeometry: If there are several intersections
# between geometry and splitLine, only the first one is considered.
if result == 0: # split occurred

if inPoints == vector.extractPoints(inGeom):
# bug in splitGeometry: sometimes it returns 0 but
# the geometry is unchanged
outGeoms.append(inGeom)
else:
inGeoms.append(inGeom)

for aNewGeom in newGeometries:
inGeoms.append(aNewGeom)
else:
outGeoms.append(inGeom)
else:
outGeoms.append(inGeom)

inGeoms = outGeoms

for aGeom in inGeoms:
passed = True

if aGeom.wkbType == 2 or aGeom.wkbType == -2147483646:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to use the proper enum values from QgsWkbTypes here - and better to check the flatType so that Z/M/ZM geometry types will be properly handled.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson You mean to only check for WKBLineString?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment this is only passing LineString or LineString25D. I'd suggest changing it to

if QgsWkbTypes.geometryType( aGeom.wkbType() )  == QgsWkbTypes.LineGeometry and not QgsWkbTypes.isMultiType( aGeom.wkbType() ):

Then it'll support LineStringZ, LineStringM, ...ZM, curved types, etc, and be future proof in case more are added in future.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, although I do not fully understand the implemented it now.

passed = len(aGeom.asPolyline()) > 2

if not passed:
passed = (len(aGeom.asPolyline()) == 2 and
aGeom.asPolyline()[0] != aGeom.asPolyline()[1])
# sometimes splitting results in lines of zero length

if passed:
outFeat.setGeometry(aGeom)
writer.addFeature(outFeat)

progress.setPercentage(int(current * total))

if multiGeoms > 0:
ProcessingLog.addToLog(ProcessingLog.LOG_INFO,
self.tr('Feature geometry error: %s input features ignored due to multi-geometry.') % str(multiGeoms))

del writer
@@ -0,0 +1,32 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>polygons_split_with_lines</Name>
<ElementPath>polygons_split_with_lines</ElementPath>
<!--POLYGON-->
<GeometryType>3</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>6</FeatureCount>
<ExtentXMin>-1.00000</ExtentXMin>
<ExtentXMax>10.00000</ExtentXMax>
<ExtentYMin>-3.00000</ExtentYMin>
<ExtentYMax>6.00000</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>name</Name>
<ElementPath>name</ElementPath>
<Type>String</Type>
<Width>5</Width>
</PropertyDefn>
<PropertyDefn>
<Name>intval</Name>
<ElementPath>intval</ElementPath>
<Type>Integer</Type>
</PropertyDefn>
<PropertyDefn>
<Name>floatval</Name>
<ElementPath>floatval</ElementPath>
<Type>Real</Type>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>