CRS changes for revisions 27925:27931

This method has been fully rewritten. The SIS/Geotk method is lookupEpsgCode(IdentifiedObject, boolean) in the IdentifiedObjects class. Our implementation performs an extensive scan of EPSG database in an attempt to find the EPSG identifier when it has not been explicitely declared in the object.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r27925:27931 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/CRS.java
Revision 27925Revision 27931
import org.geotools.geometry.Envelope2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.geometry.GeneralDirectPosition;
import org.geotools.metadata.iso.extent.GeographicBoundingBoxImpl;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.geotools.referencing.factory.AbstractAuthorityFactory;
import org.geotools.geometry.Envelope2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.geometry.GeneralDirectPosition;
import org.geotools.metadata.iso.citation.Citations;
import org.geotools.metadata.iso.extent.GeographicBoundingBoxImpl;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.geotools.referencing.factory.AbstractAuthorityFactory;
}

/**
 * Looks up an identifier for the specified object. This method searchs in registered factories
 * for an object {@linkplain #equalsIgnoreMetadata equals, ignoring metadata}, to the specified
 * object. If such object is found, then its identifier is returned. Otherwise this method
}

/**
 * Determines the epsg from a crs object.
 * <p>
 * If the crs does not have an {@link Identifier} which corresponds to the
 * EPSG authority, this method will return <code>null</code>.
 * </p>
 * @param crs The coordinate reference system instance, must not be <code>null</code>.
 *
 * @return The epsg integer code for the crs, or <code>null</code> if none
 * exists.
 *
 * @since 2.5
 */
public static Integer getEPSGCode(CoordinateReferenceSystem crs) {
    Identifier id = AbstractIdentifiedObject.getIdentifier(crs, Citations.EPSG);
    if ( id != null ) {
        return Integer.parseInt(id.getCode());
    }
    return null;
}

/**
 * Looks up an identifier for the specified object. This method searchs in registered factories
 * for an object {@linkplain #equalsIgnoreMetadata equals, ignoring metadata}, to the specified
 * object. If such object is found, then its identifier is returned. Otherwise this method