• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LinearRing类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.postgis.LinearRing的典型用法代码示例。如果您正苦于以下问题:Java LinearRing类的具体用法?Java LinearRing怎么用?Java LinearRing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LinearRing类属于org.postgis包,在下文中一共展示了LinearRing类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: reverseMap

import org.postgis.LinearRing; //导入依赖的package包/类
@Override
public Map<String, Object> reverseMap(List<LatLng> latLngs, Action action) {
    Point[] points = new Point[latLngs.size() + 1]; //+1 to close the ring
    List<LatLng> path = latLngs;
    for (int i = 0; i < path.size(); i++) {
        LatLng latLng = path.get(i);
        points[i] = new Point(latLng.getLng(), latLng.getLat());
    }
    //close the ring
    points[points.length - 1] = points[0];
    Polygon polygon = new Polygon(new LinearRing[]{new LinearRing(points)});
    polygon.setSrid(Mappers.WGS84_SRID);
    Map<String, Object> params = new HashMap<>(1);
    params.put(colName, new PGgeometry(polygon));
    return params;
}
 
开发者ID:vramirez122000,项目名称:trenurbanoapp,代码行数:17,代码来源:PolygonMapper.java


示例2: testBulkWithinPolygon

import org.postgis.LinearRing; //导入依赖的package包/类
@Test
public void testBulkWithinPolygon() throws SQLException {
    LinearRing linearRing1 = new LinearRing("0 0, 1 1, 1 2, 1 1, 0 0");
    Polygon polygon1 = new Polygon(new LinearRing[]{linearRing1});
    LinearRing linearRing2 = new LinearRing("1 1, 1 1, 1 2, 1 1, 1 1");
    Polygon polygon2 = new Polygon(new LinearRing[]{linearRing2});
    LinearRing linearRing3 = new LinearRing("2 2, 1 1, 1 2, 1 1, 2 2");
    Polygon polygon3 = new Polygon(new LinearRing[]{linearRing3});
    LinearRing linearRing4 = new LinearRing("1 3, 1 2, 2 2, 1 1, 1 3");
    Polygon polygon4 = new Polygon(new LinearRing[]{linearRing4});

    Vertex v1 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon1);
    Vertex v2 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon2);
    Vertex v3 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon3);
    Vertex v4 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon4);
    this.sqlgGraph.tx().commit();
    List<Vertex> vertices = this.sqlgGraph.traversal().V().hasLabel("Gis").has("polygon", P.within(polygon1, polygon3, polygon4)).toList();
    Assert.assertEquals(3, vertices.size());
    Assert.assertTrue(Arrays.asList(v1, v3, v4).containsAll(vertices));
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:21,代码来源:TestGisBulkWithin.java


示例3: testBulkWithinGeographyPolygon

import org.postgis.LinearRing; //导入依赖的package包/类
@Test
public void testBulkWithinGeographyPolygon() throws SQLException {
    LinearRing linearRing1 = new LinearRing("0 0, 1 1, 1 2, 1 1, 0 0");
    GeographyPolygon polygon1 = new GeographyPolygon(new LinearRing[]{linearRing1});
    LinearRing linearRing2 = new LinearRing("1 1, 1 1, 1 2, 1 1, 1 1");
    GeographyPolygon polygon2 = new GeographyPolygon(new LinearRing[]{linearRing2});
    LinearRing linearRing3 = new LinearRing("2 2, 1 1, 1 2, 1 1, 2 2");
    GeographyPolygon polygon3 = new GeographyPolygon(new LinearRing[]{linearRing3});
    LinearRing linearRing4 = new LinearRing("1 3, 1 2, 2 2, 1 1, 1 3");
    GeographyPolygon polygon4 = new GeographyPolygon(new LinearRing[]{linearRing4});

    Vertex v1 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon1);
    Vertex v2 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon2);
    Vertex v3 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon3);
    Vertex v4 = this.sqlgGraph.addVertex(T.label, "Gis", "polygon", polygon4);
    this.sqlgGraph.tx().commit();
    List<Vertex> vertices = this.sqlgGraph.traversal().V().hasLabel("Gis").has("polygon", P.within(polygon1, polygon3, polygon4)).toList();
    Assert.assertEquals(3, vertices.size());
    Assert.assertTrue(Arrays.asList(v1, v3, v4).containsAll(vertices));
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:21,代码来源:TestGisBulkWithin.java


示例4: before

import org.postgis.LinearRing; //导入依赖的package包/类
@Before
public void before() {
    table = "test_polygon";

    Point[] points = new Point[5];
    points[0] = new Point(123.45d, 23.45d);
    points[1] = new Point(124.45d, 23.45d);
    points[2] = new Point(124.45d, 24.45d);
    points[3] = new Point(123.45d, 24.45d);
    points[4] = new Point(123.45d, 23.45d);
    LinearRing linearRing = new LinearRing(points);
    t = new Polygon(new LinearRing[]{linearRing});
    t.setSrid(SRID);
}
 
开发者ID:eyougo,项目名称:mybatis-typehandlers-postgis,代码行数:15,代码来源:PolygonTypeHandlerTest.java


示例5: GeographyPolygon

import org.postgis.LinearRing; //导入依赖的package包/类
public GeographyPolygon(LinearRing[] rings) {
    super(rings);
    this.srid = Gis.SRID;
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:5,代码来源:GeographyPolygon.java



注:本文中的org.postgis.LinearRing类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CassandraConnector类代码示例发布时间:2022-05-22
下一篇:
Java PersistentEphemeralNode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap