}
if(tripPattern.shape != null) {
MathTransform mt = GeoUtils.getTransform(new Coordinate(tripPattern.shape.shape.getCoordinateN(0).y, tripPattern.shape.shape.getCoordinateN(0).x));
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4326);
Coordinate[] mCoords = tripPattern.shape.shape.getCoordinates();
ArrayList<Coordinate> coords = new ArrayList<Coordinate>();
for(Coordinate mCoord : mCoords) {
coords.add(new Coordinate(mCoord.x, mCoord.y));
}
Coordinate[] coordArray = coords.toArray(new Coordinate[coords.size()]);
LineString ls = (LineString) JTS.transform(geometryFactory.createLineString(coordArray), mt);
LocationIndexedLine indexLine = new LocationIndexedLine(ls);
Logger.info("length: " + ls.getLength());
patternStops = TripPatternStop.find("pattern = ?", tripPattern).fetch();