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

[Processing] Split with lines #3798

Closed
wants to merge 16 commits into from
Closed

Conversation

bstroebl
Copy link

this is a new pull request because I screwed up the last one
It replaces old SplitLinesWithLines algorithm by a new algorithm called SplitWithLines which splits lines and polygons (hence its name).
I implemented all of Nyalls suggestions and it runs pretty smooth now.

@nyalldawson
Copy link
Collaborator

@bstroebl I've pushed a squashed version of this as 0e2ef06

(with some small follow ups and tests in 38a0ea0)

Thanks for all your hard work here!

@nyalldawson
Copy link
Collaborator

By the way- I've been thinking about 0e2ef06#diff-82c77937447cc4743b51cd2f14513bf9R91 (no handling of multi* geometries), and I think a good approach would be to follow how PostGIS' split works. In PostGIS, a split will always return a multi geometry consisting of the newly split parts of the original geometry. Then it's up to users if they want to convert this to single parts in a separate step. If we did it this way we could nicely handle multigeometry inputs. What do you think?

@bstroebl
Copy link
Author

bstroebl commented Nov 24, 2016 via email

@nirvn
Copy link
Contributor

nirvn commented Nov 24, 2016

@nyalldawson , @bstroebl , FYI, I ran into this dilemma with processing's vector overlay operations (difference, union, etc.), whereas due to the nature of the operation singlepart features could result in multipart features. I opted to go the PostGIS way and always return multiparts.

As with the vector overlays, if a user needs a singlepart output, he/she can run multipart to singleparts algorithm against the output of "split with lines" alg.

@bstroebl
Copy link
Author

As with the vector overlays, if a user needs a singlepart output, he/she can run multipart to singleparts algorithm against the output of "split with lines" alg.

totally agreed; would be good if all processing algs did it this way (accept multi as input, probable output is multi, too), so one could run multi to single as last step in a model and had not to care about it in between.

@bstroebl bstroebl deleted the splitWithLines branch November 24, 2016 07:37
@bstroebl
Copy link
Author

@nirvn, @nyalldawson I already implemented the multi output but there is another problem: If a single line crosses all of a polygon the polgon is split alright, but if the line consists of two separate line features current behaviour is to not split. Would that be the outcome you expect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants