Class JtsHelper



  • public class JtsHelper
    extends Object
    Various utility methods for JTS.
    • Constructor Detail

      • JtsHelper

        public JtsHelper()
    • Method Detail

      • toLineString

        public static LineString toLineString(List<Double> xs,
                                              List<Double> ys)
        Create a LineString from the denoted list of coordinates. The i'th point of the string is represented by (xs[i], ys[i]).
        Parameters:
        xs - the x values.
        ys - the y values.
        Returns:
        the created LineString instance.
      • toLineString

        public static LineString toLineString(TDoubleList xs,
                                              TDoubleList ys)
        Create a LineString from the denoted list of coordinates. The i'th point of the string is represented by (xs[i], ys[i]).
        Parameters:
        xs - the x values.
        ys - the y values.
        Returns:
        the created LineString instance.
      • toLinearRing

        public static LinearRing toLinearRing(List<Double> xs,
                                              List<Double> ys,
                                              boolean doublePoint)
        Create a LinearRing from two lists of coordinates. The i'th point of the ring is represented by (xs[i], ys[i]).
        Parameters:
        xs - the list of x-coordinates.
        ys - the list of y-coordinates.
        doublePoint - whether the first point is explicitly contained in the lists a second time as the last point.
        Returns:
        the constructed ring.
      • toLinearRing

        public static LinearRing toLinearRing(TDoubleList xs,
                                              TDoubleList ys,
                                              boolean doublePoint)
        Create a LinearRing from two lists of coordinates. The i'th point of the ring is represented by (xs[i], ys[i]).
        Parameters:
        xs - the list of x-coordinates.
        ys - the list of y-coordinates.
        doublePoint - whether the first point is explicitly contained in the lists a second time as the last point.
        Returns:
        the constructed ring.