/** * Transform into GeometryCollection. * * @param geom * input geometry * @return * a geometry collection */ private static GeometryCollection transformIntoPointGeometryCollection(Geometry geom) { UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter(); geom.apply(filter); Coordinate[] coord = filter.getCoordinates(); Geometry[] geometries = new Geometry[coord.length]; for (int i = 0 ; i < coord.length ; i++) { Coordinate[] c = new Coordinate[] { coord[i] }; CoordinateArraySequence cs = new CoordinateArraySequence(c); geometries[i] = new Point(cs, geom.getFactory()); } return new GeometryCollection(geometries, geom.getFactory()); }
/** * Transform into GeometryCollection. * * @param geom * input geometry * @return * a geometry collection */ private static GeometryCollection transformIntoPointGeometryCollection(GeometryCollection gc) { UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter(); gc.apply(filter); Coordinate[] coord = filter.getCoordinates(); Geometry[] geometries = new Geometry[coord.length]; for (int i = 0 ; i < coord.length ; i++) { Coordinate[] c = new Coordinate[] { coord[i] }; CoordinateArraySequence cs = new CoordinateArraySequence(c); geometries[i] = new Point(cs, gc.getFactory()); } return new GeometryCollection(geometries, gc.getFactory()); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(com.vividsolutions.jts.geom.CoordinateSequence) */ public CoordinateSequence create(CoordinateSequence coordSeq) { return new CoordinateArraySequence(coordSeq); }
/** * Returns a {@link CoordinateArraySequence} based on the given array (the array is * not copied). * * @param coordinates * the coordinates, which may not be null nor contain null * elements */ public CoordinateSequence create(Coordinate[] coordinates) { return new CoordinateArraySequence(coordinates); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(int, int) * * @throws IllegalArgumentException if the dimension is > 3 */ public CoordinateSequence create(int size, int dimension) { if (dimension > 3) throw new IllegalArgumentException("dimension must be <= 3"); return new CoordinateArraySequence(size, dimension); } }
public String toString() { return WKTWriter.toLineString(new CoordinateArraySequence(pts)); } }
public String toString() { return WKTWriter.toLineString(new CoordinateArraySequence(pts)); } }
/** * Creates a deep copy of the Object * * @return The deep copy */ public Object clone() { Coordinate[] cloneCoordinates = new Coordinate[size()]; for (int i = 0; i < coordinates.length; i++) { cloneCoordinates[i] = (Coordinate) coordinates[i].clone(); } return new CoordinateArraySequence(cloneCoordinates); } /**
+ ", DD result = " + isInCircleDD + ", CC result = " + isInCircleCC + ")"); System.out.println(WKTWriter.toLineString(new CoordinateArraySequence( new Coordinate[] { a, b, c, p }))); System.out.println("Circumcentre = " + WKTWriter.toPoint(circumCentre)
/** * Returns a {@link CoordinateArraySequence} based on the given array (the array is * not copied). * * @param coordinates * the coordinates, which may not be null nor contain null * elements */ public CoordinateSequence create(Coordinate[] coordinates) { return new CoordinateArraySequence(coordinates); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(com.vividsolutions.jts.geom.CoordinateSequence) */ public CoordinateSequence create(CoordinateSequence coordSeq) { return new CoordinateArraySequence(coordSeq); }
public String toString() { return WKTWriter.toLineString(new CoordinateArraySequence(pts)); } }
public String toString() { return WKTWriter.toLineString(new CoordinateArraySequence(pts)); } }
@Override public Iterator<Long> iterator() { return new CoordIterator(new CoordinateArraySequence(mp.getCoordinates()), false); } });
@Override public void setPosition(double longitude, double latitude) { Coordinate[] coordinates = new Coordinate[]{new Coordinate(longitude, latitude)}; CoordinateSequence coordSequence = new CoordinateArraySequence(coordinates); Point point = new Point(coordSequence, new GeometryFactory()); setGeometry(point); }
@Override public Point getCentroid() { Coordinate[] coordinates = new Coordinate[]{new Coordinate(machine.getLongitude(), machine.getLatitude())}; CoordinateSequence coordSequence = new CoordinateArraySequence(coordinates); return new Point(coordSequence, new GeometryFactory()); }
/** * Gets a string representation of this object. * * @return a string representing the object */ public String toString() { return WKTWriter.toLineString(new CoordinateArraySequence(getCoordinates())); }
@Override public Point convert(final Location location) { final Coordinate coordinate = LOCATION_CONVERTER.convert(location); final CoordinateArraySequence sequence = new CoordinateArraySequence( new Coordinate[] { coordinate }); return new Point(sequence, GEOMETRY_FACTORY); } }
public static Point getPoint(double lat, double lon) { Coordinate[] coords = new Coordinate[1]; coords[0] = new Coordinate(lon, lat); CoordinateArraySequence coordArraySeq = new CoordinateArraySequence(coords); return new Point(coordArraySeq, new GeometryFactory(new PrecisionModel(), 4326)); } }
public static Point getPoint(double lat, double lon) { Coordinate[] coords = new Coordinate[1]; coords[0] = new Coordinate(lon, lat); CoordinateArraySequence coordArraySeq = new CoordinateArraySequence(coords); return new Point(coordArraySeq, new GeometryFactory(new PrecisionModel(), 4326)); } }