private SpheroidProjectionBase CreatePolarStereographic(ProjectionCompilationParams opData)
        {
            Contract.Requires(opData != null);
            var latParam = new MultiParameterSelector(
                new LatitudeOfNaturalOriginParameterSelector(),
                new LatitudeOfTrueScaleParameterSelector());
            var originLonParam = new MultiParameterSelector(
                new LongitudeOfNaturalOriginParameterSelector(),
                new FullMatchParameterSelector("LONDOWNFROMPOLE"));// new KeywordNamedParameterSelector("LON", "ORIGIN");
            var offsetXParam = new FalseEastingParameterSelector();
            var offsetYParam = new FalseNorthingParameterSelector();
            var standardParallelParam = new StandardParallelParameterSelector();
            var scaleFactorParam = new ScaleFactorParameterSelector();
            opData.ParameterLookup.Assign(latParam, originLonParam, offsetXParam, offsetYParam, standardParallelParam, scaleFactorParam);

            var linearUnit = opData.StepParams.RelatedOutputCrsUnit;

            var fromSpheroid = opData.StepParams.ConvertRelatedOutputSpheroidUnit(linearUnit);
            if (null == fromSpheroid)
                return null;

            double latitude, longitude;
            if (!latParam.TryGetValueAsDouble(OgcAngularUnit.DefaultRadians, out latitude))
                latitude = 0;
            if (!originLonParam.TryGetValueAsDouble(OgcAngularUnit.DefaultRadians, out longitude))
                longitude = 0;

            double xOffset, yOffset;
            var offset = (offsetXParam.TryGetValueAsDouble(linearUnit, out xOffset) && offsetYParam.TryGetValueAsDouble(linearUnit, out yOffset))
                ? new Vector2(xOffset, yOffset)
                : Vector2.Zero;

            double scaleFactor;
            if (scaleFactorParam.TryGetValueAsDouble(ScaleUnitUnity.Value, out scaleFactor))
                return new PolarStereographic(new GeographicCoordinate(latitude,longitude), scaleFactor, offset, fromSpheroid);

            double standardParallel;
            if (standardParallelParam.TryGetValueAsDouble(OgcAngularUnit.DefaultRadians, out standardParallel)) {
                if (
                    (offsetXParam.IsSelected && opData.ParameterLookup.ParameterNameNormalizedComparer.Normalize(offsetXParam.Selection.Name).Contains("ORIGIN"))
                    || (offsetYParam.IsSelected && opData.ParameterLookup.ParameterNameNormalizedComparer.Normalize(offsetYParam.Selection.Name).Contains("ORIGIN"))
                ) {
                    return PolarStereographic.CreateFromStandardParallelAndFalseOffsetAtOrigin(longitude, standardParallel, offset, fromSpheroid);
                }
                return PolarStereographic.CreateFromStandardParallel(longitude, standardParallel, offset, fromSpheroid);
            }

            throw new InvalidOperationException();
        }
        private SpheroidProjectionBase CreateHotineObliqueMercator(ProjectionCompilationParams opData)
        {
            Contract.Requires(opData != null);

            var latParam = new MultiParameterSelector(
                new LatitudeOfCenterParameterSelector(),
                new LatitudeOfNaturalOriginParameterSelector());
            var lonParam = new MultiParameterSelector(
                new LongitudeOfCenterParameterSelector(),
                new LongitudeOfNaturalOriginParameterSelector());

            var scaleFactorParam = new ScaleFactorParameterSelector();
            var azimuthParam = new KeywordNamedParameterSelector("AZIMUTH");
            var angleSkewParam = new KeywordNamedParameterSelector("ANGLE", "SKEW");

            var offsetXParam = new FalseEastingParameterSelector();
            var offsetYParam = new FalseNorthingParameterSelector();
            var xAtOriginParam = new EastingAtCenterParameterSelector();
            var yAtOriginParam = new NorthingAtCenterParameterSelector();

            opData.ParameterLookup.Assign(latParam, lonParam, offsetXParam, offsetYParam, xAtOriginParam, yAtOriginParam, scaleFactorParam, azimuthParam, angleSkewParam);

            var spheroid = opData.StepParams.ConvertRelatedOutputSpheroidUnit(opData.StepParams.RelatedOutputCrsUnit);
            if (null == spheroid)
                return null;

            double lat, lon;
            if(!latParam.IsSelected || !latParam.TryGetValueAsDouble(OgcAngularUnit.DefaultRadians, out lat))
                lat = 0;
            if(!lonParam.IsSelected || !lonParam.TryGetValueAsDouble(OgcAngularUnit.DefaultRadians, out lon))
                lon = 0;
            var origin = new GeographicCoordinate(lat, lon);

            double scaleFactor;
            if (!scaleFactorParam.IsSelected || !TryGetDouble(scaleFactorParam.Selection, ScaleUnitUnity.Value, out scaleFactor))
                scaleFactor = 1.0;

            double azimuth;
            if (!azimuthParam.IsSelected || !TryGetDouble(azimuthParam.Selection, OgcAngularUnit.DefaultRadians, out azimuth))
                azimuth = 0;

            double angleSkew;
            if (!angleSkewParam.IsSelected || !TryGetDouble(angleSkewParam.Selection, OgcAngularUnit.DefaultRadians, out angleSkew))
                angleSkew = 0;

            var outputUnit = opData.StepParams.RelatedOutputCrsUnit;
            double x,y;
            if(xAtOriginParam.IsSelected || yAtOriginParam.IsSelected){
                if (!xAtOriginParam.IsSelected || !xAtOriginParam.TryGetValueAsDouble(outputUnit, out x))
                    x = 0;
                if (!yAtOriginParam.IsSelected || !yAtOriginParam.TryGetValueAsDouble(outputUnit, out y))
                    y = 0;
                return new HotineObliqueMercator.VariantB(new GeographicCoordinate(lat, lon), azimuth, angleSkew, scaleFactor, new Vector2(x,y), spheroid);
            }
            else {
                if (!offsetXParam.IsSelected || !offsetXParam.TryGetValueAsDouble(outputUnit, out x))
                    x = 0;
                if (!offsetYParam.IsSelected || !offsetYParam.TryGetValueAsDouble(outputUnit, out y))
                    y = 0;
                return new HotineObliqueMercator.VariantA(new GeographicCoordinate(lat, lon), azimuth, angleSkew, scaleFactor, new Vector2(x,y), spheroid);
            }
        }