uk.ac.leeds.ccg.andyt.gws.core
Class FixedGWS

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler
      extended by uk.ac.leeds.ccg.andyt.gws.core.GWS
          extended by uk.ac.leeds.ccg.andyt.gws.core.FixedGWS
All Implemented Interfaces:
java.io.Serializable

public class FixedGWS
extends GWS

This class contains methods for generating Grid2DSquareCellDoubles that are spatially weighted statistics known as Fixed Geographically Weighted Statistics (GWS). They are 'fixed' because the spatial scales over which the statistics are generalised is the same for every cell in the grid. Owing to the fixed nature of the scales, there are a number of relevant optimisations for improving memory usage and speed of computation. The task of calculating Fixed GWS can be readily divided by partitioning the result space into discrete chunks and using subsets of the loaded points. By subsetting the points, the points within a fixed distance of a cell centoid may be identified more speedily. Additionally a memory can be stored of which points lie in a somewhat larger region, and this can be used to identify points within a fixed distance of a neighbouring cell centoid more speedily. The optimal way to go about generating results depends as usual on the available memory and processing speed of the computer hardware being used. To really optimise one should consider the inherent parallelism and the utilisation of parallel computing hardware. The optimal amount of division depends on the distance or scale at which the GWS are to be generated, the size of the result, and both of these things relative to the resolution of the result and the amount of available memory. The methods in this class are only concerned with optimising for the result space and points array passed in.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.leeds.ccg.andyt.gws.core.GWS
GWS.Point2DBigDecimal_DistanceBigDecimal_IDInt, GWS.Point2DDouble_DistanceDouble_IDInt
 
Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.gws.core.GWS
cellsizeDouble, col, grid2DSquareCellProcessor, row, weightFactor, weightIntersect
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve
 
Constructor Summary
FixedGWS()
          Default constructor
 
Method Summary
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet, java.awt.geom.Point2D.Double[] point2DDoubles, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor)
          Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet, java.awt.geom.Point2D.Double[] point2DDoubles, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int distanceFactor)
          Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet, Point2DBigDecimal[] point2DBigDecimals, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int decimalPlaces)
          Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet, Point2DBigDecimal[] point2DBigDecimals, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int distanceFactor, int decimalPlaces)
          Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(int divisions, java.awt.geom.Point2D.Double[] point2DDoubles, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int distanceFactor)
          Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(int divisions, Point2DBigDecimal[] point2DBigDecimals, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int distanceFactor)
          Returns an Grid2DSquareCellDouble that has values corresponding to the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.awt.geom.Point2D.Double[] point2DDoubles, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor)
          Returns an Grid2DSquareCellDouble that has values corresponding to the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.awt.geom.Point2D.Double[] point2DDoubles, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int distanceFactor)
          Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(Point2DBigDecimal[] point2DBigDecimals, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int decimalPlaces)
          Returns an Grid2DSquareCellDouble that has values corresponding to the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.
 uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(Point2DBigDecimal[] point2DBigDecimals, uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble, double distanceDouble, double weightIntersect, double weightFactor, int distanceFactor, int decimalPlaces)
          Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor
 
Methods inherited from class uk.ac.leeds.ccg.andyt.gws.core.GWS
getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts, getInDistancePoint2DBigDecimal_DistanceBigDecimal_IDInts, getInDistancePoint2DDouble_DistanceDouble_IDInts, getInDistancePoint2DDouble_DistanceDouble_IDInts, getInDistancePoint2DDouble_DistanceDouble_IDIntsArray, getInDistancePoint2DDouble_DistanceDouble_IDIntsArray, getInDistancePointIDs, getInDistancePointIDs, getNearestPoint2DDouble_DistanceDouble_IDInts, getNearestPoint2DDouble_DistanceDouble_IDInts, getNearestPoint2DDouble_DistanceDouble_IDInts, getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo, getNearestPoint2DDouble_DistanceDouble_IDIntsAndOtherInfo
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler
clearMemoryReserve, initMemoryReserve, initMemoryReserve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedGWS

public FixedGWS()
Default constructor

Method Detail

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.awt.geom.Point2D.Double[] point2DDoubles,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor)
Returns an Grid2DSquareCellDouble that has values corresponding to the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.

Parameters:
points - The Point2DBigDecimal[] array to be used.
grid2DSquareCellDouble - The Grid2DSquareCellDouble defining the frame of the result.
distance - The bandwidth of the fixed kernel.
weightIntersect - The weight at the centre of the kernal.
weightFactor - The distance decay factor of the kernel.

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(Point2DBigDecimal[] point2DBigDecimals,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int decimalPlaces)
Returns an Grid2DSquareCellDouble that has values corresponding to the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor.

