本文整理了Java中com.vividsolutions.jts.geom.Geometry.reverse()
方法的一些代码示例,展示了Geometry.reverse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.reverse()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Geometry
类名称:Geometry
方法名:reverse
[英]Computes a new geometry which has all component coordinate sequences in reverse order (opposite orientation) to this one.
[中]计算一个新几何图形,该几何图形的所有零部件坐标序列与此几何图形的顺序相反(方向相反)。
代码示例来源:origin: com.vividsolutions/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: com.vividsolutions/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: com.vividsolutions/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: org.geotools/gt-render
public Geometry reverse() {
return geometry.reverse();
}
代码示例来源:origin: DataSystemsLab/GeoSpark
@Override
public Geometry reverse()
{
Geometry g = this.centerGeometry.reverse();
Circle newCircle = new Circle(g, this.radius);
return newCircle;
}
代码示例来源:origin: org.datasyslab/geospark
@Override
public Geometry reverse()
{
Geometry g = this.centerGeometry.reverse();
Circle newCircle = new Circle(g, this.radius);
return newCircle;
}
代码示例来源:origin: org.orbisgis/h2gis-functions
/**
* 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: org.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: com.vividsolutions/jts-core
/**
* 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: com.vividsolutions/jts-core
/**
* 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: com.vividsolutions/jts-core
/**
* 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: org.orbisgis/h2gis-functions
/**
* 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: org.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: mapplus/spatial_statistics_for_geotools_udig
public SimpleFeature next() throws NoSuchElementException {
SimpleFeature feature = delegate.next();
for (Object attribute : feature.getAttributes()) {
if (attribute instanceof Geometry) {
Geometry geometry = (Geometry) attribute;
attribute = geometry.reverse();
}
builder.add(attribute);
}
return builder.buildFeature(feature.getID());
}
}
代码示例来源:origin: osmlab/atlas
final List<Geometry> reversedPieces = map.slice(2000000L, geometry.reverse());
Assert.assertEquals(4, reversedPieces.size());
Assert.assertEquals("DOM",
Assert.assertEquals(pieces.get(0), reversedPieces.get(0).reverse());
Assert.assertEquals(pieces.get(1), reversedPieces.get(3).reverse());
Assert.assertEquals(pieces.get(2), reversedPieces.get(2).reverse());
Assert.assertEquals(pieces.get(3), reversedPieces.get(1).reverse());
代码示例来源:origin: mapplus/spatial_statistics_for_geotools_udig
} else {
line = line.reverse();
Double value = doValue.evaluate(source, Double.class);
if (value == null) {
内容来源于网络,如有侵权,请联系作者删除!