org.locationtech.jts.geom.Polygon.equalsTopo()方法的使用及代码示例

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

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

Polygon.equalsTopo介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

public boolean equals(Geometry g) {
  return polygon.equalsTopo(g);
}

代码示例来源:origin: geotools/geotools

/**
 * Returns true if the geometry covers the entire world
 *
 * @param geometry
 * @return
 */
private boolean isWorld(Literal geometry) {
  if (geometry != null) {
    Geometry g = geometry.evaluate(null, Geometry.class);
    if (g != null) {
      return JTS.toGeometry(WORLD).equalsTopo(g.union());
    }
  }
  return false;
}

代码示例来源:origin: geotools/geotools

public void testStringToGeometry() throws Exception {
  Geometry geometry =
      factory.createConverter(String.class, Geometry.class, null)
          .convert("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))", Geometry.class);
  assertNotNull(geometry);
  assertTrue(
      new GeometryFactory()
          .createPolygon(
              new GeometryFactory()
                  .createLinearRing(
                      new Coordinate[] {
                        new Coordinate(0, 0),
                        new Coordinate(1, 0),
                        new Coordinate(1, 1),
                        new Coordinate(0, 1),
                        new Coordinate(0, 0)
                      }),
              null)
          .equalsTopo(geometry));
}

代码示例来源:origin: geotools/geotools

public void testEnvelopeToGeometry() throws Exception {
  Geometry geometry =
      factory.createConverter(Envelope.class, Geometry.class, null)
          .convert(
              new Envelope(new Coordinate(0, 0), new Coordinate(1, 1)),
              Geometry.class);
  assertNotNull(geometry);
  assertTrue(
      new GeometryFactory()
          .createPolygon(
              new GeometryFactory()
                  .createLinearRing(
                      new Coordinate[] {
                        new Coordinate(0, 0),
                        new Coordinate(1, 0),
                        new Coordinate(1, 1),
                        new Coordinate(0, 1),
                        new Coordinate(0, 0)
                      }),
              null)
          .equalsTopo(geometry));
}

代码示例来源:origin: ngageoint/elasticgeo

/**
 * Returns true if the geometry covers the entire world
 * @param geometry
 * @return
 */
protected boolean isWorld(Literal geometry) {
  boolean result = false;
  if(geometry != null) {
    Geometry g = geometry.evaluate(null, Geometry.class);
    if(g != null) {
      result = JTS.toGeometry(WORLD).equalsTopo(g.union());
    }
  }
  return result;
}

相关文章