Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.GeometryFactory


 
  protected void setUp() throws Exception {
    super.setUp();
    geomMarkerDao = new GeometryMarkerDBDao(getDataSource());
    bookmarkDao = new BookmarkDBDao(getDataSource());
    factory = new GeometryFactory();
    createDummyPointMarker()
  }
View Full Code Here


    this.coordHeight = coordHeight;
    this.labelStyle = labelStyle;
    this.transformer = transformer;
    this.geoService = geoService;
    this.textService = textService;
    factory = new GeometryFactory();
  }
View Full Code Here

  // -------------------------------------------------------------------------
  // 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

    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

        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

      GeoService geoService, TextService textService) {
    this.transformer = transformer;
    this.labelStyle = labelStyle;
    this.geoService = geoService;
    this.textService = textService;
    this.factory = new GeometryFactory();
  }
View Full Code Here

    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

  private DtoConverterService dtoConverter;

  @Test
  public void testMergePolygon() throws Exception {
    MergePolygonRequest request = new MergePolygonRequest();
    GeometryFactory factory = new GeometryFactory();
    request.setPolygons(new Geometry[] {
        dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(0, 0)), 10, 10)),
        dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(5, 5)), 10, 10))});
    MergePolygonResponse response = (MergePolygonResponse) dispatcher.execute(
        MergePolygonRequest.COMMAND, request, null, "en");
    if (response.isError()) {
      response.getErrors().get(0).printStackTrace();
    }
View Full Code Here

  private DtoConverterService dtoConverter;

  @Test
  public void testSplitPolygon() throws Exception {
    SplitPolygonRequest request = new SplitPolygonRequest();
    GeometryFactory factory = new GeometryFactory();
    request.setGeometry(
        dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(0, 0)), 10, 10)));
    request.setSplitter(
        dtoConverter.toDto(factory.createLineString(new Coordinate[] {
            new Coordinate(-10, -10), new Coordinate(10, 10)
        })));
    SplitPolygonResponse response = (SplitPolygonResponse) dispatcher.execute(
        SplitPolygonRequest.COMMAND, request, null, "en");
    if (response.isError()) {
View Full Code Here

    PersistTransactionRequest request = new PersistTransactionRequest();
    request.setCrs(CRS);
    FeatureTransaction featureTransaction = new FeatureTransaction();
    featureTransaction.setLayerId(LAYER_ID);
    Feature feature = new Feature();
    GeometryFactory factory = new GeometryFactory();
    Geometry circle =
        dtoConverter.toDto(geoService.createCircle(factory.createPoint(new Coordinate(0, 0)), 10, 10));
    feature.setGeometry(circle);
    featureTransaction.setNewFeatures(new Feature[] {feature});
    request.setFeatureTransaction(featureTransaction);
    PersistTransactionResponse response = (PersistTransactionResponse) dispatcher.execute(
        PersistTransactionRequest.COMMAND, request, null, "en");
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.GeometryFactory

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.