Package org.opengis.geometry.coordinate

Examples of org.opengis.geometry.coordinate.LineString


     *
     * @param points
     * @return <tt>LineString</tt>
     */
    protected LineString createLineString(final DirectPosition[] points) {
        final LineString lineString = gFact.createLineString(new ArrayList(Arrays.asList(points)));
        return lineString;
    }
View Full Code Here


    dps.add(builder.createDirectPosition(new double[] { 30, 50 }));
    dps.add(builder.createDirectPosition(new double[] { 10, 30 }));
    dps.add(builder.createDirectPosition(new double[] { 20, 10 }));

    // create linestring from directpositions
    LineString line = builder.createLineString(dps);

    // create curvesegments from line
    ArrayList<CurveSegment> segs = new ArrayList<CurveSegment>();
    segs.add(line);
View Full Code Here

     *
     * @param points
     * @return <tt>LineString</tt>
     */
    protected LineString createLineString(final DirectPosition[] points) {
        final LineString lineString = gFact.createLineString(new ArrayList(Arrays.asList(points)));
        return lineString;
    }
View Full Code Here

        GeometryFactory geometryFactory = builder.getGeometryFactory();
        CoordinateReferenceSystem crs = builder.getCoordinateReferenceSystem();
       
        int length = array.length / crs.getCoordinateSystem().getDimension();
        PointArray closedPoints = postitionFactory.createPointArray( array, 0, length );
        LineString lines = geometryFactory.createLineString(closedPoints);       
        List<CurveSegment> segmentList = new ArrayList<CurveSegment>();
        segmentList.add(lines);
       
        Curve curve = primitiveFactory.createCurve(segmentList);
       
View Full Code Here

    List<Position> points = new ArrayList<Position>();
    points.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
    points.add(primitiveFactory.createPoint( new double[]{-123.46972894676578,48.55009592117936} ));
    points.add(primitiveFactory.createPoint( new double[]{-123.45463828850829,48.54973520267305} ));
    points.add(primitiveFactory.createPoint( new double[]{-123.4550070827961,48.54290089070186} ));
        LineString lineString = geometryFactory.createLineString(points);
        List curveSegmentList = Collections.singletonList(lineString);
       
        CurveImpl curve1 = (CurveImpl) primitiveFactory.createCurve(curveSegmentList);
        CurveImpl curve2 = (CurveImpl) curve1.transform(crs2);
       
    // create expected result
    PositionFactory expectedPosF2 = new PositionFactoryImpl(crs2, new PrecisionModel());
    PrimitiveFactory expectedPrimF2 = new PrimitiveFactoryImpl(crs2, expectedPosF2);
    GeometryFactory ExpectedGeomF2 = new GeometryFactoryImpl(crs2, expectedPosF2);
   
    List<Position> expectedPoints = new ArrayList<Position>();
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187127.9999999998, 396026.99999999825} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000007, 396027.0000000039} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000005, 395268.0000000018} ));
        LineString expectedLineString = ExpectedGeomF2.createLineString(expectedPoints);
        List expectedCurveSegmentList = Collections.singletonList(expectedLineString);
       
        CurveImpl expectedCurve = (CurveImpl) expectedPrimF2.createCurve(expectedCurveSegmentList);
   
    //System.out.println(curve1);
View Full Code Here

    points1.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.46972894676578,48.55009592117936} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.45463828850829,48.54973520267305} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.4550070827961,48.54290089070186} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
    LineString lineString1 = geometryFactory.createLineString(points1);
        List curveSegmentList1 = Collections.singletonList(lineString1);
       
        CurveImpl curve1 = (CurveImpl) primitiveFactory.createCurve(curveSegmentList1);
       
    /* Build Ring from Curve */
    ArrayList<OrientableCurve> curveList = new ArrayList<OrientableCurve>();
    curveList.add(curve1);
   
    RingImplUnsafe ring1 = (RingImplUnsafe) primitiveFactory.createRing(curveList);
    RingImplUnsafe ring2 = (RingImplUnsafe) ring1.transform(crs2);
   
    // create expected result
    PositionFactory expectedPosF2 = new PositionFactoryImpl(crs2, new PrecisionModel());
    PrimitiveFactory expectedPrimF2 = new PrimitiveFactoryImpl(crs2, expectedPosF2);
    GeometryFactory ExpectedGeomF2 = new GeometryFactoryImpl(crs2, expectedPosF2);
   
    List<Position> expectedPoints = new ArrayList<Position>();
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187127.9999999998, 396026.99999999825} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000007, 396027.0000000039} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000005, 395268.0000000018} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
        LineString expectedLineString = ExpectedGeomF2.createLineString(expectedPoints);
        List expectedCurveSegmentList = Collections.singletonList(expectedLineString);
       
        CurveImpl expectedCurve = (CurveImpl) expectedPrimF2.createCurve(expectedCurveSegmentList);
       
    /* Build Ring from Curve */
 
