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

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

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

Polygon.getNumPoints介绍

暂无

代码示例

代码示例来源:origin: opentripplanner/OpenTripPlanner

@Override
  public int compare(Polygon o1, Polygon o2) {
    return o2.getNumPoints() - o1.getNumPoints();
  }
});

代码示例来源:origin: opentripplanner/OpenTripPlanner

@Override
  public int compare(Polygon o1, Polygon o2) {
    return o2.getNumPoints() - o1.getNumPoints();
  }
});

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

public Coordinate[] getCoordinates() {
 if (isEmpty()) {
  return new Coordinate[]{};
 }
 Coordinate[] coordinates = new Coordinate[getNumPoints()];
 int k = -1;
 Coordinate[] shellCoordinates = shell.getCoordinates();
 for (int x = 0; x < shellCoordinates.length; x++) {
  k++;
  coordinates[k] = shellCoordinates[x];
 }
 for (int i = 0; i < holes.length; i++) {
  Coordinate[] childCoordinates = holes[i].getCoordinates();
  for (int j = 0; j < childCoordinates.length; j++) {
   k++;
   coordinates[k] = childCoordinates[j];
  }
 }
 return coordinates;
}

代码示例来源:origin: matsim-org/matsim

@Override
  public int compare(Polygon o1, Polygon o2) {
    return o2.getNumPoints() - o1.getNumPoints();
  }
});

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-gis

public boolean visitPolygoneWithHole(final Polygon _p) {
 nbPolygoneHole_++;
 nbPtTotal_ += _p.getNumPoints();
 return true;
}

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

public int getNumPoints() {
  return polygon.getNumPoints();
}

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

public Coordinate[] getCoordinates() {
 if (isEmpty()) {
  return new Coordinate[]{};
 }
 Coordinate[] coordinates = new Coordinate[getNumPoints()];
 int k = -1;
 Coordinate[] shellCoordinates = shell.getCoordinates();
 for (int x = 0; x < shellCoordinates.length; x++) {
  k++;
  coordinates[k] = shellCoordinates[x];
 }
 for (int i = 0; i < holes.length; i++) {
  Coordinate[] childCoordinates = holes[i].getCoordinates();
  for (int j = 0; j < childCoordinates.length; j++) {
   k++;
   coordinates[k] = childCoordinates[j];
  }
 }
 return coordinates;
}

代码示例来源:origin: DataSystemsLab/GeoSpark

private static byte[] serialize(Polygon polygon)
{
  int numRings = polygon.getNumInteriorRing() + 1;
  int numPoints = polygon.getNumPoints();
  ByteBuffer buffer = newBuffer(calculateBufferSize(numPoints, numRings));
  putHeader(buffer, ShapeType.POLYGON, numPoints, numRings);
  putRingOffsets(buffer, polygon, 0);
  putPolygonPoints(buffer, polygon);
  return buffer.array();
}

代码示例来源:origin: org.datasyslab/geospark

private static byte[] serialize(Polygon polygon)
{
  int numRings = polygon.getNumInteriorRing() + 1;
  int numPoints = polygon.getNumPoints();
  ByteBuffer buffer = newBuffer(calculateBufferSize(numPoints, numRings));
  putHeader(buffer, ShapeType.POLYGON, numPoints, numRings);
  putRingOffsets(buffer, polygon, 0);
  putPolygonPoints(buffer, polygon);
  return buffer.array();
}

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

private static void addElemInfo(List elemInfoList, MultiPolygon polys,
  final int STARTING_OFFSET, final int GTYPE) {
  Polygon poly;
  int offset = STARTING_OFFSET;
  int LEN = D(GTYPE) + L(GTYPE);
  for (int i = 0; i < polys.getNumGeometries(); i++) {
    poly = (Polygon) polys.getGeometryN(i);
    addElemInfo(elemInfoList, poly, offset, GTYPE);
    if( isRectangle( poly )){
      offset += (2 * LEN);                
    }
    else {
      offset += (poly.getNumPoints() * LEN);                
    }            
  }
}

相关文章