本文整理了Java中org.postgis.Geometry.getType()
方法的一些代码示例,展示了Geometry.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.getType()
方法的具体详情如下:
包路径:org.postgis.Geometry
类名称: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(
内容来源于网络,如有侵权,请联系作者删除!