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

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

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

Polygon.toText介绍

暂无

代码示例

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

public String toText() {
  return polygon.toText();
}

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

// build polygon p1
Polygon p1 = new GeometryFactory().createPolygon(new Coordinate[]{new Coordinate(0,0), new Coordinate(0,10), new Coordinate(10,10), new Coordinate(10,0), new Coordinate(0,0)});
// build polygon p2
Polygon p2 = new GeometryFactory().createPolygon(new Coordinate[]{new Coordinate(0,0), new Coordinate(0,30), new Coordinate(5,30), new Coordinate(5,0), new Coordinate(0,0)});
// calculate polygon3 as the union of p1 and p2
Polygon p3 = (Polygon) p1.union(p2);
// print simple WKT
System.out.println(p3.toText());

代码示例来源:origin: net.di2e.ecdr.libs/cdr-rest-search-commons

/**
 * Converts a boundingbox to a WKT-based string.
 *
 * @param bbox BoundingBox to convert to WKT.
 * @return WKT String.
 */
public static String bboxToWKT(BoundingBox bbox) {
  return JTS.toGeometry(bbox).toText();
}

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

holes.toArray(new LinearRing[holes.size()])).toText();

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

holes.toArray(new LinearRing[holes.size()])).toText();

代码示例来源:origin: org.opengis.cite/ets-kml2

.format(ErrorMessageKeys.OUTSIDE_CRS, jtsPolygon.toText()));

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

@Test
public void testInstantiationWithGPF() throws GraphException {
  GPF.getDefaultInstance().getOperatorSpiRegistry().loadOperatorSpis();
  GeometryFactory gf = new GeometryFactory();
  Polygon polygon = gf.createPolygon(gf.createLinearRing(new Coordinate[]{
      new Coordinate(-5, 5),
      new Coordinate(5, 5),
      new Coordinate(5, -5),
      new Coordinate(-5, -5),
      new Coordinate(-5, 5),
  }), null);
  HashMap<String, Object> parameters = new HashMap<>();
  parameters.put("geoRegion", polygon.toText());
  parameters.put("fullSwath", true);
  final Product sp = createTestProduct(100, 100);
  assertNotNull(sp.getGeoCoding());
  Product tp = GPF.createProduct("Subset", parameters, sp);
  assertNotNull(tp);
  assertEquals(100, tp.getSceneRasterWidth());
  assertEquals(50, tp.getSceneRasterHeight());
}

代码示例来源:origin: org.opengis.cite/ets-kml2

ErrorMessageKeys.OUTSIDE_CRS, jtsPolygon.toText()),
new ErrorLocator(-1, -1, XMLUtils.buildXPointer(quad)));
ErrorMessageKeys.RING_NOT_CCW, jtsPolygon.toText()),
new ErrorLocator(-1, -1, XMLUtils.buildXPointer(quad)));
ErrorMessageKeys.QUAD_NOT_CONVEX, jtsPolygon.toText()),
new ErrorLocator(-1, -1, XMLUtils.buildXPointer(quad)));

代码示例来源:origin: io.jeo/jeo-postgis

String wkt = poly.toText();
args.add(new Pair(wkt, Types.VARCHAR));
args.add(new Pair(srid, Types.INTEGER));

代码示例来源:origin: eu.agrosense.server/observations

.setValue(String.valueOf(dim1.height));
meg1PM.getAt(MeasurementGrid.PROP_BOUNDING_BOX)
    .setValue(JTS.toGeometry(bb1).toText());
meg1PM.getAt(MeasurementGrid.PROP_MEASUREMENTS)
    .setValue(new MeasurementsConverter().toString(val1));

代码示例来源:origin: eu.agrosense.server/observations

newObsPM.getAt(Observation.PROP_BOUNDING_BOX).setValue(JTS.toGeometry(newObsEnvelope).toText());

相关文章