Package org.opengis.filter.expression

Examples of org.opengis.filter.expression.Literal


    }

    private void checkOpacity(Expression exp) {
        if (exp != null) {
            if (exp instanceof Literal) {
                Literal literal = (Literal) exp;
                Object obj = literal.getValue();
                float opacity;

                if (obj instanceof Integer) {
                    Integer i = (Integer) obj;
                    opacity = i.floatValue();
View Full Code Here


        if (strs.length != 2) {
            throw new IllegalArgumentException(
                "A ranged filter could not be created from the styleExpression given.");
        }

        Literal localMin = ff.literal(strs[0]);
        Literal localMax = ff.literal(strs[1]);
        Filter lowerBound = ff.lessOrEqual(localMin, localMax);
        Filter upperBound;
        if (upperBoundClosed) {
            upperBound = ff.lessOrEqual(attrib, localMax);
        } else {
View Full Code Here

    }

    public void testWellKnownTextLineString() {
  WKTMarkFactory wmf = new WKTMarkFactory();
  try {
      Literal exp = ff
        .literal(WKTMarkFactory.WKT_PREFIX + "LINESTRING(0.0 0.25, 0.25 0.25, 0.5 0.75, 0.75 0.25, 1.00 0.25)");
      wmf.getShape(null, exp, feature);
  } catch (Exception e) {
      assertTrue(false);
      return;
View Full Code Here

    }

    public void testWellKnownTextMultiLineString() {
  WKTMarkFactory wmf = new WKTMarkFactory();
  try {
      Literal exp = ff
        .literal(WKTMarkFactory.WKT_PREFIX + "MULTILINESTRING((0.25 0.25, 0.5 0.75, 0.75 0.25, 0.25 0.25), (0.25 0.75, 0.5 0.25, 0.75 0.75, 0.25 0.75))");
      wmf.getShape(null, exp, feature);
  } catch (Exception e) {
      assertTrue(false);
      return;
View Full Code Here

    }

    public void testWellKnownTextPolygon() {
  WKTMarkFactory wmf = new WKTMarkFactory();
  try {
      Literal exp = ff
        .literal(WKTMarkFactory.WKT_PREFIX + "POLYGON((0.25 0.25, 0.5 0.75, 0.75 0.25, 0.25 0.25))");
      wmf.getShape(null, exp, feature);
  } catch (Exception e) {
      assertTrue(false);
      return;
View Full Code Here

    }

    public void testWellKnownTextCurve() {
        WKTMarkFactory wmf = new WKTMarkFactory();
        try {
            Literal exp = ff
                    .literal(WKTMarkFactory.WKT_PREFIX + "CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0,2 0, 2 1, 2 3, 4 3),(4 3, 4 5, 1 4, 0 0)))");
            wmf.getShape(null, exp, feature);
        } catch (Exception e) {
            assertTrue(false);
            return;
View Full Code Here

    }

    public void testWellKnownTextPolygonError() {
  WKTMarkFactory wmf = new WKTMarkFactory();
  try {
      Literal exp = ff
        .literal(WKTMarkFactory.WKT_PREFIX + "POLYGON((0.25 0.25, 0.5 0.75, 0.75 0.25,     ))");
      wmf.getShape(null, exp, feature);
  } catch (Exception e) {
      assertTrue(true);
      return;
View Full Code Here

    }

    public void testUnknownProtocol() {
        WKTMarkFactory wmf = new WKTMarkFactory();
        try {
            Literal exp = ff
                    .literal("xxx://POLYGON((0.25 0.25, 0.5 0.75, 0.75 0.25,))");
            if (wmf.getShape(null, exp, feature) == null) {
                assertTrue(true);
                return;
            }
View Full Code Here

    }

    public void testWellKnownTextFromNotExistingFile() {
        WKTMarkFactory wmf = new WKTMarkFactory();
        wmf.setRoot(rootDir);
        Literal exp = ff.literal(WKTMarkFactory.WKTLIB_PREFIX + "xxx.properties#xxx");
        try {
            wmf.getShape(null, exp, feature);
            assertTrue(false);
        } catch (Exception e) {
            assertTrue(true);
View Full Code Here

    }

    public void testNotExistingWellKnownTextFromFile() {
        WKTMarkFactory wmf = new WKTMarkFactory();
        wmf.setRoot(rootDir);
        Literal exp = ff.literal(WKTMarkFactory.WKTLIB_PREFIX + "wkt.properties#xxx");
        try {
            wmf.getShape(null, exp, feature);
            assertTrue(false);
        } catch (Exception e) {
            assertTrue(true);
View Full Code Here

TOP

Related Classes of org.opengis.filter.expression.Literal

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.