Class S2ShapeIndex.FaceEdge

  • Enclosing class:
    S2ShapeIndex

    private static final class S2ShapeIndex.FaceEdge
    extends java.lang.Object
    FaceEdge stores temporary edge data while the index is being updated. FaceEdge represents an edge in the UV coordinates of a specific face, without any clipping. ClippedEdge, by comparison, contains the UV bound of the portion of the edge that intersects each cell.

    While it would be possible to combine all the edge information into ClippedEdge, there will be many clipped edges for each original face edge, and only the UV bound is different. Keeping the shared fields on this separate class provides two advantages:

    • Memory usage. Separating the two classes means that we only need to store one copy of the per-face data no matter how many times an edge is subdivided, and it also lets us delay computing bounding boxes until they are needed for processing each face (when the dataset spans multiple faces).
    • Performance. UpdateEdges is significantly faster on large polygons when the data is separated, because it often only needs to access the data in ClippedEdge and this data is cached more successfully.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FaceEdge​(int shapeId, int edgeId, S2Point va, S2Point vb, R2Vector a, R2Vector b, double cellSizeToLongEdgeRatio)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • shapeId

        private final int shapeId
        The shape that this edge belongs to.
      • edgeId

        private final int edgeId
        Edge id within that shape.
      • maxLevel

        private final int maxLevel
        Not desirable to subdivide this edge beyond this level.
      • ax

        private final double ax
        The edge endpoints, clipped to a given face. .
      • ay

        private final double ay
      • bx

        private final double bx
      • by

        private final double by
    • Constructor Detail

    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object