com.vividsolutions.jts.geom.Point.geometryChanged()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中com.vividsolutions.jts.geom.Point.geometryChanged()方法的一些代码示例,展示了Point.geometryChanged()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.geometryChanged()方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Point
类名称:Point
方法名:geometryChanged

Point.geometryChanged介绍

暂无

代码示例

代码示例来源:origin: com.vividsolutions/jts

public void apply(CoordinateSequenceFilter filter) 
{
   if (isEmpty())
   return;
   filter.filter(coordinates, 0);
  if (filter.isGeometryChanged())
   geometryChanged();
  }

代码示例来源:origin: org.geotools/gt-render

public void geometryChanged() {
  point.geometryChanged();
}

代码示例来源:origin: bcdev/beam

@Override
public void setLocation(double x, double y) {
  Coordinate coordinate = geometry.getCoordinate();
  coordinate.x = x;
  coordinate.y = y;
  geometry.geometryChanged();
  fireFigureChanged();
}

代码示例来源:origin: com.vividsolutions/jts-core

public void apply(CoordinateSequenceFilter filter) 
{
   if (isEmpty())
   return;
   filter.filter(coordinates, 0);
  if (filter.isGeometryChanged())
   geometryChanged();
  }

代码示例来源:origin: com.googlecode.jaitools/jt-utils

/**
 * Tests if this ROI contains the given image location.
 * 
 * @param x location X ordinate
 * @param y location Y ordinate
 * 
 * @return {@code true} if the location is within this ROI; 
 *         {@code false} otherwise
 */
@Override
public boolean contains(double x, double y) {
  testPointCS.setX(0, x + delta);
  testPointCS.setY(0, y + delta);
  testPoint.geometryChanged();
  return theGeom.contains(testPoint);
}

代码示例来源:origin: senbox-org/snap-desktop

@Override
public void setLocation(double x, double y) {
  Coordinate coordinate = geometry.getCoordinate();
  coordinate.x = x;
  coordinate.y = y;
  final Point2D.Double modelCoords = new Point2D.Double(x, y);
  final Point2D.Double sceneCoords = new Point2D.Double();
  try {
    sceneTransformProvider.getModelToSceneTransform().transform(modelCoords, sceneCoords);
    simpleFeature.setDefaultGeometry(new AwtGeomToJtsGeomConverter().createPoint(sceneCoords));
  } catch (TransformException e) {
    coordinate.x = Double.NaN;
    coordinate.y = Double.NaN;
  }
  geometry.geometryChanged();
  fireFigureChanged();
}

代码示例来源:origin: bcdev/beam

private void updateDefaultGeometryAttribute(PixelPos pixelPos) {
  final Product product = getProduct();
  final Point2D.Float geometryPoint = new Point2D.Float(pixelPos.x, pixelPos.y);
  if (product != null) {
    final AffineTransform i2m = ImageManager.getImageToModelTransform(product.getGeoCoding());
    i2m.transform(pixelPos, geometryPoint);
  }
  final Point point = (Point) feature.getDefaultGeometry();
  point.getCoordinate().setCoordinate(toCoordinate(geometryPoint));
  point.geometryChanged();
}

代码示例来源:origin: org.geotools/gt-render

c.x = tp[0];
c.y = tp[1];
pp.geometryChanged();

代码示例来源:origin: bcdev/beam

private void setGeoPosAttribute(GeoPos geoPos, boolean updatePixelPos) {
  final Coordinate newCoordinate = toCoordinate(geoPos);
  final Coordinate oldCoordinate = getGeoPosAttribute();
  if (!ObjectUtils.equalObjects(oldCoordinate, newCoordinate)) {
    if (oldCoordinate == null) {
      final GeometryFactory geometryFactory = new GeometryFactory();
      setAttributeValue(PROPERTY_NAME_GEOPOS, geometryFactory.createPoint(newCoordinate));
    } else if (newCoordinate != null) {
      final Point point = (Point) getAttributeValue(PROPERTY_NAME_GEOPOS);
      point.getCoordinate().setCoordinate(newCoordinate);
      point.geometryChanged();
    }
    if (updatePixelPos && getProduct() != null) {
      final PixelPos pixelPos = getPixelPos();
      descriptor.updatePixelPos(getProduct().getGeoCoding(), geoPos, pixelPos);
      setPixelPosAttribute(pixelPos, false, true);
    }
    fireProductNodeChanged(PROPERTY_NAME_GEOPOS);
  }
}

代码示例来源:origin: org.geotools/gt-render

for (int i = 0; i < steps; i++) {
  c.x = env.getMinX() + step * i;
  pp.geometryChanged();
  if(!pg.contains(pp)) {
    containCounter = 0;
  int midIdx = max > 1 ? maxIdx - max / 2 : maxIdx;
  c.x = env.getMinX() + step * midIdx;
  pp.geometryChanged();
  centroid = pp;
} else {
  testPoint.geometryChanged();
  if(!pg.contains(testPoint))
    continue;

代码示例来源:origin: bcdev/beam

private void setPixelPosAttribute(PixelPos pixelPos, boolean updateGeoPos, boolean updateDefaultGeometry) {
  final Coordinate newCoordinate = toCoordinate(pixelPos);
  final Coordinate oldCoordinate = getPixelPosAttribute();
  if (!ObjectUtils.equalObjects(oldCoordinate, newCoordinate)) {
    if (oldCoordinate == null) {
      final GeometryFactory geometryFactory = new GeometryFactory();
      setAttributeValue(PROPERTY_NAME_PIXELPOS, geometryFactory.createPoint(newCoordinate));
    } else {
      final Point point = (Point) getAttributeValue(PROPERTY_NAME_PIXELPOS);
      point.getCoordinate().setCoordinate(newCoordinate);
      point.geometryChanged();
    }
    // Make sure, object is in a consistent state
    if (updateDefaultGeometry) {
      updateDefaultGeometryAttribute(pixelPos);
    }
    if (updateGeoPos && getProduct() != null) {
      final GeoPos geoPos = getGeoPos();
      descriptor.updateGeoPos(getProduct().getGeoCoding(), pixelPos, geoPos);
      setGeoPosAttribute(geoPos, false);
    }
    fireProductNodeChanged(PROPERTY_NAME_PIXELPOS);
  }
}

相关文章