GeometryUtils.adjustCoordinateDimensionToRange(Double.parseDouble(vals[0]), crs, 1); currLng = GeometryUtils.adjustCoordinateDimensionToRange(Double.parseDouble(vals[1]), crs, 0); final Coordinate cord = new Coordinate(currLng, currLat); pts.add(cord);
/** * Make sure the coordinate falls in the range of provided coordinate reference systems's * coordinate system. 'x' coordinate is wrapped around date line. 'y' and 'z' coordinate are * clipped. At some point, this function will be adjusted to project 'y' appropriately. * * @param crs * @param coord * @return */ public static Coordinate adjustCoordinateToFitInRange( final CoordinateReferenceSystem crs, final Coordinate coord) { return new Coordinate( adjustCoordinateDimensionToRange(coord.getX(), crs, 0), clipRange(coord.getY(), crs, 1), clipRange(coord.getZ(), crs, 2)); }