Class LinearPositions
- java.lang.Object
-
- com.github.filosganga.geogson.model.positions.AbstractPositions<SinglePosition>
-
- com.github.filosganga.geogson.model.positions.LinearPositions
-
- All Implemented Interfaces:
Positions,Serializable
public class LinearPositions extends AbstractPositions<SinglePosition>
APositionsimplementation for linear geometries. It is composed by a sequence of SinglePosition (points).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLinearPositions.Builder-
Nested classes/interfaces inherited from class com.github.filosganga.geogson.model.positions.AbstractPositions
AbstractPositions.PositionsBuilder
-
-
Field Summary
-
Fields inherited from class com.github.filosganga.geogson.model.positions.AbstractPositions
children
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LinearPositions.Builderbuilder()static LinearPositions.Builderbuilder(LinearPositions positions)booleanisClosed()Returns if this LinearPosition: - Is composed by at least 4 points - The first and the last are the same.Positionsmerge(Positions other)Merge this LinearPositions with another one.
-
-
-
Method Detail
-
builder
public static LinearPositions.Builder builder()
-
builder
public static LinearPositions.Builder builder(LinearPositions positions)
-
merge
public Positions merge(Positions other)
Merge this LinearPositions with another one. If the givenPositionsis: - SinglePosition, it will return a new LinearPositions with the given SinglePosition appended. - LinearPositions, it will return a new AreaPosition composed by this and the given LinearPositions. - Any other, it delegates to the other the merge logic.- Parameters:
other- Positions instance to merge with.- Returns:
- Positions results of merging.
-
isClosed
public boolean isClosed()
Returns if this LinearPosition: - Is composed by at least 4 points - The first and the last are the same.- Returns:
- true if it is closed, false otherwise.
-
-