Class SpatialArgs

    • Method Detail

      • calcDistanceFromErrPct

        public static double calcDistanceFromErrPct​(Shape shape,
                                                    double distErrPct,
                                                    SpatialContext ctx)
        Computes the distance given a shape and the distErrPct. The algorithm is the fraction of the distance from the center of the query shape to its closest bounding box corner.
        Parameters:
        shape - Mandatory.
        distErrPct - 0 to 0.5
        ctx - Mandatory
        Returns:
        A distance (in degrees).
      • resolveDistErr

        public double resolveDistErr​(SpatialContext ctx,
                                     double defaultDistErrPct)
        Gets the error distance that specifies how precise the query shape is. This looks at getDistErr(), getDistErrPct(), and defaultDistErrPct.
        Parameters:
        defaultDistErrPct - 0 to 0.5
        Returns:
        >= 0
      • getShape

        public Shape getShape()
      • setShape

        public void setShape​(Shape shape)
      • setDistErrPct

        public void setDistErrPct​(Double distErrPct)
      • getDistErr

        public Double getDistErr()
        The acceptable error of the shape. This effectively inflates the size of the shape but should not shrink it.
        Returns:
        >= 0
      • setDistErr

        public void setDistErr​(Double distErr)