Package com.impetus.kundera.gis.geometry

Examples of com.impetus.kundera.gis.geometry.Polygon


        LinearRing shell = new LinearRing(points, factory);
        LinearRing[] holes = new LinearRing[0];
        // holes[0] = shell;

        Polygon polygon = new Polygon(shell, holes, factory);
        List<Person> persons = dao.findWithinPolygon(polygon);
        Assert.assertNotNull(persons);
        Assert.assertFalse(persons.isEmpty());
        Assert.assertTrue(persons.size() == 11);
        dao.closeEntityManager();

        dao.createEntityManager();

        holes = new LinearRing[1];
        holes[0] = shell;
        polygon = new Polygon(shell, holes, factory);
        persons = dao.findWithinPolygon(polygon);
        Assert.assertNotNull(persons);
        Assert.assertFalse(persons.isEmpty());
        Assert.assertTrue(persons.size() == 8);
        dao.closeEntityManager();
View Full Code Here


    @Override
    public Object createGeospatialQuery(String geolocationColumnName, Object shape, Object query)
    {
        List polygonList = new ArrayList();

        Polygon polygon = (Polygon) shape;

        for (Coordinate c : polygon.getCoordinates())
        {
            polygonList.add(new double[] { c.x, c.y });
        }

        BasicDBObject q = (BasicDBObject) query;
View Full Code Here

TOP

Related Classes of com.impetus.kundera.gis.geometry.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.