[Qgis-developer] help with splitGeometry

Martin Dobias wonder.sk at gmail.com
Wed Mar 3 03:46:16 EST 2010


On Wed, Mar 3, 2010 at 7:55 AM,  <luca_manganelli at comune.trento.it> wrote:
> qgis-developer-bounces at lists.osgeo.org scritti il 02/03/2010 21.54.59
>
>> Hi Maxim
>
>> the splitGeometry() method was missing /Out/ annotations for the
>> output lists, so it wasn't working correctly. It has been fixed in
>> r12992.
>
>> The syntax should be now:
>> (res, newlist, topolist) = geom1.splitGeometry(pnts, False)
>
> 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)

There are several possible outcomes when using on lines:
- no intersection
- one or more points
- one or more lines (when the lines share segments)
- collection of point(s) and line(s)

Martin


More information about the Qgis-developer mailing list