类 GridData

    • 字段详细资料

      • data

        public double[][] data
        Grid data
      • xArray

        public double[] xArray
      • yArray

        public double[] yArray
      • missingValue

        public double missingValue
      • fieldName

        public java.lang.String fieldName
    • 构造器详细资料

      • GridData

        public GridData()
        Constructor
      • GridData

        public GridData​(GridData aGridData)
        Constructor
        参数:
        aGridData - The grid data
      • GridData

        public GridData​(double xStart,
                        double xDelt,
                        int xNum,
                        double yStart,
                        double yDelt,
                        int yNum)
        Constructor
        参数:
        xStart - xArray start
        xDelt - xArray delt
        xNum - xArray number
        yStart - yArray start
        yDelt - yArray delt
        yNum - yArray number
      • GridData

        public GridData​(Array array,
                        java.util.List<java.lang.Number> xdata,
                        java.util.List<java.lang.Number> ydata,
                        double missingValue,
                        ProjectionInfo projInfo)
        Constructor
        参数:
        array - Data array
        xdata - X data
        ydata - Y data
        missingValue - Missing value
        projInfo - Projection info
      • GridData

        public GridData​(Array array,
                        Array xdata,
                        Array ydata)
        Constructor
        参数:
        array - Data array
        xdata - X data
        ydata - Y data
      • GridData

        public GridData​(Array array,
                        Array xdata,
                        Array ydata,
                        java.lang.Number missingValue)
        Constructor
        参数:
        array - Data array
        xdata - X data
        ydata - Y data
        missingValue - Missing value
    • 方法详细资料

      • getXNum

        public int getXNum()
        Get xArray number
        返回:
        xArray number
      • getYNum

        public int getYNum()
        Get yArray number
        返回:
        yArray number
      • getXDelt

        public double getXDelt()
        Get xArray delt
        返回:
        xArray delt
      • getYDelt

        public double getYDelt()
        Get yArray delt
        返回:
        yArray delt
      • getExtent

        public Extent getExtent()
        Get Extent
        返回:
        Extent
      • isGlobal

        public boolean isGlobal()
        Get if the data is global
        返回:
        If the data is global
      • isXStagger

        public boolean isXStagger()
        Get if is x stagger
        返回:
        Boolean
      • setXStagger

        public void setXStagger​(boolean value)
        Set if is x stagger
        参数:
        value - Boolean
      • isYStagger

        public boolean isYStagger()
        Get if is y stagger
        返回:
        Boolean
      • setYStagger

        public void setYStagger​(boolean value)
        Set if is y stagger
        参数:
        value - Boolean
      • getValue

        public java.lang.Number getValue​(int i,
                                         int j)
        Get value
        参数:
        i - I index
        j - J index
        返回:
        Value
      • getDoubleValue

        public double getDoubleValue​(int i,
                                     int j)
        Get double value
        参数:
        i - I index
        j - J index
        返回:
        Double value
      • add

        public GridData add​(GridData bGrid)
        Add operation with another grid data
        参数:
        bGrid - The grid data
        返回:
        Added grid data
      • add

        public GridData add​(double value)
        Add operation with a double value
        参数:
        value - Double value
        返回:
        Added grid data
      • sub

        public GridData sub​(GridData bGrid)
        Subtraction operation with another grid data
        参数:
        bGrid - The grid data
        返回:
        Subtracted grid data
      • sub

        public GridData sub​(double value)
        Subtraction operation with a double value
        参数:
        value - The double value
        返回:
        Subtracted grid data
      • mul

        public GridData mul​(GridData bGrid)
        Multiply operation with another grid data
        参数:
        bGrid - The grid data
        返回:
        Result grid data
      • mul

        public GridData mul​(double value)
        Multiply operation with a double value
        参数:
        value - Double value
        返回:
        Result grid data
      • div

        public GridData div​(GridData bGrid)
        Divide operation with another grid data
        参数:
        bGrid - The grid data
        返回:
        Result grid data
      • div

        public GridData div​(double value)
        Divide operation with a double value
        参数:
        value - Double value
        返回:
        Result grid data
      • regrid

        public void regrid​(GridData gridData)
        Regrid data with double linear interpolation method
        参数:
        gridData - Result grid data
      • toStation

        public double toStation​(double x,
                                double y)
        Interpolate grid data to a station point
        参数:
        x - X coordinate of the station
        y - Y coordinate of the station
        返回:
        Interpolated value
      • toStation

        public java.util.List<java.lang.Double> toStation​(java.util.List<java.lang.Number> xlist,
                                                          java.util.List<java.lang.Number> ylist)
        Interpolate grid data to station points
        参数:
        xlist - X coordinate list
        ylist - Y coordinate list
        返回:
        Result data list
      • toStation

        public StationData toStation​(StationData stData)
        Interpolate grid data to station data
        参数:
        stData - Station data
        返回:
        Interpolated station data
      • toStation

        public void toStation​(StationTableData stData)
        Interpolate grid data to station data
        参数:
        stData - Station table data
      • toStation

        public void toStation​(java.lang.String inFile,
                              java.lang.String outFile)
                       throws java.io.UnsupportedEncodingException,
                              java.io.FileNotFoundException,
                              java.io.IOException
        Interpolate grid data to stations imported from station file
        参数:
        inFile - Input station file
        outFile - Output station file
        抛出:
        java.io.UnsupportedEncodingException
        java.io.FileNotFoundException
        java.io.IOException
      • setValue

        public GridData setValue​(GridData bGrid)
        Set grid values by anthor grid data - overlay
        参数:
        bGrid - The grid data
        返回:
        Result grid data
      • setValue

        public GridData setValue​(GridData bGrid,
                                 boolean useMissingData)
        Set grid values by anthor grid data - overlay
        参数:
        bGrid - The grid data
        useMissingData - if set missing data
        返回:
        Result grid data
      • setValue

        public GridData setValue​(double aValue)
        Set constant value to all grid cells
        参数:
        aValue - The value
        返回:
        Result grid data
      • replaceValue

        public void replaceValue​(double aValue,
                                 double bValue)
        Replace a certain grid data value by a new value
        参数:
        aValue - Old value
        bValue - New value
      • replaceValue

        public void replaceValue​(double aValue,
                                 double bValue,
                                 boolean bigger)
        Replace grid data value by a threshold - the values bigger/smaller than the threshold value will be replaced by the new value
        参数:
        aValue - Threshold value
        bValue - New value
        bigger - Bigger or smaller
      • merge

        public GridData merge​(GridData bGrid)
        Merge grid values by anthor grid data - the two grids should have same extent replace missing value with valid data
        参数:
        bGrid - The grid data
        返回:
        Result grid data
      • max

        public GridData max​(GridData bGrid)
        Maximum operation with another grid data
        参数:
        bGrid - The grid data
        返回:
        Maximum grid data
      • min

        public GridData min​(GridData bGrid)
        Minimum operation with another grid data
        参数:
        bGrid - The grid data
        返回:
        Minimum grid data
      • sum

        public double sum()
        Calculate summary value
        返回:
        Summary value
      • average

        public double average()
        Calculate average value
        返回:
        Average value
      • average

        public double[] average​(GridData bGrid,
                                double[] tValues)
        Calculate average data array by another grid data and threshold values
        参数:
        bGrid - The grid data
        tValues - Threshold values
        返回:
        Average values
      • statistics

        public double[] statistics()
        Simple statistics of the grid data
        返回:
        Result array - average, standard deviation
      • abs

        public GridData abs()
        Calculate abstract grid data
        返回:
        Result grid data
      • acos

        public GridData acos()
        Calculate anti-cosine grid data
        返回:
        Result grid data
      • asin

        public GridData asin()
        Calculate anti-sine grid data
        返回:
        Result grid data
      • atan

        public GridData atan()
        Calculate anti-tangent grid data
        返回:
        Result grid data
      • cos

        public GridData cos()
        Calculate cosine grid data
        返回:
        Result grid data
      • sin

        public GridData sin()
        Calculate sine grid data
        返回:
        Result grid data
      • tan

        public GridData tan()
        Calculate tangent grid data
        返回:
        Result grid data
      • exp

        public GridData exp()
        Calculate e raised specific power value of grid data
        返回:
        Result grid data
      • pow

        public GridData pow​(double p)
        Calculate power grid data
        参数:
        p - Power value
        返回:
        Result grid data
      • sqrt

        public GridData sqrt()
        Calculate square root grid data
        返回:
        Result grid data
      • log

        public GridData log()
        Calculate logrithm grid data
        返回:
        Result grid data
      • log10

        public GridData log10()
        Calculate base 10 logrithm grid data
        返回:
        Result grid data
      • extendToGlobal

        public void extendToGlobal()
        Extend the grid data to global by add a new column data
      • getArray

        public Array getArray()
        Get array from data
        返回:
        Array
      • getDimensions

        public java.util.List<Dimension> getDimensions()
        Get dimensions
        返回:
        Dimensions
      • extract

        public GridData extract​(Extent extent)
        Extract grid data by extent
        参数:
        extent - Extent
        返回:
        Extracted grid data
      • extract

        public GridData extract​(double sX,
                                double eX,
                                double sY,
                                double eY)
        Extract grid data by extent
        参数:
        sX - Start X
        eX - End X
        sY - Start Y
        eY - End Y
        返回:
        Grid data
      • extract

        public GridData extract​(int sXIdx,
                                int sYIdx,
                                int xNum,
                                int yNum)
        Extract grid data by extent index
        参数:
        sXIdx - Start x index
        sYIdx - Start y index
        xNum - X number
        yNum - Y number
        返回:
        Extracted grid data
      • extract

        public GridData extract​(int sXIdx,
                                int eXIdx,
                                int xstep,
                                int sYIdx,
                                int eYIdx,
                                int ystep)
        Extract grid data by extent index
        参数:
        sXIdx - Start x index
        eXIdx - End x index
        xstep - X step
        sYIdx - Start y index
        eYIdx - End y index
        ystep - Y step
        返回:
        Extracted grid data
      • setMissingValue

        public void setMissingValue​(double value,
                                    boolean isBigger)
        Set missing value - bigger or smaller than the given value
        参数:
        value - The given value
        isBigger - Is bigger or not
      • skip

        public GridData skip​(int skipI,
                             int skipJ)
        Skip the grid data by two dimension skip factor
        参数:
        skipI - Skip number in x coordinate
        skipJ - Skip number in y coordinate
        返回:
        Grid data
      • getValue

        public double getValue​(double x,
                               double y)
        Get a cell value by X/Y coordinate - nearest cell
        参数:
        x - X coordinate
        y - Y coordinate
        返回:
        Cell value
      • toStation_Gaussian

        public double toStation_Gaussian​(double x,
                                         double y)
        Interpolate grid data to a station point
        参数:
        x - X coordinate of the station
        y - Y coordinate of the station
        返回:
        Interpolated value
      • gassianToLatLon

        public void gassianToLatLon()
        Convert Gassian grid to lat/lon grid
      • GassianToLatLon_Simple

        public void GassianToLatLon_Simple()
        Convert Gassian grid to lat/lon grid - only convert Y coordinate
      • getXMin

        public double getXMin()
        Get minimum x
        返回:
        Minimum x
      • getXMax

        public double getXMax()
        Get maximum x
        返回:
        Maximum x
      • getYMin

        public double getYMin()
        Get minimum y
        返回:
        Minimum y
      • getYMax

        public double getYMax()
        Get maximum y
        返回:
        Maximum y
      • getBorderXMin

        public double getBorderXMin()
        Get minimum x of the grid border
        返回:
        Minimum x of the grid border
      • getBorderXMax

        public double getBorderXMax()
        Get maximum x of the grid border
        返回:
        Maximum x of the grid border
      • getBorderYMin

        public double getBorderYMin()
        Get minimum y of the grid border
        返回:
        Minimum y of the grid border
      • getBorderYMax

        public double getBorderYMax()
        Get maximum y of the grid border
        返回:
        Maximum y of the grid border
      • getIJIndex

        public int[] getIJIndex​(double x,
                                double y)
        Get i/j index of a point in the grid
        参数:
        x - The x coordinate
        y - The y coordinate
        返回:
        I/J index array
      • saveAsSurferASCIIFile

        public void saveAsSurferASCIIFile​(java.lang.String aFile)
        Save as Surfer ASCII data file
        参数:
        aFile - File path
      • saveAsESRIASCIIFile

        public void saveAsESRIASCIIFile​(java.lang.String aFile)
        Save as ESRI ASCII data file
        参数:
        aFile - File path
      • saveAsBILFile

        public void saveAsBILFile​(java.lang.String fileName)
                           throws java.io.IOException
        Save as BIL data file
        参数:
        fileName - File path
        抛出:
        java.io.IOException
      • saveAsStationData

        public void saveAsStationData​(java.lang.String filePath,
                                      java.lang.String fieldName)
        Save as station data file
        参数:
        filePath - File Path
        fieldName - Field name
      • getMaxMinValue

        public boolean getMaxMinValue​(double[] maxmin)
        Get maximum and minimum values
        参数:
        maxmin - Max/Min array
        返回:
        If has undefine data
      • hasMissing

        public boolean hasMissing()
        Get if has missing value
        返回:
        Boolean
      • hasNaN

        public boolean hasNaN()
        Get if has NaN value
        返回:
        Boolean
      • getMaxMinValue

        public double[] getMaxMinValue()
        Get maximum and minimum values
        返回:
        Max/Min array
      • getMaxValue

        public double getMaxValue()
        Get maximum value
        返回:
        Maximum value
      • getMinValue

        public double getMinValue()
        Get minimum value
        返回:
        Minimum value
      • testUniqueValues

        public boolean testUniqueValues()
        Test unique values
        返回:
        True if unique value number less then 20
      • getUniqueValues

        public java.util.List<java.lang.Number> getUniqueValues()
        Get unique values
        返回:
        Unique values
      • getGridDataSetting

        public GridDataSetting getGridDataSetting()
        Get grid data setting
        返回:
        Grid data setting
      • maskout

        public GridData maskout​(PolygonShape aPGS)
        Mask out grid data with a polygon shape
        参数:
        aPGS - The polygon shape
        返回:
        Maskouted grid data
      • maskout

        public GridData maskout​(java.util.List<PolygonShape> polygons)
        Mask out grid data with polygon shapes
        参数:
        polygons - The polygon shapes
        返回:
        Maskouted grid data
      • maskout

        public GridData maskout​(VectorLayer maskLayer)
        Mask out grid data with a polygon layer
        参数:
        maskLayer - The polygon layer
        返回:
        Maskouted grid data
      • maskout

        public GridData maskout​(GridData maskGrid)
        Mask out grid data by a mask grid data
        参数:
        maskGrid - Mask grid data
        返回:
        Result grid data
      • resample

        public GridData resample​(GridData toGridData,
                                 ResampleMethods method)
        Resample grid data
        参数:
        toGridData - The grid data
        method - The resample method
        返回:
        Result grid data
      • interpolate

        public GridData interpolate()
        Interpolate grid data
        返回:
        Result grid data
      • interpolation_Grid

        public double[][] interpolation_Grid​(double[][] GridData,
                                             double[] X,
                                             double[] Y,
                                             double unDefData,
                                             double[] nX,
                                             double[] nY)
        Interpolate from grid data
        参数:
        GridData - input grid data
        X - input x coordinates
        Y - input y coordinates
        unDefData - undefine data
        nX - output x coordinate
        nY - output y coordinate
        返回:
        output grid data
      • interpolate_old

        public GridData interpolate_old()
        Interpolate grid data
        返回:
        Result grid data
      • project

        public GridData project​(ProjectionInfo toProj)
        Project grid data
        参数:
        toProj - To projection
        返回:
        Projected grid data
      • project

        public GridData project​(ProjectionInfo fromProj,
                                ProjectionInfo toProj)
        Project grid data
        参数:
        fromProj - From projection
        toProj - To projection
        返回:
        Porjected grid data
      • project

        public GridData project​(ProjectionInfo fromProj,
                                ProjectionInfo toProj,
                                ResampleMethods resampleMethod)
        Project grid data
        参数:
        fromProj - From projection
        toProj - To projection
        resampleMethod - Interpolation method
        返回:
        Porjected grid data
      • project

        public GridData project​(ProjectionInfo toProj,
                                double[] newX,
                                double[] newY)
        Project grid data
        参数:
        toProj - To projection info
        newX - New xArray coordinates
        newY - New yArray coordinates
        返回:
        Projected grid data
      • project

        public GridData project​(ProjectionInfo toProj,
                                double[] newX,
                                double[] newY,
                                ResampleMethods resampleMethod)
        Project grid data
        参数:
        toProj - To projection info
        newX - New xArray coordinates
        newY - New yArray coordinates
        resampleMethod - Interpolation method
        返回:
        Projected grid data
      • project

        public GridData project​(ProjectionInfo fromProj,
                                ProjectionInfo toProj,
                                double[] newX,
                                double[] newY,
                                ResampleMethods resampleMethod)
        Project grid data
        参数:
        fromProj - From projection info
        toProj - To projection info
        newX - New xArray coordinates
        newY - New yArray coordinates
        resampleMethod - Interpolation method
        返回:
        Projected grid data
      • project

        public StationData project​(ProjectionInfo fromProj,
                                   ProjectionInfo toProj,
                                   StationData stData,
                                   ResampleMethods resampleMethod)
        Project grid data to station data
        参数:
        fromProj - From projection info
        toProj - To projection info
        stData - Station data
        resampleMethod - Interpolation method
        返回:
        Projected station data
      • aggregate

        public void aggregate​(GridData toGridData,
                              boolean isAverage)
        Aggregate the grid data to coarser resolution
        参数:
        toGridData - To grid data
        isAverage - If is average
      • unStagger_X

        public GridData unStagger_X()
        Un stag grid data through x dimension
        返回:
        Un stagged grid data
      • unStagger_Y

        public GridData unStagger_Y()
        Un stag grid data through y dimension
        返回:
        Un stagged grid data
      • clone

        public java.lang.Object clone()
        Clone
        覆盖:
        clone 在类中 java.lang.Object
        返回:
        Grid data object
      • yReverse

        public void yReverse()
        yArray reverse to the grid data
      • xReverse

        public void xReverse()
        xArray reverse to the grid data
      • toGridArray

        public GridArray toGridArray()
        Convert to GridArray object
        返回:
        GridArray object