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

x33g5p2x  于2022-01-19 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(199)

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

Geometry.equalsNorm介绍

[英]Tests whether two geometries are exactly equal in their normalized forms. This is a convenience method which creates normalized versions of both geometries before computing #equalsExact(Geometry).

This method is relatively expensive to compute. For maximum performance, the client should instead perform normalization on the individual geometries at an appropriate point during processing.
[中]测试两个几何体的规格化形式是否完全相等。这是一种方便的方法,可以在计算#equalsExact(几何体)之前创建两种几何体的规范化版本。
这种方法的计算成本相对较高。为了获得最佳性能,客户机应该在处理过程中的适当点对各个几何图形执行标准化。

代码示例

代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-queryalgebra-geosparql

  1. public boolean equals(Shape s1, Shape s2) {
  2. return shapeFactory.getGeometryFrom(s1).equalsNorm(shapeFactory.getGeometryFrom(s2));
  3. }

代码示例来源:origin: locationtech/jts

  1. void checkExpectedEnvelopeGeometry(String wktInput, String wktEnvGeomExpected)
  2. throws ParseException
  3. {
  4. Geometry input = reader.read(wktInput);
  5. Geometry envGeomExpected = reader.read(wktEnvGeomExpected);
  6. Envelope env = input.getEnvelopeInternal();
  7. Geometry envGeomActual = geometryFactory.toGeometry(env);
  8. boolean isEqual = envGeomActual.equalsNorm(envGeomExpected);
  9. assertTrue(isEqual);
  10. }

代码示例来源:origin: locationtech/jts

  1. private void runLineSequencer(String[] inputWKT, String expectedWKT)
  2. throws ParseException
  3. {
  4. List inputGeoms = fromWKT(inputWKT);
  5. LineSequencer sequencer = new LineSequencer();
  6. sequencer.add(inputGeoms);
  7. boolean isCorrect = false;
  8. if (! sequencer.isSequenceable()) {
  9. assertTrue(expectedWKT == null);
  10. }
  11. else {
  12. Geometry expected = rdr.read(expectedWKT);
  13. Geometry result = sequencer.getSequencedLineStrings();
  14. boolean isOK = expected.equalsNorm(result);
  15. if (! isOK) {
  16. System.out.println("ERROR - Expected: " + expected);
  17. System.out.println(" Actual: " + result);
  18. }
  19. assertTrue(isOK);
  20. boolean isSequenced = LineSequencer.isSequenced(result);
  21. assertTrue(isSequenced);
  22. }
  23. }

相关文章