How to sequence Line Segment ?

Developer
Jan 12, 2012 at 11:25 AM

I need to sequence different segments of point like

(x1,y1)-(x2,y2)
(x3,y3)-(x1,y1)
(x4-y4)-(x2,y2)

They can be disjoint.

I was trying with LineMerger but he does not works.

Where can I found documentation on Topology ?

Many Thanks

T.

Editor
Jan 12, 2012 at 12:03 PM

sth along the lines of this example:

http://code.google.com/p/nettopologysuite/source/browse/trunk/NetTopologySuite.Samples.Console/Operation/Linemerge/LineMergeExample.cs

Hth FObermaier

Developer
Jan 12, 2012 at 12:44 PM

that is my code:

List<LineString> lsList = new List<LineString>();

//List generation. All LineString are of 2 points

LineMerger lineMerger = new LineMerger();

lineMerger.Add(lsList);

FeatureSet fs = new FeatureSet(FeatureType.Line);

foreach (LineString ls in lineMerger.MergedLineStrings)
{
    Feature arc = new Feature(FeatureType.Line, ls.Coordinates);
    fs.AddFeature(arc);
}
fs.SaveAs(filename,true);
Is Very similar to the example you posted, but if I save the FeatureSet from the original segment and the merged the does not overlaps:
https://lh4.googleusercontent.com/-0-SG78BQ7YM/Tw7jEJhxzNI/AAAAAAAAADI/QwLOQvoOCH4/s469/LineString.JPG
In magenta the orignal segments, in black the result.

 

Developer
Jan 12, 2012 at 1:10 PM

Thinking it better if the points are the result of a calculation may not be identical for a comparison with ==

This could be a problem or the function is safe for this problem?

In this case I can substitute points within an EPS distance by assigning an equal value.

Many Thanks !

Editor
Jan 12, 2012 at 2:01 PM

Could you post input linestring wkts or coordinates and result multipolygon wkt?

I can check what NTS does with it. It may be more robust than DotSpatial.Topology

Cheers FObermaier