Examples of PrecisionModel


Examples of com.vividsolutions.jts.geom.PrecisionModel

    assertEquals("[12,34.23,12,54.56,7,8,12,34.23]", shell.get("coordinates").toString());
  }

  public void testMultiPolygon() throws MarshallException {
    GeometrySerializer ser = new GeometrySerializer();
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(100.0), 31300);
    CoordinateArraySequence coords = new CoordinateArraySequence(new Coordinate[] {
        new Coordinate(12.0, 34.23), new Coordinate(12.000, 54.555), new Coordinate(7, 8),
        new Coordinate(12.0, 34.23)});
    LinearRing ring = new LinearRing(coords, factory);
    Polygon p = new Polygon(ring, new LinearRing[] {}, factory);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    assertEquals("[12,34.23,12,54.56,7,8,12,34.23]", shell.get("coordinates").toString());
  }

  public void testMultiLineString() throws MarshallException {
    GeometrySerializer ser = new GeometrySerializer();
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(100.0), 31300);
    CoordinateArraySequence coords = new CoordinateArraySequence(new Coordinate[] {
        new Coordinate(12.0, 34.23), new Coordinate(12.000, 54.555), new Coordinate(-0.01, -0.0)});
    LineString l = new LineString(coords, factory);
    MultiLineString m = new MultiLineString(new LineString[] {l}, factory);
    JSONObject jo = (JSONObject) ser.marshall(null, m);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    authentications.add(auth1);
    securityContext.setAuthentications("token", authentications);
    Assert.assertTrue(securityContext.isLayerVisible(LAYER_ID));
    Geometry geometry = securityContext.getVisibleArea(LAYER_ID);
    Assert.assertNotNull(geometry);
    PrecisionModel precisionModel  = new PrecisionModel(PrecisionModel.FLOATING);
    GeometryFactory geometryFactory = new GeometryFactory(precisionModel, LAYER_SRID);
    Coordinate coordinate = new Coordinate();

    coordinate.x = coordinate.y = -86;
    Assert.assertFalse(geometry.contains(geometryFactory.createPoint(coordinate)));
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    authentications.add(auth2);
    securityContext.setAuthentications("token", authentications);

    Geometry geometry = securityContext.getVisibleArea(LAYER_ID);
    Assert.assertNotNull(geometry);
    PrecisionModel precisionModel  = new PrecisionModel(PrecisionModel.FLOATING);
    GeometryFactory geometryFactory = new GeometryFactory(precisionModel, LAYER_SRID);
    Coordinate coordinate = new Coordinate();
    coordinate.x = coordinate.y = 0.5;
    Assert.assertFalse(geometry.contains(geometryFactory.createPoint(coordinate)));
    coordinate.x = coordinate.y = 1.5;
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    authentications.add(auth2);
    securityContext.setAuthentications("token", authentications);

    Geometry geometry = securityContext.getVisibleArea(LAYER_ID);
    Assert.assertNotNull(geometry);
    PrecisionModel precisionModel  = new PrecisionModel(PrecisionModel.FLOATING);
    GeometryFactory geometryFactory = new GeometryFactory(precisionModel, LAYER_SRID);
    Coordinate coordinate = new Coordinate();
    coordinate.x = coordinate.y = 0.5;
    Assert.assertFalse(geometry.contains(geometryFactory.createPoint(coordinate)));
    coordinate.x = coordinate.y = 1.5;
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

         envelope = new Envelope(1, 3, 1, 3);
      } else {
        partly = true;
         envelope = new Envelope(2, 4, 2, 4);
      }
      PrecisionModel precisionModel  = new PrecisionModel(PrecisionModel.FLOATING);
      GeometryFactory geometryFactory = new GeometryFactory(precisionModel, LAYER_SRID);
      geometry = geometryFactory.toGeometry(envelope);
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

  protected Geometry getAuthorizedArea(String layerId) {
    if (null == biggestGeometry) {
      // build Geometry which covers biggest possible area
      Envelope maxBounds = new Envelope(-Double.MAX_VALUE, Double.MAX_VALUE,
          -Double.MAX_VALUE, Double.MAX_VALUE);
      PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
      GeometryFactory geometryFactory = new GeometryFactory(precisionModel, 0);
      biggestGeometry = geometryFactory.toGeometry(maxBounds);
    }
    return biggestGeometry;
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

      if (null == layer) {
        return null;
      }
      String area = layer.getVisibleArea();
      try {
        WKTReader wktReader = new WKTReader(new GeometryFactory(new PrecisionModel(), 0));
        return wktReader.read(area);
      } catch (ParseException pe) {
        throw new IllegalStateException("Could not parse geometry " + area, pe);
      }
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

      if (null == layer) {
        return null;
      }
      String area = layer.getUpdateAuthorizedArea();
      try {
        WKTReader wktReader = new WKTReader(new GeometryFactory(new PrecisionModel(), 0));
        return wktReader.read(area);
      } catch (ParseException pe) {
        throw new IllegalStateException("Could not parse geometry " + area, pe);
      }
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

      if (null == layer) {
        return null;
      }
      String area = layer.getCreateAuthorizedArea();
      try {
        WKTReader wktReader = new WKTReader(new GeometryFactory(new PrecisionModel(), 0));
        return wktReader.read(area);
      } catch (ParseException pe) {
        throw new IllegalStateException("Could not parse geometry " + area, pe);
      }
    }
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.