当前位置: 首页>>代码示例>>Java>>正文


Java GeoComputation.pointInPolygons方法代码示例

本文整理汇总了Java中org.meteoinfo.geoprocess.GeoComputation.pointInPolygons方法的典型用法代码示例。如果您正苦于以下问题:Java GeoComputation.pointInPolygons方法的具体用法?Java GeoComputation.pointInPolygons怎么用?Java GeoComputation.pointInPolygons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.meteoinfo.geoprocess.GeoComputation的用法示例。


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

示例1: maskout

import org.meteoinfo.geoprocess.GeoComputation; //导入方法依赖的package包/类
/**
 * Mask out grid data with polygon shapes
 *
 * @param polygons The polygon shapes
 * @return Maskouted grid data
 */
public GridData maskout(List<PolygonShape> polygons) {
    int xNum = this.getXNum();
    int yNum = this.getYNum();

    GridData cGrid = new GridData(this);
    for (int i = 0; i < yNum; i++) {
        for (int j = 0; j < xNum; j++) {
            if (GeoComputation.pointInPolygons(polygons, new PointD(xArray[j], yArray[i]))) {
                cGrid.data[i][j] = data[i][j];
            } else {
                cGrid.data[i][j] = missingValue;
            }
        }
    }

    return cGrid;
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:24,代码来源:GridData.java

示例2: maskout

import org.meteoinfo.geoprocess.GeoComputation; //导入方法依赖的package包/类
/**
 * Maskout station data
 *
 * @param polygonShapes Mask polygon shapes
 * @return Result station data
 */
public StationData maskout(List<PolygonShape> polygonShapes) {
    StationData stData = new StationData();
    stData.projInfo = this.projInfo;
    stData.missingValue = this.missingValue;
    for (int i = 0; i < this.getStNum(); i++) {
        if (GeoComputation.pointInPolygons(polygonShapes, new PointD(this.getX(i), this.getY(i)))) {
            stData.addData(this.getStid(i), this.getX(i), this.getY(i), this.getValue(i));
        }
    }

    return stData;
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:19,代码来源:StationData.java

示例3: maskin

import org.meteoinfo.geoprocess.GeoComputation; //导入方法依赖的package包/类
/**
 * Maskin station data
 *
 * @param polygonShapes Mask polygon shapes
 * @return Result station data
 */
public StationData maskin(List<PolygonShape> polygonShapes) {
    StationData stData = new StationData();
    stData.projInfo = this.projInfo;
    stData.missingValue = this.missingValue;
    for (int i = 0; i < this.getStNum(); i++) {
        if (!GeoComputation.pointInPolygons(polygonShapes, new PointD(this.getX(i), this.getY(i)))) {
            stData.addData(this.getStid(i), this.getX(i), this.getY(i), this.getValue(i));
        }
    }

    return stData;
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:19,代码来源:StationData.java

示例4: maskout

import org.meteoinfo.geoprocess.GeoComputation; //导入方法依赖的package包/类
/**
 * Maskout function
 *
 * @param a Array a
 * @param x X Array
 * @param y Y Array
 * @param polygons Polygons for maskout
 * @return Result array with cell values of missing outside polygons
 */
public static Array maskout(Array a, Array x, Array y, List<PolygonShape> polygons) {
    Array r = Array.factory(a.getDataType(), a.getShape());
    for (int i = 0; i < a.getSize(); i++) {
        if (GeoComputation.pointInPolygons(polygons, new PointD(x.getDouble(i), y.getDouble(i)))) {
            r.setObject(i, a.getObject(i));
        } else {
            r.setObject(i, Double.NaN);
        }
    }
    return r;
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:21,代码来源:ArrayMath.java

示例5: maskout_Remove

import org.meteoinfo.geoprocess.GeoComputation; //导入方法依赖的package包/类
/**
 * Maskout function
 *
 * @param a Array a
 * @param x X Array
 * @param y Y Array
 * @param polygons Polygons for maskout
 * @return Result arrays removing cells outside polygons
 */
public static Array[] maskout_Remove(Array a, Array x, Array y, List<PolygonShape> polygons) {
    List<Object> rdata = new ArrayList<>();
    List<Double> rxdata = new ArrayList<>();
    List<Double> rydata = new ArrayList<>();
    for (int i = 0; i < a.getSize(); i++) {
        if (GeoComputation.pointInPolygons(polygons, new PointD(x.getDouble(i), y.getDouble(i)))) {
            rdata.add(a.getObject(i));
            rxdata.add(x.getDouble(i));
            rydata.add(y.getDouble(i));
        }
    }

    int n = rdata.size();
    int[] shape = new int[1];
    shape[0] = n;
    Array r = Array.factory(a.getDataType(), shape);
    Array rx = Array.factory(x.getDataType(), shape);
    Array ry = Array.factory(y.getDataType(), shape);
    for (int i = 0; i < n; i++) {
        r.setObject(i, rdata.get(i));
        rx.setDouble(i, rxdata.get(i));
        ry.setDouble(i, rydata.get(i));
    }

    return new Array[]{r, rx, ry};
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:36,代码来源:ArrayMath.java


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