/*
 * Copyright 2015 georgeathanasopoulos.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package eu.dnetlib.espas.util;

/** Class used for holding mappings of ESPAS CRS to standard ones used in postgis.
 */
public class CRSMapping {
    private String espasCRS;
    private String cxformCRS;
    private String sridCode;
    private int srid;
    private boolean invertedXY;
    private double zScaleFactor;

    public CRSMapping(String espasCRS, int srid, String sridCode, boolean invertedXY, double zScaleFactor) {
        this.espasCRS = espasCRS;
        this.srid = srid;
        this.sridCode = sridCode;
        this.invertedXY = invertedXY;
        this.zScaleFactor = zScaleFactor;
        this.cxformCRS = espasCRS.replace("http://ontology.espas-fp7.eu/crs/", "");
        if (cxformCRS.endsWith("spherical") || cxformCRS.endsWith("cartesian") || cxformCRS.endsWith("geocentric") || cxformCRS.endsWith("geodetic")) {
            cxformCRS = cxformCRS.replace("geodetic", "").replace("geocentric", "").replace("cartesian", "").replace("spherical", "");
        }
    }

    public String getEspasCRS() {
        return espasCRS;
    }

    public int getSrid() {
        return srid;
    }

    public String getSridCode() {
        return sridCode;
    }

    public boolean isInvertedXY() {
        return invertedXY;
    }

    public double getzScaleFactor() {
        return zScaleFactor;
    }

    public String getCxformCRS() {
        return cxformCRS;
    }
    
}
