Package com.spatial4j.core.shape

Examples of com.spatial4j.core.shape.Shape.relate()


    factory.validationRule = JtsWktShapeParser.ValidationRule.repairConvexHull;
    ctx = factory.newSpatialContext();
    Shape cvxHull = ctx.readShapeFromWkt(wkt);
    assertTrue(cvxHull.getArea(ctx) > 0);

    assertEquals(SpatialRelation.CONTAINS, cvxHull.relate(buffer0));

    factory = new JtsSpatialContextFactory();
    factory.validationRule = JtsWktShapeParser.ValidationRule.none;
    ctx = factory.newSpatialContext();
    ctx.readShapeFromWkt(wkt);//doesn't throw
View Full Code Here


            assert values.size() == 2;
            leftShape = SpatialContext.GEO.makePoint((Double) values.get(0), (Double) values.get(1));
        } else {
            leftShape = (Shape)left;
        }
        return leftShape.relate((Shape) right) == SpatialRelation.WITHIN;
    }

    @Override
    public FunctionInfo info() {
        return info;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.