Examples of GeometryAttribute


Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

    protected void addGeometry(Set<Attribute> resources, URI attributeURI, Geometry g,
            String srsName) {

        String gmlType = XACMLUtil.getGMLTypeFor(g);

        GeometryAttribute geomAttr = null;
        try {
            geomAttr = new GeometryAttribute(g, srsName, null, GMLVersion.Version3, gmlType);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
        resources.add(new Attribute(attributeURI, null, null, geomAttr));
    }
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

            retVal = new DateTimeAttribute((Date) object);
        if (object instanceof Geometry) {
            Geometry g = (Geometry) object;
            String gmlType = XACMLUtil.getGMLTypeFor(g);
            try {
                retVal = new GeometryAttribute(g, g.getUserData().toString(), null,
                        GMLVersion.Version3, gmlType);
            } catch (URISyntaxException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

        Result result = response.getResults().iterator().next();
        assertNotNull(result);
        Obligation obligation = result.getObligations().iterator().next();
        assertNotNull(obligation);
        Attribute assignment = obligation.getAssignments().iterator().next();
        GeometryAttribute geomAttr = (GeometryAttribute) assignment.getValue();
        assertNotNull(geomAttr.getGeometry());

    }
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

    protected void addGeometry(Set<Attribute> resources, URI attributeURI, Geometry g,
            String srsName) {

        String gmlType = XACMLUtil.getGMLTypeFor(g);

        GeometryAttribute geomAttr = null;
        try {
            geomAttr = new GeometryAttribute(g, srsName, null, GMLVersion.Version3, gmlType);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
        resources.add(new Attribute(attributeURI, null, null, geomAttr));
    }
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

        AttributeValue[] argValues = new AttributeValue[inputs.size()];
        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        GeometryAttribute geomAttr = (GeometryAttribute) (argValues[0]);
        DoubleAttribute doubleAttr = (DoubleAttribute) (argValues[1]);

        Geometry resultGeom = null;

        try {
            resultGeom = geomAttr.getGeometry().buffer(doubleAttr.getValue());
        } catch (Throwable t) {
            return exceptionError(t);
        }

        return createGeometryInBagResult(resultGeom, geomAttr.getSrsName());

    }
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

            retVal = new DateTimeAttribute((Date) object);
        if (object instanceof Geometry) {
            Geometry g = (Geometry) object;
            String gmlType = XACMLUtil.getGMLTypeFor(g);
            try {
                retVal = new GeometryAttribute(g, g.getUserData().toString(), null,
                        GMLVersion.Version3, gmlType);
            } catch (URISyntaxException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

        AttributeValue[] argValues = new AttributeValue[inputs.size()];
        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        GeometryAttribute geomAttr = (GeometryAttribute) (argValues[0]);

        Geometry resultGeom = null;

        try {
            resultGeom = geomAttr.getGeometry().convexHull();
        } catch (Throwable t) {
            return exceptionError(t);
        }

        GeometryAttribute resultAttr = null;

        try {
            resultAttr = new GeometryAttribute(resultGeom, geomAttr.getSrsName(), null, null, null);
        } catch (URISyntaxException e) {
            // should not happend
        }
        return new EvaluationResult(resultAttr);
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

        AttributeValue[] argValues = new AttributeValue[inputs.size()];
        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        GeometryAttribute geomAttr1 = (GeometryAttribute) (argValues[0]);
        GeometryAttribute geomAttr2 = (GeometryAttribute) (argValues[1]);
        DoubleAttribute withinDistance = (DoubleAttribute) (argValues[2]);

        boolean evalResult = false;

        try {
            evalResult = geomAttr1.getGeometry().isWithinDistance(geomAttr2.getGeometry(),
                    withinDistance.getValue());
        } catch (Throwable t) {
            return exceptionError(t);
        }
        return EvaluationResult.getInstance(evalResult);
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

        AttributeValue[] argValues = new AttributeValue[inputs.size()];
        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        GeometryAttribute geomAttr = (GeometryAttribute) (argValues[0]);

        boolean evalResult = false;

        try {
            evalResult = geomAttr.getGeometry().isSimple();
        } catch (Throwable t) {
            return exceptionError(t);
        }
        return EvaluationResult.getInstance(evalResult);
View Full Code Here

Examples of org.geotools.xacml.geoxacml.attr.GeometryAttribute

        AttributeValue[] argValues = new AttributeValue[inputs.size()];
        EvaluationResult result = evalArgs(inputs, context, argValues);
        if (result != null)
            return result;

        GeometryAttribute geomAttr = (GeometryAttribute) (argValues[0]);

        double length = 0;

        try {
            length = geomAttr.getGeometry().getLength();
        } catch (Throwable t) {
            return exceptionError(t);
        }

        return new EvaluationResult(new DoubleAttribute(length));
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.