@Test public void testTurfLineSliceLine1() throws IOException, TurfException { Point start = Point.fromLngLat(-97.79617309570312, 22.254624939561698); Point stop = Point.fromLngLat(-97.72750854492188, 22.057641623615734); Feature line1 = Feature.fromJson(loadJsonFixture(LINE_SLICE_ONE)); LineString sliced = TurfMisc.lineSlice(start, stop, line1); assertNotNull(sliced); }
@NonNull public static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt, @NonNull Feature line) { if (line.geometry() == null) { throw new NullPointerException("Feature.geometry() == null"); } if (!line.geometry().type().equals("LineString")) { throw new TurfException("input must be a LineString Feature or Geometry"); } return lineSlice(startPt, stopPt, (LineString) line.geometry()); }
TurfMisc { @NonNull public static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt, @NonNull Feature line) { if (line.geometry() == null) { throw new NullPointerException("Feature.geometry() == null"); } if (!line.geometry().type().equals("LineString")) { throw new TurfException("input must be a LineString Feature or Geometry"); } return lineSlice(startPt, stopPt, (LineString) line.geometry()); } }
TurfMisc { @NonNull public static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt, @NonNull Feature line) { if (line.geometry() == null) { throw new NullPointerException("Feature.geometry() == null"); } if (!line.geometry().type().equals("LineString")) { throw new TurfException("input must be a LineString Feature or Geometry"); } return lineSlice(startPt, stopPt, (LineString) line.geometry()); } private  TurfMisc(); }
TurfMisc { @NonNull public static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt, @NonNull Feature line) { if (line.geometry() == null) { throw new NullPointerException("Feature.geometry() == null"); } if (!line.geometry().type().equals("LineString")) { throw new TurfException("input must be a LineString Feature or Geometry"); } return lineSlice(startPt, stopPt, (LineString) line.geometry()); } private  TurfMisc(); @NonNull static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt,
                                     @NonNull Feature line); @NonNull static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt,
                                     @NonNull LineString line); @NonNull static LineString lineSliceAlong(@NonNull Feature line,
                                          @FloatRange(from = 0) double startDist,
                                          @FloatRange(from = 0) double stopDist,
                                          @NonNull @TurfConstants.TurfUnitCriteria String units); @NonNull static LineString lineSliceAlong(@NonNull LineString line,
                                          @FloatRange(from = 0) double startDist,
                                          @FloatRange(from = 0) double stopDist,
                                          @NonNull @TurfConstants.TurfUnitCriteria String units); @NonNull static Feature nearestPointOnLine(@NonNull Point pt, @NonNull List<Point> coords); @NonNull static Feature nearestPointOnLine(@NonNull Point pt, @NonNull List<Point> coords,
                                           @Nullable @TurfConstants.TurfUnitCriteria String units); }
TurfMisc { @NonNull public static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt, @NonNull Feature line) { if (line.geometry() == null) { throw new NullPointerException("Feature.geometry() == null"); } if (!line.geometry().type().equals("LineString")) { throw new TurfException("input must be a LineString Feature or Geometry"); } return lineSlice(startPt, stopPt, (LineString) line.geometry()); } private  TurfMisc(); @NonNull static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt,
                                     @NonNull Feature line); @NonNull static LineString lineSlice(@NonNull Point startPt, @NonNull Point stopPt,
                                     @NonNull LineString line); @NonNull static LineString lineSliceAlong(@NonNull Feature line,
                                          @FloatRange(from = 0) double startDist,
                                          @FloatRange(from = 0) double stopDist,
                                          @NonNull @TurfConstants.TurfUnitCriteria String units); @NonNull static LineString lineSliceAlong(@NonNull LineString line,
                                          @FloatRange(from = 0) double startDist,
                                          @FloatRange(from = 0) double stopDist,
                                          @NonNull @TurfConstants.TurfUnitCriteria String units); @NonNull static Feature nearestPointOnLine(@NonNull Point pt, @NonNull List<Point> coords); @NonNull static Feature nearestPointOnLine(@NonNull Point pt, @NonNull List<Point> coords,
                                           @Nullable @TurfConstants.TurfUnitCriteria String units);  }