01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.geometry.jts;
17:
18: import com.vividsolutions.jts.geom.Coordinate;
19: import com.vividsolutions.jts.geom.CoordinateSequence;
20: import com.vividsolutions.jts.geom.CoordinateSequenceFactory;
21:
22: /**
23: * @TODO class description
24: *
25: * @author jeichar
26: * @since 2.1.x
27: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/geometry/jts/LiteCoordinateSequenceFactory.java $
28: */
29: public class LiteCoordinateSequenceFactory implements
30: CoordinateSequenceFactory {
31:
32: /* (non-Javadoc)
33: * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(com.vividsolutions.jts.geom.Coordinate[])
34: */
35: public CoordinateSequence create(Coordinate[] coordinates) {
36: return new LiteCoordinateSequence(coordinates);
37: }
38:
39: /* (non-Javadoc)
40: * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(com.vividsolutions.jts.geom.CoordinateSequence)
41: */
42: public CoordinateSequence create(CoordinateSequence coordSeq) {
43: return new LiteCoordinateSequence(coordSeq.toCoordinateArray());
44: }
45:
46: /* (non-Javadoc)
47: * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(int, int)
48: */
49: public CoordinateSequence create(int size, int dimension) {
50: return new LiteCoordinateSequence(size, dimension);
51: }
52:
53: /**
54: * @param points
55: */
56: public CoordinateSequence create(double[] points) {
57: return new LiteCoordinateSequence(points);
58: }
59: }
|