本文整理了Java中org.locationtech.jts.geom.Geometry.reverse()
方法的一些代码示例,展示了Geometry.reverse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.reverse()
方法的具体详情如下:
包路径:org.locationtech.jts.geom.Geometry
类名称:Geometry
方法名:reverse
[英]Computes a new geometry which has all component coordinate sequences in reverse order (opposite orientation) to this one.
[中]计算一个新几何图形,该几何图形的所有零部件坐标序列与此几何图形的顺序相反(方向相反)。
代码示例来源:origin: geotools/geotools
public Geometry reverse() {
return geometry.reverse();
}
代码示例来源:origin: locationtech/jts
public static Geometry reverse(Geometry g) { return g.reverse(); }
public static Geometry normalize(Geometry g)
代码示例来源:origin: orbisgis/h2gis
/**
* Returns the geometry with vertex order reversed.
*
* @param geometry Geometry
* @return geometry with vertex order reversed
*/
public static Geometry reverse(Geometry geometry) {
if (geometry == null) {
return null;
}
if (geometry instanceof MultiPoint) {
return reverseMultiPoint((MultiPoint) geometry);
}
return geometry.reverse();
}
代码示例来源:origin: locationtech/jts
public Geometry reverse() {
Polygon poly = (Polygon) copy();
poly.shell = (LinearRing) shell.copy().reverse();
poly.holes = new LinearRing[holes.length];
for (int i = 0; i < holes.length; i++) {
poly.holes[i] = (LinearRing) holes[i].copy().reverse();
}
return poly;// return the clone
}
}
代码示例来源:origin: locationtech/jts
/**
* Creates a {@link MultiLineString} in the reverse
* order to this object.
* Both the order of the component LineStrings
* and the order of their coordinate sequences
* are reversed.
*
* @return a {@link MultiLineString} in the reverse order
*/
public Geometry reverse()
{
int nLines = geometries.length;
LineString[] revLines = new LineString[nLines];
for (int i = 0; i < geometries.length; i++) {
revLines[nLines - 1 - i] = (LineString)geometries[i].reverse();
}
return getFactory().createMultiLineString(revLines);
}
代码示例来源:origin: locationtech/jts
/**
* Creates a {@link MultiPolygon} with
* every component reversed.
* The order of the components in the collection are not reversed.
*
* @return a MultiPolygon in the reverse order
*/
public Geometry reverse()
{
int n = geometries.length;
Polygon[] revGeoms = new Polygon[n];
for (int i = 0; i < geometries.length; i++) {
revGeoms[i] = (Polygon) geometries[i].reverse();
}
return getFactory().createMultiPolygon(revGeoms);
}
代码示例来源:origin: locationtech/jts
/**
* Creates a {@link GeometryCollection} with
* every component reversed.
* The order of the components in the collection are not reversed.
*
* @return a {@link GeometryCollection} in the reverse order
*/
public Geometry reverse()
{
int n = geometries.length;
Geometry[] revGeoms = new Geometry[n];
for (int i = 0; i < geometries.length; i++) {
revGeoms[i] = geometries[i].reverse();
}
return getFactory().createGeometryCollection(revGeoms);
}
}
代码示例来源:origin: orbisgis/h2gis
/**
* Returns the MultiPoint with vertex order reversed. We do our own
* implementation here because JTS does not handle it.
*
* @param mp MultiPoint
* @return MultiPoint with vertex order reversed
*/
public static Geometry reverseMultiPoint(MultiPoint mp) {
int nPoints = mp.getNumGeometries();
Point[] revPoints = new Point[nPoints];
for (int i = 0; i < nPoints; i++) {
revPoints[nPoints - 1 - i] = (Point) mp.getGeometryN(i).reverse();
}
return mp.getFactory().createMultiPoint(revPoints);
}
}
代码示例来源:origin: locationtech/jts
void runAll(List geoms, double dist)
{
Stopwatch sw = new Stopwatch();
//System.out.println("Geom count = " + geoms.size() + " distance = " + dist);
int count = 0;
for (Iterator i = geoms.iterator(); i.hasNext(); ) {
Geometry g = (Geometry) i.next();
runBuffer(g, dist);
runBuffer(g.reverse(), dist);
//System.out.print(".");
count++;
if (count > MAX_FEATURE) return;
}
//System.out.println(" " + sw.getTimeString());
}
void runBuffer(Geometry g, double dist)
内容来源于网络,如有侵权,请联系作者删除!