Examples of PrecisionModel


Examples of com.vividsolutions.jts.geom.PrecisionModel

  // -------------------------------------------------------------------------
  // Constructor, initializes all variables:
  // -------------------------------------------------------------------------

  public GeometryConverterTest() {
    factory = new GeometryFactory(new PrecisionModel(), SRID);
    jtsC1 = new com.vividsolutions.jts.geom.Coordinate(10.0, 10.0);
    jtsC2 = new com.vividsolutions.jts.geom.Coordinate(20.0, 10.0);
    jtsC3 = new com.vividsolutions.jts.geom.Coordinate(20.0, 20.0);
    jtsC4 = new com.vividsolutions.jts.geom.Coordinate(10.0, 20.0);
    jtsC5 = new com.vividsolutions.jts.geom.Coordinate(12.0, 12.0);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    Assert.assertEquals(3219426.4637164664, coordinates[4].x, DELTA);
    Assert.assertEquals(1050557.6016714368, coordinates[4].y, DELTA);
  }

  private Geometry getLineString() {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    return factory.createLineString(new Coordinate[] {
        new Coordinate(5, 4), new Coordinate(30, 10), new Coordinate(120, 150), new Coordinate(50, 50)});
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

        new Coordinate(5, 4), new Coordinate(30, 10), new Coordinate(120, 150), new Coordinate(50, 50)});
  }

  @Test
  public void transformOutsideAreaTest() throws Exception {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    Geometry geometry = factory.createLineString(new Coordinate[] {
        new Coordinate(110, 50), new Coordinate(120, 60)});
    geometry = geoService.transform(geometry, LONLAT, LAMBERT72);
    Assert.assertTrue(geometry.isEmpty());
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    if (!wkt || null == geometry) {
      log.debug("bean.getGeometry {}", geometry);
      return (Geometry) geometry;
    } else {
      try {
        WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(), srid));
        Geometry geom = reader.read((String) geometry);
        log.debug("bean.getGeometry {}", geom);
        return geom;
      } catch (Throwable t) {
        throw new LayerException(t, ExceptionCode.FEATURE_MODEL_PROBLEM, geometry);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

  }

  @Test
  public void testCalcDefaultLabelPosition() throws Exception {
    Geometry geometry;
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    Coordinate coordinate;
    InternalFeature feature = new InternalFeatureImpl();
    feature.setId("x");
    feature.setLabel("Label x");
    coordinate = geoService.calcDefaultLabelPosition(feature);
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

  }

  @Test
  public void testCreateCircle() throws Exception {
    Geometry geometry;
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    Point point = factory.createPoint(new Coordinate(0, 0));
    Point inside = factory.createPoint(new Coordinate(9.5, 0));
    Point insideFine = factory.createPoint(new Coordinate(6.8, 6.8));
    Point outsideAll = factory.createPoint(new Coordinate(9, 5));
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    Assert.assertEquals(3219426.4637164664, coordinates[3].x, DELTA);
    Assert.assertEquals(1050557.6016714368, coordinates[3].y, DELTA);
  }

  private Geometry getLineString() {
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(), 4326);
    return factory.createLineString(new Coordinate[] {
        new Coordinate(5, 4), new Coordinate(30, 10), new Coordinate(120, 150), new Coordinate(50, 50)});

  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

*/
public class GeometrySerializerTest extends TestCase {

  public void testPoint() throws MarshallException {
    GeometrySerializer ser = new GeometrySerializer();
    GeometryFactory factory = new GeometryFactory(new PrecisionModel(100.0), 31300);
    CoordinateArraySequence coords = new CoordinateArraySequence(new Coordinate[] {new Coordinate(
        12.3456, 34567.3456)});
    Point p = new Point(coords, factory);
    JSONObject jo = (JSONObject) ser.marshall(null, p);
    assertEquals("Point", jo.get("type").toString());
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    assertEquals("[12.35,34567.35]", jo.get("coordinates").toString());
  }

  public void testLineString() 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 p = new LineString(coords, factory);
    JSONObject jo = (JSONObject) ser.marshall(null, p);
    assertEquals("LineString", jo.get("type").toString());
View Full Code Here

Examples of com.vividsolutions.jts.geom.PrecisionModel

    assertEquals("[12,34.23,12,54.56,-0.01,0]", jo.get("coordinates").toString());
  }

  public void testPolygon() 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
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.