org.postgis.Geometry.getType()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(102)

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

Geometry.getType介绍

[英]The OGIS geometry type number of this geometry.
[中]此几何体的OGIS几何体类型编号。

代码示例

代码示例来源:origin: com.mysema.querydsl/querydsl-sql

public static Geometry convert(org.postgis.Geometry geometry) {
  switch (geometry.getType()) {
  case org.postgis.Geometry.POINT:
    return convert((org.postgis.Point)geometry);
  case org.postgis.Geometry.LINESTRING:
    return convert((org.postgis.LineString)geometry);
  case org.postgis.Geometry.LINEARRING:
    return convert((org.postgis.LinearRing)geometry);
  case org.postgis.Geometry.POLYGON:
    return convert((org.postgis.Polygon)geometry);
  case org.postgis.Geometry.MULTILINESTRING:
    return convert((org.postgis.MultiLineString)geometry);
  case org.postgis.Geometry.MULTIPOINT:
    return convert((org.postgis.MultiPoint)geometry);
  case org.postgis.Geometry.MULTIPOLYGON:
    return convert((org.postgis.MultiPolygon)geometry);
  case org.postgis.Geometry.GEOMETRYCOLLECTION:
    return convert((org.postgis.GeometryCollection)geometry);
  }
  throw new IllegalArgumentException(geometry.toString());
}

代码示例来源:origin: com.querydsl/querydsl-sql-spatial

public static Geometry convert(org.postgis.Geometry geometry) {
  switch (geometry.getType()) {
  case org.postgis.Geometry.POINT:
    return convert((org.postgis.Point) geometry);
  case org.postgis.Geometry.LINESTRING:
    return convert((org.postgis.LineString) geometry);
  case org.postgis.Geometry.LINEARRING:
    return convert((org.postgis.LinearRing) geometry);
  case org.postgis.Geometry.POLYGON:
    return convert((org.postgis.Polygon) geometry);
  case org.postgis.Geometry.MULTILINESTRING:
    return convert((org.postgis.MultiLineString) geometry);
  case org.postgis.Geometry.MULTIPOINT:
    return convert((org.postgis.MultiPoint) geometry);
  case org.postgis.Geometry.MULTIPOLYGON:
    return convert((org.postgis.MultiPolygon) geometry);
  case org.postgis.Geometry.GEOMETRYCOLLECTION:
    return convert((org.postgis.GeometryCollection) geometry);
  }
  throw new IllegalArgumentException(geometry.toString());
}

代码示例来源:origin: deegree/deegree3

if ( geometry != null ) {
  Geometry geom = geometry.getGeometry();
  int pgType = geom.getType();
  if ( pgType != Geometry.POLYGON ) {
    throw new UnsupportedOperationException(

相关文章