本文整理了Java中com.vividsolutions.jts.geom.Point.toText()
方法的一些代码示例,展示了Point.toText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Point.toText()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Point
类名称:Point
方法名:toText
暂无
代码示例来源:origin: org.geotools/gt-render
public String toText() {
return point.toText();
}
代码示例来源:origin: net.di2e.ecdr.libs/cdr-rest-search-commons
/**
* Converts a point to a WKT-based string.
*
* @param point Point to convert to WKT.
* @return WKT String.
*/
public static String pointToWKT(org.opengis.geometry.primitive.Point point) {
return JTS.toGeometry(point.getDirectPosition()).toText();
}
代码示例来源:origin: org.orbisgis/mapeditor
@Override
protected void pointDone(Point point, MapContext mc, ToolManager tm)
throws TransitionException {
Graphics g = tm.getComponent().getGraphics();
if ((g != null) && (g instanceof Graphics2D)) {
// flash make the GUI unresponsive during 1s..
//SymbolUtil.flashPoint(point, (Graphics2D) g, tm.getMapTransform());
GUI_LOGGER.info(i18n.tr("Coordinate : {0}", point.toText()));
}
}
代码示例来源:origin: org.opengis.cite/ets-kml2
/**
* [Test] Verifies that a kml:Model element has a valid location (that
* specifies the position of the model origin).
*/
@Test(description = "ATC-133, ATC-150")
public void modelLocation() {
JTSGeometryBuilder geomBuilder = new JTSGeometryBuilder();
Polygon crsPolygon = geomBuilder.buildPolygon(new Envelope(-180, 180,
-90, 90));
for (int i = 0; i < targetElements.getLength(); i++) {
Element model = (Element) targetElements.item(i);
NodeList location = model.getElementsByTagNameNS(KML2.NS_NAME,
"Location");
if (location.getLength() == 0) {
throw new AssertionError(ErrorMessage.format(
ErrorMessageKeys.MISSING_INFOSET_ITEM, "kml:Location",
XMLUtils.buildXPointer(model)));
}
Point jtsPoint = geomBuilder
.buildPointFromLocation((Element) location.item(0));
Assert.assertTrue(
crsPolygon.covers(jtsPoint),
ErrorMessage.format(ErrorMessageKeys.OUTSIDE_CRS,
jtsPoint.toText()));
}
}
代码示例来源:origin: org.opengis.cite/ets-kml2
/**
* [Test] Verifies that a kml:Point element has valid coordinates. It must
* contain exactly one coordinate tuple in the default CRS.
*/
@Test(description = "ATC-103, ATC-114")
public void validPointCoordinates() {
JTSGeometryBuilder geomBuilder = new JTSGeometryBuilder();
Polygon crsPolygon = geomBuilder.buildPolygon(new Envelope(-180, 180,
-90, 90));
for (int i = 0; i < targetElements.getLength(); i++) {
Element point = (Element) targetElements.item(i);
Assert.assertTrue(coordsValidator.isValid(point),
coordsValidator.getErrorMessages());
Point jtsPoint = geomBuilder.buildPoint(point);
Assert.assertTrue(
crsPolygon.covers(jtsPoint),
ErrorMessage.format(ErrorMessageKeys.OUTSIDE_CRS,
jtsPoint.toText()));
}
}
代码示例来源:origin: jhpoelen/eol-globi-data
public Map<String, Object> findEcoregion(Point point) throws EcoregionFinderException {
lazyLoadStore();
try {
SimpleFeatureSource featureSource = store.getFeatureSource();
return getFeatureProperties(point, featureSource.getFeatures());
} catch (IOException e) {
throw new EcoregionFinderException("lookup feature for point [" + point.toText() + "] from shapefile at [" + config.getShapeFilePath() + "]", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!