org.locationtech.jts.geom.Geometry.geometryChanged()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(153)

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

Geometry.geometryChanged介绍

[英]Notifies this geometry that its coordinates have been changed by an external party (for example, via a CoordinateFilter). When this method is called the geometry will flush and/or update any derived information it has cached (such as its Envelope ). The operation is applied to all component Geometries.
[中]通知此几何体其坐标已被外部方更改(例如,通过CoordinateFilter)。调用此方法时,几何体将刷新和/或更新其缓存的任何派生信息(例如其封套)。该操作将应用于所有零部件几何图形。

代码示例

代码示例来源:origin: geotools/geotools

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

代码示例来源:origin: geotools/geotools

/**
 * Decimate a geometry (reducing the number of vertices) for incoming buffering
 *
 * @param geometry
 * @return
 */
public static Geometry decimate(Geometry geometry) {
  Coordinate[] coordinates = geometry.getCoordinates();
  if (coordinates.length <= Utils.COORDS_DECIMATION_THRESHOLD) {
    return geometry;
  }
  Geometry g2 = LiteCoordinateSequence.cloneGeometry(geometry, 2);
  Decimator decimator =
      new Decimator(
          DEFAULT_LINESTRING_DECIMATION_SPAN, DEFAULT_LINESTRING_DECIMATION_SPAN);
  decimator.decimate(g2);
  g2.geometryChanged();
  return g2;
}

代码示例来源:origin: geotools/geotools

stipplePoint.geometryChanged();
LiteShape2 stippleShape;
try {

代码示例来源:origin: geotools/geotools

this.geometry =
      decimator.decimateTransformGeneralize(this.geometry, this.mathTransform);
  this.geometry.geometryChanged();
} else {
      && geometry != null) {
    new Decimator(mathTransform.inverse()).decimate(this.geometry);
    this.geometry.geometryChanged();
    this.geometry.geometryChanged();

代码示例来源:origin: geotools/geotools

final Geometry wrapped = geometry.copy();
wrapped.apply(new WrappingCoordinateFilter(radius, radius * 2, mt, northEast));
wrapped.geometryChanged();
  offseted.geometryChanged();
  geomType = accumulate(geoms, offseted, geomType);

代码示例来源:origin: locationtech/spatial4j

newGeom.geometryChanged();
 return newGeom;
} else {

代码示例来源:origin: geotools/geotools

} catch (Exception e) {
  Geometry g = representativeGeom.getGeometry();
  g.geometryChanged();
  Envelope ePoly = g.getEnvelopeInternal();
  Envelope eglyph =

代码示例来源:origin: geotools/geotools

geom.geometryChanged();
  geom.geometryChanged();
  shape = new LiteShape2(geom, null, null, false, false);

代码示例来源:origin: geotools/geotools

private static void transformGeometry(Geometry geometry) {
  if (geometry == null) {
    return;
  }
  if (geometry instanceof GeometryCollection) {
    GeometryCollection collection = (GeometryCollection) geometry;
    for (int i = 0; i < collection.getNumGeometries(); i++) {
      transformGeometry(collection.getGeometryN(i));
    }
  } else if (geometry instanceof Polygon) {
    Polygon polygon = (Polygon) geometry;
    transformGeometry(polygon.getExteriorRing());
    for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
      transformGeometry(polygon.getInteriorRingN(i));
    }
  } else if (geometry instanceof LineString) {
    CoordinateSequence cs = ((LineString) geometry).getCoordinateSequence();
    for (int i = 0; i < cs.size(); i++) {
      cs.setOrdinate(i, 0, (int) (cs.getOrdinate(i, 0) + 0.5d));
      cs.setOrdinate(i, 1, (int) (cs.getOrdinate(i, 1) + 0.5d));
    }
  }
  geometry.geometryChanged();
}

代码示例来源:origin: locationtech/jts

/**
 * Adds the common coordinate bits back into a Geometry.
 * The coordinates of the Geometry are changed.
 *
 * @param geom the Geometry to which to add the common coordinate bits
 */
public void addCommonBits(Geometry geom)
{
 Translater trans = new Translater(commonCoord);
 geom.apply(trans);
 geom.geometryChanged();
}

代码示例来源:origin: uk.os.vt/vt

public static Geometry toMercator(Geometry geometry) {
 Geometry clone = geometry.copy();
 clone.apply(new CoordinateFilter() {
  @Override
  public void filter(Coordinate coord) {
   coord.setCoordinate(new Coordinate(lon2x(coord.x), lat2y(coord.y), coord.z));
  }
 });
 clone.geometryChanged();
 return clone;
}

代码示例来源:origin: org.n52.arctic-sea/shetland

/**
 * Switches the coordinates of a JTS Geometry.
 *
 * @param <G>
 *            the geometry type
 * @param geometry
 *            Geometry to switch coordinates.
 * @return Geometry with switched coordinates
 */
public static <G extends Geometry> G switchCoordinateAxisOrder(G geometry) {
  if (geometry == null) {
    return null;
  }
  @SuppressWarnings("unchecked")
  G geom = (G) geometry.copy();
  geom.apply(COORDINATE_SWITCHING_FILTER);
  geom.geometryChanged();
  return geom;
}

代码示例来源:origin: locationtech/jts

/**
 * Removes the common coordinate bits from a Geometry.
 * The coordinates of the Geometry are changed.
 *
 * @param geom the Geometry from which to remove the common coordinate bits
 * @return the shifted Geometry
 */
public Geometry removeCommonBits(Geometry geom)
{
 if (commonCoord.x == 0.0 && commonCoord.y == 0.0)
  return geom;
 Coordinate invCoord = new Coordinate(commonCoord);
 invCoord.x = -invCoord.x;
 invCoord.y = -invCoord.y;
 Translater trans = new Translater(invCoord);
 geom.apply(trans);
 geom.geometryChanged();
 return geom;
}

代码示例来源:origin: orbisgis/h2gis

if (op != null) {
  Geometry outPutGeom = geom.copy();
  outPutGeom.geometryChanged();
  outPutGeom.apply(new CRSTransformFilter(op));
  outPutGeom.setSRID(codeEpsg);
      op = CoordinateOperationFactory.getMostPrecise(ops);
      Geometry outPutGeom = (Geometry) geom.copy();
      outPutGeom.geometryChanged();
      outPutGeom.apply(new CRSTransformFilter(op));
      copPool.put(epsg, op);

代码示例来源:origin: locationtech/jts

public void testInvalidateEnvelope() throws Exception {
  Geometry g = reader.read("POLYGON ((0 0, 0 50, 50 50, 50 0, 0 0))");
  assertEquals(new Envelope(0, 50, 0, 50), g.getEnvelopeInternal());
  g.apply(new CoordinateFilter() {
      public void filter(Coordinate coord) {
        coord.x += 1;
        coord.y += 1;
      }
    });
  assertEquals(new Envelope(0, 50, 0, 50), g.getEnvelopeInternal());
  g.geometryChanged();
  assertEquals(new Envelope(1, 51, 1, 51), g.getEnvelopeInternal());
}

相关文章