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

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

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

Polygon.getArea介绍

[英]Returns the area of this Polygon
[中]返回此Polygon的面积

代码示例

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

public double getArea() {
  return polygon.getArea();
}

代码示例来源:origin: stackoverflow.com

Polygon[] shapes=new Polygon[4];
shapes[0]=new Polygon(input);
shapes[1] = new Square(input);
shapes[2] = new Circle(input);
shapes[3] = new Rectangle(input);
for(Polygon p:shapes){
  System.out.println(p.getArea());
}

代码示例来源:origin: net.disy.wps/wps-api

@ProcessMethod
 @OutputParameter(
 //
 id = "area",
 //
 title = "Polygon area",
 //
 description = "Area of the polygon rounded to a long as string")
 public String getArea(
 //
   @InputParameter(
   //
   id = "inputPolygon",
   //
   title = "Input polygon",
   //
   description = "The polygon to calculate the area")//
   Polygon polygon) {
  return String.valueOf(Math.round(polygon.getArea()));
 }
}

代码示例来源:origin: net.disy.wps/wps-api

private Message createMessage(Polygon polygon) {
 final MessageType messageType = wpspdObjectFactory.createMessageType();
 messageType.setContent("Area:" + polygon.getArea());
 final Message message = wpspdObjectFactory.createMessage(messageType);
 return message;
}

代码示例来源:origin: org.geoserver.extension/imagemap

private static boolean skipHole(LineString hole,double scale) {
  GeometryFactory gFac=new GeometryFactory(hole.getPrecisionModel(),hole.getSRID());
  LinearRing ext=gFac.createLinearRing(hole.getCoordinates());
  Polygon holePoly=gFac.createPolygon(ext, new LinearRing[] {});
  // if hole area is less than the tolerance, skip it
  if(holePoly.getArea()<HOLE_AREA_TOLERANCE*scale*scale)			
    return true;
  
  return false;
}

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

for (int t = 0; t < clippedPolys.size(); t++) {
  cpoly = (Polygon) clippedPolys.get(t);
  if (cpoly.getArea() > maxSize) {
    maxPoly = cpoly;
    maxSize = cpoly.getArea();

代码示例来源:origin: com.conveyal/r5

outerRings.sort(Comparator.comparing(ring -> polygonsForOuterRing.get(ring).getArea()).reversed());
  if (hole.getValue().getArea() < 1e-6) continue;

代码示例来源:origin: conveyal/r5

outerRings.sort(Comparator.comparing(ring -> polygonsForOuterRing.get(ring).getArea()).reversed());
  if (hole.getValue().getArea() < 1e-6) continue;

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

for (int t = 0; t < clippedPolys.size(); t++) {
  cpoly = (Polygon) clippedPolys.get(t);
  final double area = cpoly.getArea();
  if (area > maxSize) {
    maxPoly = cpoly;

代码示例来源:origin: shizuchengxuyuan/net.sz.java

rpb.setNumPoints((int) ((Math.sqrt(jtsPolygon.getArea() / scale / scale) + 1) * 5));
} else {
  rpb.setNumPoints((int) ((Math.sqrt(jtsPolygon.getArea()) + 1) * 5));

代码示例来源:origin: jzyong/game-server

int randomPointNum = 1;
if (editor) {
  randomPointNum = (int) ((Math.sqrt(polygon.getArea() / scale / scale) + 1) * 5);
} else {
  randomPointNum = (int) ((Math.sqrt(polygon.getArea()) + 1) * 5);

代码示例来源:origin: jzyong/game-server

randomPointNum = (int) ((Math.sqrt(polygon.getArea() / scale / scale) + 1) * 5);
} else {
  randomPointNum = (int) ((Math.sqrt(polygon.getArea()) + 1) * 5);

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

try {
  Polygon polygon = GeometryUtils.createGeotoolsPolygon(coords);
  area = polygon.getArea();
} catch (IllegalArgumentException e) {
  log.warn(e.getMessage());

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

try {
  Polygon polygon = GeometryUtils.createGeotoolsPolygon(coords);
  area = polygon.getArea();
} catch (IllegalArgumentException e) {
  log.warn(e.getMessage());

代码示例来源:origin: shizuchengxuyuan/net.sz.java

rpb.setNumPoints((int) ((Math.sqrt(jtsPolygon.getArea() / scale / scale) + 1) * 5));
} else {
  rpb.setNumPoints((int) ((Math.sqrt(jtsPolygon.getArea()) + 1) * 5));

代码示例来源:origin: org.geoserver.script/gs-script-js

public void testExecuteBufferedUnion() throws Exception {
  ScriptProcess process = createProcess("bufferedUnion");
  WKTReader wktReader = new WKTReader();
  Map<String, Object> input = new HashMap<String, Object>();
  ArrayList<Geometry> geoms = new ArrayList<Geometry>(2);
  geoms.add(wktReader.read("POINT (0 0)"));
  geoms.add(wktReader.read("POINT (1 0)"));
  input.put("geom", geoms);
  input.put("distance", 2);
  Map<String, Object> output = process.execute(input, null);
  assertNotNull("output", output);
  assertTrue("result in outputs", output.containsKey("result"));
  Object obj = output.get("result");
  assertTrue("result type", obj instanceof Polygon);
  Polygon geom = (Polygon) obj;
  assertEquals(16.43, geom.getArea(), 0.01);
}

代码示例来源:origin: sinergise/Sentinel2ProductIngestor

public ExtendedTileInfo(TileInfo tileInfo, ProductInfo productInfo, TileMetadata s3Tile) {
  super(tileInfo);
  setProductName(productInfo.getName());
  setProductPath(productInfo.getPath());
  setTileOrigin(GeoJsonUtils.toGeoJson(s3Tile.getTileOrigin()));
  setTileGeometry(GeoJsonUtils.toGeoJson(s3Tile.getTileGeometry()));
  if (s3Tile.getTileDataGeometry() != null) {
    setTileDataGeometry(GeoJsonUtils.toGeoJson(s3Tile.getTileDataGeometry()));
    dataCoveragePercentage =  Math.round(10000.*s3Tile.getTileDataGeometry().getArea()/s3Tile.getTileGeometry().getArea())/100.0;
  }
  cloudyPixelPercentage = Math.round(100.*s3Tile.getCloudyPixelsPercentage())/100.;
}

代码示例来源:origin: org.geoserver.script/gs-script-js

Object result = buffer.evaluate(feature);
assertTrue(result instanceof Polygon);
assertTrue(((Polygon) result).getArea() > 35314);

代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig

newFeature.setAttribute("area", polygon.getArea());

代码示例来源:origin: org.geoserver/wms

for (int i = 0; i < numGeoms; i++) {
  Polygon poly = (Polygon) geom.getGeometryN(i);
  if (poly.getArea() > maxSize) {
    if (displayGeom.intersects(poly)) {
      geom = poly;
      maxSize = poly.getArea();

相关文章