View Full Code Here

    points1.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.46972894676578,48.55009592117936} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.45463828850829,48.54973520267305} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.4550070827961,48.54290089070186} ));
    points1.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
    LineString lineString1 = geometryFactory.createLineString(points1);
        List curveSegmentList1 = Collections.singletonList(lineString1);
       
        CurveImpl curve1 = (CurveImpl) primitiveFactory.createCurve(curveSegmentList1);
       
    /* Build Ring from Curve */
    ArrayList<OrientableCurve> curveList = new ArrayList<OrientableCurve>();
    curveList.add(curve1);
   
    // Build Ring then SurfaceBoundary then Surface
    RingImpl exteriors = (RingImpl) primitiveFactory.createRing(curveList);
    List<Ring> interiors = new ArrayList<Ring>();
    SurfaceBoundary sboundary = primitiveFactory.createSurfaceBoundary(exteriors, interiors);
    Surface surface1 = primitiveFactory.createSurface(sboundary);
    Surface surface2 = (SurfaceImpl) surface1.transform(crs2);
   
    // create expected result
    PositionFactory expectedPosF2 = new PositionFactoryImpl(crs2, new PrecisionModel());
    PrimitiveFactory expectedPrimF2 = new PrimitiveFactoryImpl(crs2, expectedPosF2);
    GeometryFactory ExpectedGeomF2 = new GeometryFactoryImpl(crs2, expectedPosF2);
   
    List<Position> expectedPoints = new ArrayList<Position>();
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187127.9999999998, 396026.99999999825} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000007, 396027.0000000039} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000005, 395268.0000000018} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
        LineString expectedLineString = ExpectedGeomF2.createLineString(expectedPoints);
        List expectedCurveSegmentList = Collections.singletonList(expectedLineString);
       
        CurveImpl expectedCurve = (CurveImpl) expectedPrimF2.createCurve(expectedCurveSegmentList);
       
    /* Build Ring from Curve */
 
View Full Code Here

    positions .add(start);
    positions.add(middle);
    positions.add(end);

//     create linestring from directpositions
    LineString line = geomF.createLineString(positions);

//     create curvesegments from line
    ArrayList<CurveSegment> segs = new ArrayList<CurveSegment>();
    segs.add(line);
View Full Code Here

     * @throws IOException    if an I/O error occurs
     * @throws ParseException if an unexpected token was encountered
     */
    private Curve readLineStringText(StreamTokenizer tokenizer) throws IOException, ParseException {
        List coordList = getCoordinates(tokenizer);
        LineString lineString = geometryFactory.createLineString(coordList);
        List curveSegmentList = Collections.singletonList(lineString);
        Curve curve = primitiveFactory.createCurve(curveSegmentList);
        return curve;
    }
View Full Code Here

     *                        encountered
     */
    private Curve readLinearRingText(StreamTokenizer tokenizer)
            throws IOException, ParseException {
        List coordList = getCoordinates(tokenizer);
        LineString lineString = geometryFactory.createLineString(coordList);
        List curveSegmentList = Collections.singletonList(lineString);
        Curve curve = primitiveFactory.createCurve(curveSegmentList);
        return curve;
        //List curveList = Collections.singletonList(curve);
        //return primitiveFactory.createRing(curveList);
View Full Code Here

TOP

Related Classes of org.opengis.geometry.coordinate.LineString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.