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

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

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

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;
}

相关文章