Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Coordinate


    if (null == tile.getFeatureContent()) {
      VectorLayer layer = context.get(PipelineCode.LAYER_KEY, VectorLayer.class);
      TileMetadata metadata = context.get(PipelineCode.TILE_METADATA_KEY, TileMetadata.class);

      tile.setContentType(VectorTile.VectorTileContentType.STRING_CONTENT);
      Coordinate panOrigin = new Coordinate(metadata.getPanOrigin().getX(), metadata.getPanOrigin().getY());
      TilePainter tilePainter = new StringContentTilePainter(layer, metadata.getStyleInfo(), metadata
          .getRenderer(), metadata.getScale(), panOrigin, geoService, textService);
      tilePainter.setPaintGeometries(metadata.isPaintGeometries());
      tilePainter.setPaintLabels(metadata.isPaintLabels());
      log.debug("Going to paint features {}", tile.getFeatures());
View Full Code Here


    // fill the tiles
    tiledFeatureService.fillTile(response.getTile(), maxTileExtent);

    // clipping of features in tile
    Coordinate panOrigin = new Coordinate(metadata.getPanOrigin().getX(), metadata.getPanOrigin().getY());
    tiledFeatureService.clipTile(response.getTile(), metadata.getScale(), panOrigin);
  }
View Full Code Here

    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);

    Iterator<FeatureBean> iterator =
View Full Code Here

  }
 
  @Test
  public void testGetBoundsIntersectsFiltered() throws Exception {
    GeometryFactory factory = new GeometryFactory();
    LineString equator = factory.createLineString(new Coordinate[] { new Coordinate(0, 0),
        new Coordinate(-180, 180) });
    Filter filter = filterService.createIntersectsFilter(equator,beanLayer.getLayerInfo().getFeatureInfo().getGeometryType().getName());
    Envelope bounds = layerService.getBounds(LAYER_ID,
        geoService.getCrs2(beanLayer.getLayerInfo().getCrs()), filter);
    Assert.assertEquals(0, bounds.getMinX(), ALLOWANCE);
    Assert.assertEquals(0, bounds.getMinY(), ALLOWANCE);
View Full Code Here

  public void calculateSize(PdfContext context) {
    setMapId(getMap().getMapId());
    setRasterResolution(getMap().getRasterResolution());

    // calculate origin (uses margins to position)
    Coordinate mapOrigin = getMap().getLocation();
    Coordinate portOrigin = getLocation();
    if (userX == -1) {
      getConstraint().setMarginX((float) (portOrigin.x - mapOrigin.x) * getMap().getPpUnit());
    } else {
      getConstraint().setMarginX(userX);
    }
View Full Code Here

  @Before
  public void setUpTestDataWithinTransaction() throws LayerException {
    featureModel = layer.getFeatureModel();

    feature1 = AssociationFeature.getDefaultInstance1(new Long(1));
    feature1.setGeometry(geometryFactory.createPoint(new Coordinate(3, 42)));
  }
View Full Code Here

  @Before
  public void setUpTestDataWithinTransaction() throws LayerException {
    featureModel = layer.getFeatureModel();

    feature1 = SimpleFeature.getDefaultInstance1(new Long(1));
    feature1.setGeometry(geometryFactory.createPoint(new Coordinate(3, 42)));
  }
View Full Code Here

    Assert.assertNull(geometry);
  }

  @Test
  public void setGeometry() throws LayerException {
    Point point = geometryFactory.createPoint(new Coordinate(1, 2));
    featureModel.setGeometry(feature1, point);

    Geometry geometry = featureModel.getGeometry(feature1);
    Assert.assertNotNull(geometry);
    Assert.assertTrue(geometry instanceof Point);
View Full Code Here

  private Rectangle calculateLabelRect(PdfContext context, InternalFeature f, String label, Font font) {
    Rectangle textSize = context.getTextSize(label, font);
    float margin = 0.25f * font.getSize();
    Rectangle rect = new Rectangle(textSize.getWidth() + 2 * margin, textSize.getHeight() + 2 * margin);
    Coordinate labelPosition = geoService.calcDefaultLabelPosition(f);
    context.moveRectangleTo(rect, (float) labelPosition.x - rect.getWidth() / 2f,
        (float) labelPosition.y - rect.getHeight() / 2f);
    if (f.getGeometry() instanceof Point) {
      float shiftHeight = 0.5f * (rect.getHeight() + getSymbolHeight(f));
      // move up 15 pixels to make the symbol visible
View Full Code Here

    DefaultConfigurationVisitor config = new DefaultConfigurationVisitor();
    config.setApplicationId("application");
    config.setMapId("mainMap");
    config.setMapRasterResolution(72);
    config.setMapPpUnit(822 / widthInUnits);
    config.setMapLocation(new Coordinate(x, y));
    config.setTitle("Africa");
    return config;
  }
View Full Code Here

TOP

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

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.