本文整理了Java中com.vividsolutions.jts.geom.Polygon.hasNullElements()
方法的一些代码示例,展示了Polygon.hasNullElements()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Polygon.hasNullElements()
方法的具体详情如下:
包路径:com.vividsolutions.jts.geom.Polygon
类名称:Polygon
方法名:hasNullElements
暂无
代码示例来源:origin: com.vividsolutions/jts
/**
* Constructs a <code>Polygon</code> with the given exterior boundary and
* interior boundaries.
*
*@param shell the outer boundary of the new <code>Polygon</code>,
* or <code>null</code> or an empty <code>LinearRing</code> if the empty
* geometry is to be created.
*@param holes the inner boundaries of the new <code>Polygon</code>
* , or <code>null</code> or empty <code>LinearRing</code>s if the empty
* geometry is to be created.
*/
public Polygon(LinearRing shell, LinearRing[] holes, GeometryFactory factory) {
super(factory);
if (shell == null) {
shell = getFactory().createLinearRing((CoordinateSequence)null);
}
if (holes == null) {
holes = new LinearRing[]{};
}
if (hasNullElements(holes)) {
throw new IllegalArgumentException("holes must not contain null elements");
}
if (shell.isEmpty() && hasNonEmptyElements(holes)) {
throw new IllegalArgumentException("shell is empty but holes are not");
}
this.shell = shell;
this.holes = holes;
}
代码示例来源:origin: com.vividsolutions/jts-core
/**
* Constructs a <code>Polygon</code> with the given exterior boundary and
* interior boundaries.
*
*@param shell the outer boundary of the new <code>Polygon</code>,
* or <code>null</code> or an empty <code>LinearRing</code> if the empty
* geometry is to be created.
*@param holes the inner boundaries of the new <code>Polygon</code>
* , or <code>null</code> or empty <code>LinearRing</code>s if the empty
* geometry is to be created.
*/
public Polygon(LinearRing shell, LinearRing[] holes, GeometryFactory factory) {
super(factory);
if (shell == null) {
shell = getFactory().createLinearRing((CoordinateSequence)null);
}
if (holes == null) {
holes = new LinearRing[]{};
}
if (hasNullElements(holes)) {
throw new IllegalArgumentException("holes must not contain null elements");
}
if (shell.isEmpty() && hasNonEmptyElements(holes)) {
throw new IllegalArgumentException("shell is empty but holes are not");
}
this.shell = shell;
this.holes = holes;
}
内容来源于网络,如有侵权,请联系作者删除!