Remember to go back to insersect and step at the first intersection and return true
SpaBoundsPoint
Nodes in a linked list
Variables
- Col - column in the grid
- Row - row in the grid
- Easting - projected coordinate for the grid cell
- Northing - projected coordinate for the grid cell
- Previous - reference to the previous SpaBoundsPoint object in the list. If there is only one point in the list, previous points to the first point.
- Next - reference to the next SpaBoundsPoint object in the list. If there is only one point in the list, next points to the first point.
SpaProjectedBounds
Contains and manages the linked list for the bounds points around the bounds of best fit.
Variables
- FirstPoint - first SpaBoundsPoint in the linked list.
- NumPoints - number of SpaBoundsPoints in the linked list
- ThePolygon -
- Xs - x coordinate values of the current bounding polygon (None when not allocated)
- Ys - y coordinate values of the current bounding polygon (None when not allocated)
SpaProjectorGrid
Finds the projected grid and DesiredBounds.
Variables
Functions
CheckCell(Status, CellCol,CellRow,FoundInsideResult)
Checks a cell to see if
- If CheckCellValid(CellCol,CellRow)==False then the cell cannot be added
- Else
- Go around the cell to find the first adjacent cell that is INSIDE
- Offset arrays are used to go around the cell
- Go around the cell from the first inside cell until an OUTSIDE or UNKNOWN cell is found
- Count the number of adjacent OUTSIDE or UKNOWN cells until we find an inside cell
- At this point:
- StartOutsideIndex=Offset array inside to the first OUTSIDE cell after the INSIDE cell
- LastInsideSideIndex=Offset array index to the INSIDE cell just before the OUTSIDE cell
- NumSidesOutside=Number of sides that have an adjance OUTSIDE cell
- Check for the segement between two new points to intersect the existing bounds
- Check for the new points inside the existing bounds
-
SpaProjectorGrids
Contains and manages the SpaProjectorGrid objects for each geographic bounding polygon. Also computes and makes avaialble arrays of X,Y coordinates and a polygon for the bounds.
Settings
- ProjectionCode
- LongName
- LonMin
- LatMin
- LonMax
- LatMax
- LonStep
- LatStep
- TextFlag
- AreaDistortionMax
- AreaDistortionMin
- DistanceDistortionMax
- DistanceDistortionMin
- AdjacentAreaChangeMax?
- AdjacentAreaChangeMin?
- AdjacentDistanceChangeMax?
- AdjacentDistanceChangeMin?
Move into settings?
Variables
- TheProjectorProj - Proj.org projection engine reference object
- OriginalGeographicBoundingPolys - array of geographic bouding polygons (typically rectangular)
- GridProjectors - projectors for each of the geographic bounding polygons
- OriginalProjectedBoundingPolys - OriginalGeographicBoundingPolys in projected space
- OriginalProjectedBoundingBox - rectangular bounds of the OriginalProjectedBoundingPolys
Functions
GetGoodProjectedBounds
This is main function to find a good bounding polygon for the current projection settings.
Uses
- NumColumns
- NumRows
- Eastings
- Northings
Modifies
- CellStatuses - sets the statues to OUTSIDE or INSIDE
- BoundsPoints - adds points to the BoundsPoints list
Approach:
- Finds the starting cell
- Checks the starting cell and three cells to the north and east for not nan
- Adds the four starting cells to the bounds:
- Create an SpaBoundsPoint object
- Insert the SpaBoundsPoint into the ProjectedBounds object
- Set the new SpaBoundsPoint into the BoundsPoints array
- Update the status of the four starting cells to INSIDE
-