Beispiel #1
0
        public static CoordinateReferenceSystem Get(int tableId, int code)
        {
            CRSTable table = CRSTable.find(tableId);

            foreach (CoordinateReferenceSystem type in _types)
            {
                if (type._table == table && type._code == code)
                {
                    return(type);
                }
            }
            throw new InvalidValuesArgumentException("Unknown coordinate reference system: " + tableId + "-" + code);
        }
Beispiel #2
0
 public static CoordinateReferenceSystem Get(int code)
 {
     foreach (CRSTable table in CRSTable.values())
     {
         string href = table.href(code);
         foreach (CoordinateReferenceSystem type in _types)
         {
             if (type._href.Equals(href))
             {
                 return(type);
             }
         }
     }
     throw new InvalidValuesArgumentException("Unknown coordinate reference system code: " + code);
 }
Beispiel #3
0
 private CoordinateReferenceSystem(string name, CRSTable table, int code, int dimension, bool geographic)
 {
     Debug.Assert(name.ToLower().Equals(name));
     this._name       = name;
     this._table      = table;
     this._code       = code;
     this._href       = table.href(code);
     this._dimension  = dimension;
     this._geographic = geographic;
     if (geographic)
     {
         this._calculator = new CRSCalculator.GeographicCalculator(dimension);
     }
     else
     {
         this._calculator = new CRSCalculator.CartesianCalculator(dimension);
     }
 }