Overview

Scripts

Folder: JavaScript Projections

Old

Folder: PythonGISApp

Utilities

Old

-----------------------

Classes

SpaProjectorGrids is the top of the projection library.

Inheritance tree:

SpaProjector

SpaProj

- Also defined in SpaPy library documentation

Projects from a source to a destination osgeo CRS

Static functions

SpaProjectorGrid

Settings

Member Functions

Private Member Functions

SpaProjectorGrids

Settings (Additional on top of SpaProjectorGrid)

Drawing Settings

TheProjectorGrids.SetSettings(SpaProjectorGrids,ProjectorGridSettings)

  1. Saves some settings as object variables

Setup

Sets up the projection engine,

 

  1. Sets up the object variables:
    1. LongitudeOfOrigin: - always 0
    2. LatitudeOfOrigin: - 90 to -90
    3. LonNewPole: - 180 to -180
    4. .LatNewPole: - 90 to -90
    5. SpecifiedLongitudeOfOrigin: Original longitude of origin the user specified
  2. Sets up parameters for proj
    1. Adds parameters except for lon_0
  3. Initializes proj
    1. LatNewPole and LonNewPole are specified individuall as if these have changed from the defaults, the X transform will be called and passed the requested projection method.
  4. Gets the geographic bounding boxes as a MultiPolygon geometry
    1. Initilze the grid projectors
    2. Get the grid projectors bounds in projected coordinates
    3. Compute OriginalProjectedBoundingBox
    4. OriginalProjectedBoundingPolys

Projecting

The approach is to (this is from SpaProjectorGrids.ProjectDataset():

  1. Get the OriginalGeographicBoundingBoxes (may be shifted for longitude of origin !=0 )
  2. Densify the dataset
  3. For each ProjectorGrid
    1. Densify the dataset
    2. Get the ProjectedBoundsArray (this currnetly has just one entry)
    3. For each ProjectedBounds
      1. Get the Geographic Bouding Polugon
      2. Buffer(0) the polygon
      3. If ClipToFinalProjectedBounds
        1. For each GeographicBoundingBox
          1. Intersect the data with the GeographicBoundingBox (which may be shifted)
          2. Shift the data if needed
          3. Clip the data with the GeographicBoundingPolygon
          4. Densify the clipped data
          5. Project the data
          6. If this resulted in data,
            1. Buffer(0)
            2. Add to the new dataset
      4. Else
        1. Just project the data
    4. Return the array of datasets