Package org.geolatte.geom

Examples of org.geolatte.geom.Polygon


        }
        List<LinearRing> linearRings = Lists.newArrayList();
        for (int i = figureOffset; i <= figureStopIdx; i++) {
            linearRings.add(new LinearRing(createPoints(i)));
        }
        return new Polygon(linearRings.toArray(new LinearRing[0]));
    }
View Full Code Here


    private static Polygon convert(org.postgis.Polygon geometry) {
        LinearRing[] rings = new LinearRing[geometry.numRings()];
        for (int i = 0; i < rings.length; i++) {
            rings[i] = convert(geometry.getRing(i));
        }
        return new Polygon(rings);
    }
View Full Code Here

        }
    }

    @Test
    public void Polygon() {
        Polygon polygon = (org.geolatte.geom.Polygon) Wkt.fromWkt("POLYGON (" +
            "(30 10, 40 40, 20 40, 10 20, 30 10), " +
            "(20 30, 35 35, 30 20, 20 30))");
        JGeometry geo = JGeometryConverter.convert(polygon);

        double[] extRing = new double[]{30, 10, 40, 40, 20, 40, 10, 20, 30, 10};
        double[] intRing = new double[]{20, 30, 35, 35, 30, 20, 20, 30};
        JGeometry geo2 = JGeometry.createLinearPolygon(new Object[]{extRing, intRing},
                polygon.getCoordinateDimension(), polygon.getSRID());
        assertEquals(geo2, geo);
    }
View Full Code Here

TOP

Related Classes of org.geolatte.geom.Polygon

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.