Parameters:
points - The Point2DBigDecimal[] array to be used.
grid2DSquareCellDouble - The Grid2DSquareCellDouble defining the frame of the result.
distance - The bandwidth of the fixed kernel.
weightIntersect - The weight at the centre of the kernal.
weightFactor - The distance decay factor of the kernel.

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet,
                                                                                          java.awt.geom.Point2D.Double[] point2DDoubles,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor)
Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor. Only the points with Integer key ids in pointIDsHashSet need be used.

Parameters:
pointIDsHashSet - HashSet of Integer key ids of points (a subset)
points - the points array to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet,
                                                                                          Point2DBigDecimal[] point2DBigDecimals,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int decimalPlaces)
Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor. Only the points with Integer key ids in pointIDsHashSet need be used.

Parameters:
pointIDsHashSet - HashSet of Integer key ids of points (a subset)
point2DBigDecimals - the Point2DBigDecimal[] to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.awt.geom.Point2D.Double[] point2DDoubles,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int distanceFactor)
Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor

Parameters:
points - the points array to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
distanceFactor - is used to calculate searchDistance which is used to store a memory of what points are in a given distance of a cell centroid. This memory may be used to calculate the result for neighbouring cells more speedily. It is recomended that a distanceFactor is set >= 2.
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(Point2DBigDecimal[] point2DBigDecimals,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int distanceFactor,
                                                                                          int decimalPlaces)
Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor

Parameters:
points - the points array to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
distanceFactor - is used to calculate searchDistance which is used to store a memory of what points are in a given distance of a cell centroid. This memory may be used to calculate the result for neighbouring cells more speedily. It is recomended that a distanceFactor is set >= 2.
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet,
                                                                                          java.awt.geom.Point2D.Double[] point2DDoubles,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int distanceFactor)
Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor. Only the points with Integer key ids in pointIDsHashSet need be used.

Parameters:
pointIDsHashSet - HashSet of Integer key ids of points (a subset)
points - the points array to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
distanceFactor - is used to calculate searchDistance which is used to store a memory of what points are in a given distance of a cell centroid. This memory may be used to calculate the result for neighbouring cells more speedily. It is recomended that a distanceFactor is set >= 2.
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(java.util.HashSet pointIDsHashSet,
                                                                                          Point2DBigDecimal[] point2DBigDecimals,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int distanceFactor,
                                                                                          int decimalPlaces)
Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor. Only the points with Integer key ids in pointIDsHashSet need be used.

Parameters:
pointIDsHashSet - HashSet of Integer key ids of points (a subset)
points - the points array to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
distanceFactor - is used to calculate searchDistance which is used to store a memory of what points are in a given distance of a cell centroid. This memory may be used to calculate the result for neighbouring cells more speedily. It is recomended that a distanceFactor is set >= 2.
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(int divisions,
                                                                                          java.awt.geom.Point2D.Double[] point2DDoubles,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int distanceFactor)
Returns an Grid2DSquareCellDouble that has values corresponding the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor. Only the points with Integer key ids in pointIDsHashSet need be used.

Parameters:
divisions - controls the number of times the problem is divided
points - the points array to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
distanceFactor - is used to calculate searchDistance which is used to store a memory of what points are in a given distance of a cell centroid. This memory may be used to calculate the result for neighbouring cells more speedily. It is recomended that a distanceFactor is set >= 2.
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel

getKernelWeightsInDistance

public uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble getKernelWeightsInDistance(int divisions,
                                                                                          Point2DBigDecimal[] point2DBigDecimals,
                                                                                          uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellDouble grid2DSquareCellDouble,
                                                                                          double distanceDouble,
                                                                                          double weightIntersect,
                                                                                          double weightFactor,
                                                                                          int distanceFactor)
Returns an Grid2DSquareCellDouble that has values corresponding to the sum of kernel weights for a fixed kernel with a radius given by distance and shape given by weightIntersect and weightFactor. Only the points with Integer key ids in pointIDsHashSet need be used.

Parameters:
divisions - controls the number of times the problem is divided
points - the points array to be used
grid - the Grid2DSquareCellDouble defining the frame and
distance - the bandwidth of the fixed kernel
distanceFactor - is used to calculate searchDistance which is used to store a memory of what points are in a given distance of a cell centroid. This memory may be used to calculate the result for neighbouring cells more speedily. It is recomended that a distanceFactor is set >= 2.
weightIntersect - the weight at the centre of the kernal
weightFactor - the distance decay factor of the kernel