@Override
 public MultiLineString apply(LineString object) throws UnconvertibleObjectException {
   final MultiLineString geom =
       object.getFactory().createMultiLineString(new LineString[] {object});
   geom.setSRID(object.getSRID());
   geom.setUserData(object.getUserData());
   return geom;
 }
Exemple #2
0
  public Geometry densify(double segLength) {
    newCoords = new CoordinateList();

    CoordinateSequence seq = inputLine.getCoordinateSequence();

    Coordinate p0 = new Coordinate();
    Coordinate p1 = new Coordinate();
    seq.getCoordinate(0, p0);
    newCoords.add(new Coordinate(p0));

    for (int i = 0; i < seq.size() - 1; i++) {
      seq.getCoordinate(i, p0);
      seq.getCoordinate(i + 1, p1);
      densify(p0, p1, segLength);
    }
    Coordinate[] newPts = newCoords.toCoordinateArray();
    return inputLine.getFactory().createLineString(newPts);
  }
 public LinearRing asLinearRing() {
   return parentLine.getFactory().createLinearRing(extractCoordinates(resultSegs));
 }
Exemple #4
0
 /** reverse direction of points in a line */
 LineString reverse(LineString l) {
   List clist = Arrays.asList(l.getCoordinates());
   Collections.reverse(clist);
   return l.getFactory().createLineString((Coordinate[]) clist.toArray(new Coordinate[1]));
 }
 protected static Geometry transformLineString(CoordinateTransform ct, LineString lineString) {
   return lineString
       .getFactory()
       .createLineString(transformCoordinates(ct, lineString.getCoordinates()));
 }