| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
package org.locationtech.jts.simplify; |
| 14 |
|
| 15 |
import org.locationtech.jts.geom.Coordinate; |
| 16 |
import org.locationtech.jts.geom.Geometry; |
| 17 |
import org.locationtech.jts.geom.LineSegment; |
| 18 |
|
| 19 |
/** |
| 20 |
* A {@link LineSegment} which is tagged with its location in a parent {@link Geometry}. |
| 21 |
* Used to index the segments in a geometry and recover the segment locations |
| 22 |
* from the index. |
| 23 |
*/ |
| 24 |
class TaggedLineSegment |
| 25 |
extends LineSegment |
| 26 |
{ |
| 27 |
private Geometry parent; |
| 28 |
private int index; |
| 29 |
|
| 30 |
public TaggedLineSegment(Coordinate p0, Coordinate p1, Geometry parent, int index) { |
| 31 |
super(p0, p1); |
| 32 |
this.parent = parent; |
| 33 |
this.index = index; |
| 34 |
} |
| 35 |
|
| 36 |
public TaggedLineSegment(Coordinate p0, Coordinate p1) { |
| 37 |
this(p0, p1, null, -1); |
| 38 |
} |
| 39 |
|
| 40 |
public Geometry getParent() { return parent; } |
| 41 |
public int getIndex() { return index; } |
| 42 |
} |
| 43 |
|