[Qgis-developer] help with splitGeometry

Martin Dobias wonder.sk at gmail.com
Wed Mar 3 04:41:12 EST 2010


On Wed, Mar 3, 2010 at 10:04 AM,  <luca_manganelli at comune.trento.it> wrote:
> Martin Dobias <wonder.sk at gmail.com> scritti il 03/03/2010 09.46.16
>
>> > There's any way to split a line feature giving only one point that
>> > intersect it?
>
>> Sure, use intersection directly:
>> geom2 = geom.interesction(other_geom)
>
> Yes, but I want to split and then save the layer. How can I achieve this?

Sorry I've misread your question. Splitting by a point is IMHO very
tricky. It's likely that the point you've specified for splitting lies
close to the line but doesn't really lie on it due precision errors of
the representation of floating point numbers. So I think this wouldn't
generally work. But it shouldn't be a problem to create a very short
line that crosses the linestring geometry of your interest and splits
it correctly.

Martin


More information about the Qgis-developer mailing list