Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Expression.evaluate()


    public <T> T evaluate(Object object, Class<T> context) {
        final Expression expr = parameters.get(0);
        Expression vocab = parameters.get(1);
       
        String key = expr.evaluate(object, String.class);
        String urn = vocab.evaluate(object, String.class);
       
        Properties lookup = lookup( urn );
        if( lookup == null ){
            throw new RuntimeException("Unable to resolve lookup table "+urn);
        }
View Full Code Here


            } else {
                // 2D
                geom = new DirectPosition2D();
                geom.setOrdinate(1, parameters.get(1).evaluate(object, Double.class));
            }
            geom.setOrdinate(0, param1.evaluate(object, Double.class));
        }

        return (T) geom;
    }
View Full Code Here

        if (parameters.size() <= 3) {
            // create 1D envelope
            Expression x = parameters.get(0);
            Expression y = parameters.get(1);
            double xvalue = x.evaluate(object, Double.class);
            double yvalue = y.evaluate(object, Double.class);
            if (parameters.size() == 3) {
                // coordinate reference system name provided
                crsexists = true;
                Expression crs = parameters.get(2);
                String crsvalue = crs.evaluate(object, String.class);
View Full Code Here

            double yvalue = y.evaluate(object, Double.class);
            if (parameters.size() == 3) {
                // coordinate reference system name provided
                crsexists = true;
                Expression crs = parameters.get(2);
                String crsvalue = crs.evaluate(object, String.class);
                try {
                    sourceCRS = CRS.decode(crsvalue);
                } catch (NoSuchAuthorityCodeException e) {
                    throw new IllegalArgumentException(
                            "Invalid or unsupported SRS name detected for toEnvelope function: "
View Full Code Here

            Expression miny = parameters.get(2);
            Expression maxy = parameters.get(3);
            double minxvalue = minx.evaluate(object, Double.class);
            double minyvalue = miny.evaluate(object, Double.class);
            double maxxvalue = maxx.evaluate(object, Double.class);
            double maxyvalue = maxy.evaluate(object, Double.class);
            if (parameters.size() == 5) {
                // coordinate reference system name provided
                crsexists = true;
                Expression crs = parameters.get(4);
                String crsvalue = crs.evaluate(object, String.class);
View Full Code Here

            double maxyvalue = maxy.evaluate(object, Double.class);
            if (parameters.size() == 5) {
                // coordinate reference system name provided
                crsexists = true;
                Expression crs = parameters.get(4);
                String crsvalue = crs.evaluate(object, String.class);
                try {
                    sourceCRS = CRS.decode(crsvalue);
                } catch (NoSuchAuthorityCodeException e) {
                    throw new IllegalArgumentException(
                            "Invalid or unsupported SRS name detected for toEnvelope function: "
View Full Code Here

                        "Wrong number of parameters for toPoint function: " + parameters.toString()
                                + ". " + USAGE);
            }
            GeometryFactory fac = new GeometryFactory();

            point = fac.createPoint(new Coordinate(param1.evaluate(object, Double.class),
                    parameters.get(1).evaluate(object, Double.class)));

            if (parameters.size() == 3) {
                String gmlId = parameters.get(2).evaluate(object, String.class);
                setUserData(point, null, gmlId);
View Full Code Here

    // TYPE of the operation to perform
    //
    // /////////////////////////////////////////////////////////////////////
    final Expression expType = ce.getType();
    if (expType != null) {
      final String type = expType.evaluate(null, String.class);
      if (type != null) {
        this.type = type.toUpperCase();
        if (!SUPPORTED_HE_ALGORITHMS.contains(type.toUpperCase()))
          throw new IllegalArgumentException(Errors.format(ErrorKeys.OPERATION_NOT_FOUND_$1, type.toUpperCase()));
      }
View Full Code Here

    // GAMMA
    //
    // /////////////////////////////////////////////////////////////////////
    final Expression gamma = ce.getGammaValue();
    if (gamma != null) {
      final Number number = gamma.evaluate(null, Double.class);
      if (number != null) {
        gammaValue = number.doubleValue();
        // check the gamma value
        if (gammaValue < 0)
          throw new IllegalArgumentException(Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "Gamma", number));
View Full Code Here

                if (spatialIndex != null) {
                    //property map the column type
                    if (primaryKey.getColumns().size() == 1 &&
                        Number.class.isAssignableFrom(primaryKey.getColumns().get(0).getType())) {
                       
                        Envelope e = geometry.evaluate(null, Envelope.class);
                       
                        out.write( " AND ");
                        out.write("\"" + primaryKey.getColumns().get(0).getName() + "\" ");
                        out.write( "IN (");
                        out.write("SELECT CAST(HATBOX_JOIN_ID AS INT)");
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.