@Override public Points getControlPoints() { return ( (LineString) members.get( 0 ) ).getControlPoints(); }
private float[] extractGeometries( LineString lineString, double[] min, double[] max ) { float[] coordinates = null; if ( lineString != null ) { double[] c = lineString.getControlPoints().getAsArray(); if ( c != null && c.length > 0 ) { if ( c.length % 3 == 0 ) { coordinates = new float[c.length]; for ( int i = 0; i + 2 < c.length; i += 3 ) { coordinates[i] = (float) ( translation[0] + c[i] ); coordinates[i + 1] = (float) ( translation[1] + c[i + 1] ); coordinates[i + 2] = (float) ( translation[2] + c[i + 2] ); updateMinMax( min, max, coordinates, i ); } } else { LOG.warn( "The coordinates in a linestring must be a multiple of 3 (3-dimensions)" ); } } else { LOG.warn( "No coordinates found in linestring, this is strange." ); } } return coordinates; }
/** * Writes the LINESTRING without the 'LINESTRING()'-specific envelope. <br/> * It writes just the LINESTRING-coordinates. * * @param geometry * @param writer * @throws IOException */ private void writeLineStringWithoutPrefix( LineString geometry, Writer writer ) throws IOException { Points points = geometry.getControlPoints(); int counter = 0; for ( Point p : points ) { counter++; if ( counter < points.size() ) { writePointWithoutPrefix( p, writer ); writer.append( ',' ); } else { writePointWithoutPrefix( p, writer ); } } }
for ( Point p : linestring.getControlPoints() ) { double x = p.get0(); double y = p.get1();
export( lineString.getControlPoints(), dim ); exportAdditionalProps( lineString ); writer.writeEndElement();
Curve c = (Curve) geom; LinkedList<Point> ps = new LinkedList<Point>(); for ( Point p : c.getAsLineString().getControlPoints() ) { ps.add( (Point) move( p, offx, offy ) ); movedExteriorRing = fac.createLinearRing( exterior.getId(), exterior.getCoordinateSystem(), move( exterior.getAsLineString().getControlPoints(), offx, offy ) ); movedInteriorRings.add( fac.createLinearRing( interior.getId(), interior.getCoordinateSystem(), move( interior.getAsLineString().getControlPoints(), offx, offy ) ) );
private void traverseCurve( Curve c ) { CurveType ct = c.getCurveType(); switch ( ct ) { case CompositeCurve: for ( Curve member : ( (CompositeCurve) c ) ) { traverse( member ); } break; case Curve: case Ring: for ( CurveSegment segment : c.getCurveSegments() ) { traverseSegment( segment ); } break; case LineString: traversePoints( ( (LineString) c ).getControlPoints() ); break; case OrientableCurve: traverse( ( (OrientableCurve) c ).getBaseCurve() ); break; } }
Points fixedPoints = getFixedPoints( lineString.getControlPoints(), lastPoint ); fixedCurve = new DefaultLineString( curve.getId(), curve.getCoordinateSystem(), curve.getPrecision(), fixedPoints );
GeometryFactory geomFac = new GeometryFactory(); CurveSegment[] segments = new CurveSegment[1]; segments[0] = geomFac.createLineStringSegment( p.getControlPoints() ); geom = geomFac.createCurve( geom.getId(), geom.getCoordinateSystem(), segments );
LineString lineString = (LineString) curve; fixedCurve = new DefaultLineString( curve.getId(), curve.getCoordinateSystem(), curve.getPrecision(), invertOrientation( lineString.getControlPoints() ) ); break;