com.vividsolutions.jts.geom.Point.compareTo()方法的使用及代码示例

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

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

Point.compareTo介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Collections.sort(line, new Comparator<Point>() {
  public int compare(Point v, Point w) {
    return v.compareTo(w);
  }
});

代码示例来源:origin: org.geotools/gt-render

public int compareTo(Object o, CoordinateSequenceComparator comp) {
  return point.compareTo(o, comp);
}

代码示例来源:origin: org.geotools/gt-render

public int compareTo(Object o) {
  return point.compareTo(o);
}

代码示例来源:origin: bcdev/beam

@Test
  public void testCreatePlainFeature() {
    SimpleFeatureType sft = PlainFeatureFactory.createPlainFeatureType("MyPoint",
                                      Point.class,
                                      DefaultGeographicCRS.WGS84);

    final GeometryFactory gf = new GeometryFactory();
    final Point point = gf.createPoint(new Coordinate(0.5, 0.6));

    final SimpleFeature feature1 = PlainFeatureFactory.createPlainFeature(sft, "_1", point, "fill:#0033AA");

    assertEquals("_1", feature1.getID());
    assertEquals(point, feature1.getDefaultGeometry());
    assertEquals(point, feature1.getAttribute(PlainFeatureFactory.ATTRIB_NAME_GEOMETRY));
    assertEquals("fill:#0033AA", feature1.getAttribute(PlainFeatureFactory.ATTRIB_NAME_STYLE_CSS));

    SimpleFeature feature2 = PlainFeatureFactory.createPlainFeature(sft, "_2", null, "fill:#0033AA");
    assertNotNull(feature2.getDefaultGeometry());
    assertTrue(gf.createPoint(new Coordinate()).compareTo(feature2.getDefaultGeometry()) == 0);

    final SimpleFeature feature3 = PlainFeatureFactory.createPlainFeature(sft, "_3", point, null);
    assertEquals(null, feature3.getAttribute(PlainFeatureFactory.ATTRIB_NAME_STYLE_CSS));
  }
}

相关文章