Examples of PrecisionModel


Examples of com.vividsolutions.jts.geom.PrecisionModel

      if (null == layer) {
        return null;
      }
      String area = layer.getDeleteAuthorizedArea();
      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

    Filter filter;
    List<InternalFeature> oldFeatures;
    List<InternalFeature> newFeatures;
    InternalFeature feature;
    CoordinateReferenceSystem crs = beanLayer.getCrs();
    GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel());
    Geometry geometry;

    login("marino");
    oldFeatures = new ArrayList<InternalFeature>();
    newFeatures = new ArrayList<InternalFeature>();
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    Filter filter;
    List<InternalFeature> oldFeatures;
    List<InternalFeature> newFeatures;
    InternalFeature feature;
    CoordinateReferenceSystem crs = beanLayer.getCrs();
    GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel());
    Geometry geometry;

    login("marino");
    // verify failing
    oldFeatures = new ArrayList<InternalFeature>();
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

  private WKTReader wktReader;

  @Before
  public void setUpTestDataWithinTransaction() throws LayerException, ParseException {
    wktReader = new WKTReader(new GeometryFactory(new PrecisionModel(), 4326));
    featureModel = layer.getFeatureModel();
    feature1 = NestedFeature.getDefaultInstance1();
    feature1.setGeometry(wktReader.read("POINT(10 20)"));
    layer.create(feature1);
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    if (geometry == null || geometry.isEmpty()) {
      return null;
    }
    int srid = geometry.getSRID();
    int precision = -1;
    PrecisionModel precisionmodel = geometry.getPrecisionModel();
    if (!precisionmodel.isFloating()) {
      precision = (int) Math.log10(precisionmodel.getScale());
    }

    Geometry dto;
    if (geometry instanceof Point) {
      dto = new Geometry(Geometry.POINT, srid, precision);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    if (geometry == null) {
      return null;
    }
    int srid = geometry.getSrid();
    int precision = geometry.getPrecision();
    PrecisionModel model;
    if (precision == -1) {
      model = new PrecisionModel(PrecisionModel.FLOATING);
    } else {
      model = new PrecisionModel(Math.pow(10, precision));
    }
    GeometryFactory factory = new GeometryFactory(model, srid);
    com.vividsolutions.jts.geom.Geometry jts;

    String geometryType = geometry.getGeometryType();
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    List<InternalFeature> newFeatures = new ArrayList<InternalFeature>();
    InternalFeature feature = converterService.toInternal(new Feature());
    feature.setId("4");
    feature.setLayer(beanLayer);
    // feature needs a geometry or exceptions all over
    GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel());
    Geometry geometry = geometryFactory.createPoint(new Coordinate(1.5, 1.5));
    feature.setGeometry(geometry);
    newFeatures.add(feature);
    layerService.saveOrUpdate(LAYER_ID, crs, oldFeatures, newFeatures);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

  @Qualifier("beans")
  private VectorLayer layer;

  @Before
  public void setupBeans() throws LayerException {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING), 4329);
    LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 0),
        new Coordinate(1, 1), new Coordinate(0, 1), new Coordinate(0, 0), });
    Polygon p = factory.createPolygon(shell, null);
    MultiPolygon expected = factory.createMultiPolygon(new Polygon[] { p });
    CustomBean cb = new CustomBean();
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    layer.saveOrUpdate(cb);
  }

  @Test
  public void readGeometry() throws LayerException {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 0),
        new Coordinate(1, 1), new Coordinate(0, 1), new Coordinate(0, 0), });
    Polygon p = factory.createPolygon(shell, null);
    MultiPolygon expected = factory.createMultiPolygon(new Polygon[] { p });
    Assert.assertTrue(((CustomBean) layer.read("1")).getGeometry().equalsExact(expected));
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

  }

  @Test
  public void readGeometry() throws LayerException {
    Object bean = layer.read("1");
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(0, 0), new Coordinate(1, 0),
        new Coordinate(1, 1), new Coordinate(0, 1), new Coordinate(0, 0), });
    Polygon p = factory.createPolygon(shell, null);
    MultiPolygon expected =factory.createMultiPolygon(new Polygon[]{p});
    Geometry g = layer.getFeatureModel().getGeometry(bean);
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.