Hello list, I think i might have found a bug in the split control (or, more
likely, the split-function of LineString, which the split control uses)
Look at the following example:
var line1 = new OpenLayers.Geometry.LineString([new
OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(6,1)]);
var line2 = new OpenLayers.Geometry.LineString([new
OpenLayers.Geometry.Point(2,1),new OpenLayers.Geometry.Point(3,1),new
OpenLayers.Geometry.Point(6,3)]);
var split = line1.split(line2,{mutual:true});
this returns two lists, line1 is split into:
LINESTRING(1 1, 3 1)
LINESTRING(3 1, 6 1)
And line2 is split into
LINESTRING(2 1, 3 1);
LINESTRING(3 1, 6 3);
I would expect that line1 would be split into three lines:
LINESTRING(1 1, 2 1)
LINESTRING(2 1, 3 1)
LINESTRING(3 1, 6 1)
If we reverse line2, and try to split, like this:
var line1 = new OpenLayers.Geometry.LineString([new
OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(6,1)]);
var line3 = new OpenLayers.Geometry.LineString([new
OpenLayers.Geometry.Point(6,3),new OpenLayers.Geometry.Point(3,1),new
OpenLayers.Geometry.Point(2,1)]);
var split = line1.split(line3,{mutual:true});
We see that line1 is split into
LINESTRING(1 1, 3 1)
LINESTRING(3 1, 6 1)
But line3 is not split at all.
So, to me it seems that if segments are fully overlapping they do not split.
Is this a feature or a bug?
And in any case, any pointers on how to solve this?
Regards
Atle
--
Atle Frenvik Sveen | Konsulent, Trondheim
Bouvet ASA Kjøpmannsgt. 35, 7416 Trondheim
Mob: + 47 45 27 86 89
http://www.bouvet.no/ | [email protected]<mailto:[email protected]>
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users