Examples of PrecisionModel


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

    }
    LayerInfo layerInfo = layer.getLayerInfo();

    // base is the max bounds of the layer
    Envelope maxBounds = converterService.toInternal(layerInfo.getMaxExtent());
    PrecisionModel precisionModel = new PrecisionModel(PrecisionModel.FLOATING);
    int srid = geoService.getSridFromCrs(layer.getLayerInfo().getCrs());
    GeometryFactory geometryFactory = new GeometryFactory(precisionModel, srid);
    Geometry geometry = geometryFactory.toGeometry(maxBounds);

    // limit based on authorizations
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    LinearRing gwtRing2 = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(10.0, 20.0),
        new Coordinate(30.0, 10.0), new Coordinate(40.0, 10.0), new Coordinate(10.0, 20.0)});
    Polygon gwtPolygon2 = gwtFactory.createPolygon(gwtRing2, null);
    gwt = gwtFactory.createMultiPolygon(new Polygon[] {gwtPolygon1, gwtPolygon2});

    jtsFactory = new com.vividsolutions.jts.geom.GeometryFactory(new PrecisionModel(), SRID);
    com.vividsolutions.jts.geom.LinearRing jtsRing1 = jtsFactory
        .createLinearRing(new com.vividsolutions.jts.geom.Coordinate[] {
            new com.vividsolutions.jts.geom.Coordinate(10.0, 10.0),
            new com.vividsolutions.jts.geom.Coordinate(20.0, 10.0),
            new com.vividsolutions.jts.geom.Coordinate(20.0, 20.0),
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    Point point1 = gwtFactory.createPoint(new Coordinate(10.0, 10.0));
    Point point2 = gwtFactory.createPoint(new Coordinate(10.0, 20.0));
    Point point3 = gwtFactory.createPoint(new Coordinate(20.0, 20.0));
    gwt = gwtFactory.createMultiPoint(new Point[] {point1, point2, point3});

    jtsFactory = new com.vividsolutions.jts.geom.GeometryFactory(new PrecisionModel(), SRID);
    jts = jtsFactory.createMultiPoint(new com.vividsolutions.jts.geom.Coordinate[] {
        new com.vividsolutions.jts.geom.Coordinate(10.0, 10.0),
        new com.vividsolutions.jts.geom.Coordinate(10.0, 20.0),
        new com.vividsolutions.jts.geom.Coordinate(20.0, 20.0)});
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

        "org/geomajas/spring/geomajasContext.xml", "org/geomajas/spring/emptyApplication.xml" });
    converter = applicationContext.getBean("service.DtoConverterService", DtoConverterService.class);
  }

  public void testPoint() throws MarshallException, GeomajasException {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(10000.0), 31300);
    CoordinateArraySequence coords = new CoordinateArraySequence(new Coordinate[] { new Coordinate(12.3456,
        34567.3456) });
    Point p = new Point(coords, factory);
    JSONObject jtsJson = (JSONObject) jtsSerializer.marshall(null, p);
    Geometry dto = converter.toDto(p);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    JSONObject dtoJson = (JSONObject) dtoSerializer.marshall(null, dto);
    Assert.assertEquals(jtsJson.toString(), dtoJson.toString());
  }

  public void testLineString() throws MarshallException, GeomajasException {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(10000.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 p = new LineString(coords, factory);
    JSONObject jtsJson = (JSONObject) jtsSerializer.marshall(null, p);
    Geometry dto = converter.toDto(p);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    JSONObject dtoJson = (JSONObject) dtoSerializer.marshall(null, dto);
    Assert.assertEquals(jtsJson.toString(), dtoJson.toString());
  }

  public void testPolygon() throws MarshallException, GeomajasException {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(10000.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, null, factory);
    Geometry dto = converter.toDto(p);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    Assert.assertEquals(jtsShell.get("precision").toString(), dtoShell.get("precision").toString());
    Assert.assertEquals(jtsShell.get("coordinates").toString(), dtoShell.get("coordinates").toString());
  }

  public void testMultiPolygon() throws MarshallException, GeomajasException {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(10000.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);
    MultiPolygon m = new MultiPolygon(new Polygon[] { p }, factory);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    Assert.assertEquals(jtsShell.get("precision").toString(), dtoShell.get("precision").toString());
    Assert.assertEquals(jtsShell.get("coordinates").toString(), dtoShell.get("coordinates").toString());
  }

  public void testMultiLineString() throws MarshallException, GeomajasException {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(10000.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 jtsJson = (JSONObject) jtsSerializer.marshall(null, m);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    if (type == null) {
      throw new UnmarshallException("no type hint");
    }
    int srid = jso.getInt(ATTRIBUTE_SRID);
    int precision = jso.getInt(ATTRIBUTE_PRECISION);
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(Math.pow(10, precision)), srid);

    Geometry geometry = null;
    if (type.equals(org.geomajas.geometry.Geometry.POINT)) {
      geometry = createPoint(factory, jso);
    } else if (type.equals(org.geomajas.geometry.Geometry.LINE_STRING)) {
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.