Revision 89
org.gvsig.lrs/trunk/org.gvsig.lrs/org.gvsig.lrs.lib/org.gvsig.lrs.lib.impl/src/main/java/org/gvsig/lrs/lib/impl/LrsAlgorithmUtils.java | ||
---|---|---|
8 | 8 |
|
9 | 9 |
import java.io.File; |
10 | 10 |
import java.util.ArrayList; |
11 |
import java.util.Iterator; |
|
12 | 11 |
import java.util.List; |
13 | 12 |
|
14 |
import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction; |
|
15 |
|
|
16 | 13 |
import org.gvsig.fmap.dal.DALLocator; |
17 | 14 |
import org.gvsig.fmap.dal.DataManager; |
18 | 15 |
import org.gvsig.fmap.dal.DataServerExplorer; |
... | ... | |
39 | 36 |
import org.gvsig.tools.dataTypes.DataType; |
40 | 37 |
import org.gvsig.tools.locator.LocatorException; |
41 | 38 |
|
39 |
/** |
|
40 |
* @author fdiaz |
|
41 |
* |
|
42 |
*/ |
|
42 | 43 |
public class LrsAlgorithmUtils { |
43 | 44 |
|
44 | 45 |
static protected FeatureStore createNewDataStore(NewFeatureStoreParameters newFeatureStoreParameters, |
... | ... | |
95 | 96 |
} |
96 | 97 |
|
97 | 98 |
static List<Point> getPointsWithM(Geometry geom, double m) throws CreateGeometryException, LocatorException { |
99 |
|
|
98 | 100 |
List<Point> points = new ArrayList<Point>(); |
99 | 101 |
|
100 | 102 |
if (geom instanceof Line) { |
101 | 103 |
Line line = (Line) geom; |
102 | 104 |
for (int i = 0; i < line.getNumVertices() - 1; i++) { |
103 |
Point point = getPointWithMBetweenTwoMPoints(m, line.getVertex(i), line.getVertex(i + 1)); |
|
104 |
if (point != null) { |
|
105 |
Point currentVertex = line.getVertex(i); |
|
106 |
Point nextVertex = line.getVertex(i + 1); |
|
107 |
Point point = getPointWithMBetweenTwoMPoints(m, currentVertex, nextVertex); |
|
108 |
if (point != null && !points.contains(point)) { |
|
105 | 109 |
points.add(point); |
106 | 110 |
} |
107 | 111 |
} |
... | ... | |
111 | 115 |
Line line = (Line) multiLine.getPrimitiveAt(p); |
112 | 116 |
for (int i = 0; i < line.getNumVertices() - 1; i++) { |
113 | 117 |
Point point = getPointWithMBetweenTwoMPoints(m, line.getVertex(i), line.getVertex(i + 1)); |
114 |
if (point != null) { |
|
118 |
if (point != null && !points.contains(point)) {
|
|
115 | 119 |
points.add(point); |
116 | 120 |
} |
117 | 121 |
} |
Also available in: Unified diff