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

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

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

Polygon.apply介绍

暂无

代码示例

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

public void apply(CoordinateFilter filter) {
  polygon.apply(filter);
}

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

public void apply(CoordinateSequenceFilter filter) {
  polygon.apply(filter);
}

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

public void apply(GeometryFilter filter) {
  polygon.apply(filter);
}

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

public void apply(GeometryComponentFilter filter) {
  polygon.apply(filter);
}

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

polygon.apply(
    new CoordinateSequenceFilter() {

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

offseted.apply(new OffsetOrdinateFilter(0, extrusion));
faces.add(0, (Polygon) geom);
faces.add(offseted);
  if (g instanceof Polygon) {
    Polygon offseted = (Polygon) g.copy();
    offseted.apply(new OffsetOrdinateFilter(0, extrusion));
    faces.add(0, (Polygon) g);
    faces.add(offseted);

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

private double[] getTranslationFactors(Polygon reference, Polygon displaced) {
  // compare the two envelopes
  Envelope re = reference.getEnvelopeInternal();
  Envelope de = displaced.getEnvelopeInternal();
  double dw = Math.abs(re.getWidth() - de.getWidth());
  double dh = Math.abs(re.getHeight() - de.getHeight());
  if (dw > EPS * re.getWidth() || dh > EPS * re.getWidth()) {
    // this was not just a translation
    return null;
  }
  // compute the translation
  double dx = de.getMinX() - re.getMinX();
  double dy = de.getMinY() - re.getMinY();
  Polygon cloned = (Polygon) displaced.copy();
  cloned.apply(AffineTransformation.translationInstance(-dx, -dy));
  if (1 - new HausdorffSimilarityMeasure().measure(cloned, reference) > EPS) {
    return null;
  } else {
    return new double[] {dx, dy};
  }
}

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

polygon.apply(new CoordinateFilter() {
  @Override
  public void filter(Coordinate c) {

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

polygon.setUserData(null);
polygon.apply(jtsTransformation);

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

private Geometry getPolygonLines(Geometry g)
{
  List lines = new ArrayList();
  LinearComponentExtracter lineExtracter = new LinearComponentExtracter(lines);
  List polys = PolygonExtracter.getPolygons(g);
  for (Iterator i = polys.iterator(); i.hasNext(); ) {
    Polygon poly = (Polygon) i.next();
    poly.apply(lineExtracter);
  }
  return g.getFactory().buildGeometry(lines);
}

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

/**
 * Drape a polygon on a set of triangles
 * @param p
 * @param triangles
 * @param sTRtree
 * @return 
 */
public static Geometry drapePolygon(Polygon p, Geometry triangles, STRtree sTRtree) {
  GeometryFactory factory = p.getFactory();
  //Split the triangles in lines to perform all intersections
  Geometry triangleLines = LinearComponentExtracter.getGeometry(triangles, true);        
  Polygon splittedP = processPolygon(p, triangleLines, factory);
  CoordinateSequenceFilter drapeFilter = new DrapeFilter(sTRtree);
  splittedP.apply(drapeFilter);
  return splittedP;
}

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

/**
 * Extract the roof of a polygon
 * 
 * @param polygon
 * @param height
 * @return 
 */
public static Polygon extractRoof(Polygon polygon, double height) {
  GeometryFactory factory = polygon.getFactory();
  Polygon roofP =  (Polygon)polygon.copy();
  roofP.apply(new TranslateCoordinateSequenceFilter(height));
  final LinearRing shell = factory.createLinearRing(getCounterClockWise(roofP.getExteriorRing()).getCoordinates());
  final int nbOfHoles = roofP.getNumInteriorRing();
  final LinearRing[] holes = new LinearRing[nbOfHoles];
  for (int i = 0; i < nbOfHoles; i++) {
    holes[i] = factory.createLinearRing(getClockWise(
        roofP.getInteriorRingN(i)).getCoordinates());
  }
  return factory.createPolygon(shell, holes);
}

相关文章