sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1731686 [2/5] - in /sis/branches/JDK6: ./ core/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ ...
Date Mon, 22 Feb 2016 16:56:42 GMT
Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java?rev=1731686&r1=1731685&r2=1731686&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java [UTF-8] Mon Feb 22 16:56:41 2016
@@ -88,7 +88,7 @@ public abstract class GeodeticAuthorityF
      *   │  └─ Function ……………………………………… Browse
      *   └─ Online resource (2 of 2)
      *      ├─ Linkage ………………………………………… jdbc:derby:/my/path/to/SIS_DATA/Databases/SpatialMetadata
-     *      ├─ Description ……………………………… EPSG dataset version 8.8 on “Apache Derby Embedded JDBC Driver” version 10.12.
+     *      ├─ Description ……………………………… EPSG dataset version 8.9 on “Apache Derby Embedded JDBC Driver” version 10.12.
      *      └─ Function ……………………………………… Connection
      * }
      *
@@ -103,7 +103,7 @@ public abstract class GeodeticAuthorityF
 
     /**
      * Returns all namespaces recognized by this factory. Those namespaces can appear before codes in
-     * calls to {@code createFoo(String)} methods, for example {@code "EPSG"} in {@code "EPSG::4326"}.
+     * calls to {@code createFoo(String)} methods, for example {@code "EPSG"} in {@code "EPSG:4326"}.
      * Namespaces are case-insensitive.
      *
      * <p>The namespaces are closely related to the {@linkplain #getAuthority() authority}. Often the namespace is
@@ -115,7 +115,7 @@ public abstract class GeodeticAuthorityF
      *   <li>The {@link org.apache.sis.referencing.factory.sql.EPSGFactory} authority identifier is {@code "EPSG"}
      *       and its {@code getCodeSpaces()} method returns a set containing {@code "EPSG"}. So in this example,
      *       authority and namespace match. That namespace value means that {@code EPSGFactory.createFoo(String)}
-     *       methods accept both {@code "EPSG::4326"} (case-insensitive) and {@code "4326"} codes as argument.</li>
+     *       methods accept both {@code "EPSG:4326"} (case-insensitive) and {@code "4326"} codes as argument.</li>
      *
      *   <li>The {@link org.apache.sis.referencing.factory.sql.EPSGDataAccess} authority identifier is {@code "EPSG"}
      *       but its {@code getCodeSpaces()} method returns an empty set. This means that despite the EPSG authority,
@@ -198,15 +198,15 @@ public abstract class GeodeticAuthorityF
      * Two frequently used authorities are "CRS" and "EPSG", which include the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Type</th>          <th>Description</th></tr>
-     *   <tr><td>CRS:84</td>     <td>Geographic</td>    <td>Like EPSG::4326 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
-     *   <tr><td>EPSG::4326</td> <td>Geographic</td>    <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::4979</td> <td>Geographic 3D</td> <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::4978</td> <td>Geocentric</td>    <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::3395</td> <td>Projected</td>     <td>WGS 84 / World Mercator</td></tr>
-     *   <tr><td>EPSG::5714</td> <td>Vertical</td>      <td>Mean Sea Level height</td></tr>
-     *   <tr><td>EPSG::6349</td> <td>Compound</td>      <td>NAD83(2011) + NAVD88 height</td></tr>
-     *   <tr><td>EPSG::5800</td> <td>Engineering</td>   <td>Astra Minas Grid</td></tr>
+     *   <tr><th>Code</th>       <th>Type</th>         <th>Description</th></tr>
+     *   <tr><td>CRS:84</td>     <td>Geographic</td>   <td>Like EPSG:4326 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
+     *   <tr><td>EPSG:4326</td> <td>Geographic</td>    <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:4979</td> <td>Geographic 3D</td> <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:4978</td> <td>Geocentric</td>    <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:3395</td> <td>Projected</td>     <td>WGS 84 / World Mercator</td></tr>
+     *   <tr><td>EPSG:5714</td> <td>Vertical</td>      <td>Mean Sea Level height</td></tr>
+     *   <tr><td>EPSG:6349</td> <td>Compound</td>      <td>NAD83(2011) + NAVD88 height</td></tr>
+     *   <tr><td>EPSG:5800</td> <td>Engineering</td>   <td>Astra Minas Grid</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -238,20 +238,20 @@ public abstract class GeodeticAuthorityF
      * Two frequently used authorities are "CRS" and "EPSG", which include the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Type</th>          <th>Description</th></tr>
-     *   <tr><td>CRS:27</td>     <td>Geographic</td>    <td>Like EPSG::4267 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
-     *   <tr><td>CRS:83</td>     <td>Geographic</td>    <td>Like EPSG::4269 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
-     *   <tr><td>CRS:84</td>     <td>Geographic</td>    <td>Like EPSG::4326 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
-     *   <tr><td>EPSG::4322</td> <td>Geographic</td>    <td>World Geodetic System 1972</td></tr>
-     *   <tr><td>EPSG::4985</td> <td>Geographic 3D</td> <td>World Geodetic System 1972</td></tr>
-     *   <tr><td>EPSG::4326</td> <td>Geographic</td>    <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::4979</td> <td>Geographic 3D</td> <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::4267</td> <td>Geographic</td>    <td>North American Datum 1927</td></tr>
-     *   <tr><td>EPSG::4269</td> <td>Geographic</td>    <td>North American Datum 1983</td></tr>
-     *   <tr><td>EPSG::4230</td> <td>Geographic</td>    <td>European Datum 1950</td></tr>
-     *   <tr><td>EPSG::4258</td> <td>Geographic</td>    <td>European Terrestrial Reference Frame 1989</td></tr>
-     *   <tr><td>EPSG::4937</td> <td>Geographic 3D</td> <td>European Terrestrial Reference Frame 1989</td></tr>
-     *   <tr><td>EPSG::4047</td> <td>Geographic</td>    <td>GRS 1980 Authalic Sphere</td></tr>
+     *   <tr><th>Code</th>      <th>Type</th>          <th>Description</th></tr>
+     *   <tr><td>CRS:27</td>    <td>Geographic</td>    <td>Like EPSG:4267 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
+     *   <tr><td>CRS:83</td>    <td>Geographic</td>    <td>Like EPSG:4269 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
+     *   <tr><td>CRS:84</td>    <td>Geographic</td>    <td>Like EPSG:4326 except for (<var>longitude</var>, <var>latitude</var>) axis order</td></tr>
+     *   <tr><td>EPSG:4322</td> <td>Geographic</td>    <td>World Geodetic System 1972</td></tr>
+     *   <tr><td>EPSG:4985</td> <td>Geographic 3D</td> <td>World Geodetic System 1972</td></tr>
+     *   <tr><td>EPSG:4326</td> <td>Geographic</td>    <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:4979</td> <td>Geographic 3D</td> <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:4267</td> <td>Geographic</td>    <td>North American Datum 1927</td></tr>
+     *   <tr><td>EPSG:4269</td> <td>Geographic</td>    <td>North American Datum 1983</td></tr>
+     *   <tr><td>EPSG:4230</td> <td>Geographic</td>    <td>European Datum 1950</td></tr>
+     *   <tr><td>EPSG:4258</td> <td>Geographic</td>    <td>European Terrestrial Reference Frame 1989</td></tr>
+     *   <tr><td>EPSG:4937</td> <td>Geographic 3D</td> <td>European Terrestrial Reference Frame 1989</td></tr>
+     *   <tr><td>EPSG:4047</td> <td>Geographic</td>    <td>GRS 1980 Authalic Sphere</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -282,10 +282,10 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::4936</td> <td>European Terrestrial Reference Frame 1989</td></tr>
-     *   <tr><td>EPSG::4978</td> <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::4984</td> <td>World Geodetic System 1972</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:4936</td> <td>European Terrestrial Reference Frame 1989</td></tr>
+     *   <tr><td>EPSG:4978</td> <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:4984</td> <td>World Geodetic System 1972</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -317,10 +317,10 @@ public abstract class GeodeticAuthorityF
      * Some of them are:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::3034</td> <td>ETRS89 / Lambert Conic Conformal Europe</td></tr>
-     *   <tr><td>EPSG::3395</td> <td>WGS 84 / World Mercator</td></tr>
-     *   <tr><td>EPSG::6350</td> <td>NAD83(2011) / Conus Albers Equal Area</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:3034</td> <td>ETRS89 / Lambert Conic Conformal Europe</td></tr>
+     *   <tr><td>EPSG:3395</td> <td>WGS 84 / World Mercator</td></tr>
+     *   <tr><td>EPSG:6350</td> <td>NAD83(2011) / Conus Albers Equal Area</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -349,9 +349,9 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::5715</td> <td>Mean Sea Level depth</td></tr>
-     *   <tr><td>EPSG::5714</td> <td>Mean Sea Level height</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:5715</td> <td>Mean Sea Level depth</td></tr>
+     *   <tr><td>EPSG:5714</td> <td>Mean Sea Level height</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -398,9 +398,9 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::6349</td> <td>NAD83(2011) + NAVD88 height</td></tr>
-     *   <tr><td>EPSG::7423</td> <td>ETRS89 + EVRF2007 height</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:6349</td> <td>NAD83(2011) + NAVD88 height</td></tr>
+     *   <tr><td>EPSG:7423</td> <td>ETRS89 + EVRF2007 height</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -446,8 +446,8 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::5800</td> <td>Astra Minas Grid</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:5800</td> <td>Astra Minas Grid</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -496,12 +496,12 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which contains hundred of datum. Some of them are:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Type</th>        <th>Description</th></tr>
-     *   <tr><td>EPSG::6326</td> <td>Geodetic</td>    <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::6322</td> <td>Geodetic</td>    <td>World Geodetic System 1972</td></tr>
-     *   <tr><td>EPSG::1027</td> <td>Vertical</td>    <td>EGM2008 geoid</td></tr>
-     *   <tr><td>EPSG::5100</td> <td>Vertical</td>    <td>Mean Sea Level</td></tr>
-     *   <tr><td>EPSG::9315</td> <td>Engineering</td> <td>Seismic bin grid datum</td></tr>
+     *   <tr><th>Code</th>      <th>Type</th>        <th>Description</th></tr>
+     *   <tr><td>EPSG:6326</td> <td>Geodetic</td>    <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:6322</td> <td>Geodetic</td>    <td>World Geodetic System 1972</td></tr>
+     *   <tr><td>EPSG:1027</td> <td>Vertical</td>    <td>EGM2008 geoid</td></tr>
+     *   <tr><td>EPSG:5100</td> <td>Vertical</td>    <td>Mean Sea Level</td></tr>
+     *   <tr><td>EPSG:9315</td> <td>Engineering</td> <td>Seismic bin grid datum</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -530,11 +530,11 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which contains hundred of datum. Some of them are:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::6326</td> <td>World Geodetic System 1984</td></tr>
-     *   <tr><td>EPSG::6322</td> <td>World Geodetic System 1972</td></tr>
-     *   <tr><td>EPSG::6269</td> <td>North American Datum 1983</td></tr>
-     *   <tr><td>EPSG::6258</td> <td>European Terrestrial Reference System 1989</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:6326</td> <td>World Geodetic System 1984</td></tr>
+     *   <tr><td>EPSG:6322</td> <td>World Geodetic System 1972</td></tr>
+     *   <tr><td>EPSG:6269</td> <td>North American Datum 1983</td></tr>
+     *   <tr><td>EPSG:6258</td> <td>European Terrestrial Reference System 1989</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -564,11 +564,11 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::5100</td> <td>Mean Sea Level</td></tr>
-     *   <tr><td>EPSG::1027</td> <td>EGM2008 geoid</td></tr>
-     *   <tr><td>EPSG::1131</td> <td>Japanese Geodetic Datum 2011 (vertical)</td></tr>
-     *   <tr><td>EPSG::5215</td> <td>European Vertical Reference Frame 2007</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:5100</td> <td>Mean Sea Level</td></tr>
+     *   <tr><td>EPSG:1027</td> <td>EGM2008 geoid</td></tr>
+     *   <tr><td>EPSG:1131</td> <td>Japanese Geodetic Datum 2011 (vertical)</td></tr>
+     *   <tr><td>EPSG:5215</td> <td>European Vertical Reference Frame 2007</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -617,9 +617,9 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::9315</td> <td>Seismic bin grid datum</td></tr>
-     *   <tr><td>EPSG::9300</td> <td>Astra Minas</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:9315</td> <td>Seismic bin grid datum</td></tr>
+     *   <tr><td>EPSG:9300</td> <td>Astra Minas</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -667,10 +667,10 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::7030</td> <td>WGS 84</td></tr>
-     *   <tr><td>EPSG::7034</td> <td>Clarke 1880</td></tr>
-     *   <tr><td>EPSG::7048</td> <td>GRS 1980 Authalic Sphere</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:7030</td> <td>WGS 84</td></tr>
+     *   <tr><td>EPSG:7034</td> <td>Clarke 1880</td></tr>
+     *   <tr><td>EPSG:7048</td> <td>GRS 1980 Authalic Sphere</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -698,12 +698,12 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::8901</td> <td>Greenwich</td></tr>
-     *   <tr><td>EPSG::8903</td> <td>Paris</td></tr>
-     *   <tr><td>EPSG::8904</td> <td>Bogota</td></tr>
-     *   <tr><td>EPSG::8905</td> <td>Madrid</td></tr>
-     *   <tr><td>EPSG::8906</td> <td>Rome</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:8901</td> <td>Greenwich</td></tr>
+     *   <tr><td>EPSG:8903</td> <td>Paris</td></tr>
+     *   <tr><td>EPSG:8904</td> <td>Bogota</td></tr>
+     *   <tr><td>EPSG:8905</td> <td>Madrid</td></tr>
+     *   <tr><td>EPSG:8906</td> <td>Rome</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -731,9 +731,9 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::1262</td> <td>World</td></tr>
-     *   <tr><td>EPSG::3391</td> <td>World - between 80°S and 84°N</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:1262</td> <td>World</td></tr>
+     *   <tr><td>EPSG:3391</td> <td>World - between 80°S and 84°N</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -763,12 +763,12 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Type</th>              <th>Axes</th>                                    <th>Orientations</th>    <th>Unit</th></tr>
-     *   <tr><td>EPSG::4496</td> <td>Cartesian 2D CS</td>   <td>easting, northing (E,N)</td>                 <td>east, north</td>     <td>metre</td></tr>
-     *   <tr><td>EPSG::6422</td> <td>Ellipsoidal 2D CS</td> <td>latitude, longitude</td>                     <td>north, east</td>     <td>degree</td></tr>
-     *   <tr><td>EPSG::6423</td> <td>Ellipsoidal 3D CS</td> <td>latitude, longitude, ellipsoidal height</td> <td>north, east, up</td> <td>degree, degree, metre</td></tr>
-     *   <tr><td>EPSG::6404</td> <td>Spherical 3D CS</td>   <td>latitude, longitude, radius</td>             <td>north, east, up</td> <td>degree, degree, metre</td></tr>
-     *   <tr><td>EPSG::6499</td> <td>Vertical CS</td>       <td>height (H)</td>                              <td>up</td>              <td>metre</td></tr>
+     *   <tr><th>Code</th>      <th>Type</th>              <th>Axes</th>                                    <th>Orientations</th>    <th>Unit</th></tr>
+     *   <tr><td>EPSG:4496</td> <td>Cartesian 2D CS</td>   <td>easting, northing (E,N)</td>                 <td>east, north</td>     <td>metre</td></tr>
+     *   <tr><td>EPSG:6422</td> <td>Ellipsoidal 2D CS</td> <td>latitude, longitude</td>                     <td>north, east</td>     <td>degree</td></tr>
+     *   <tr><td>EPSG:6423</td> <td>Ellipsoidal 3D CS</td> <td>latitude, longitude, ellipsoidal height</td> <td>north, east, up</td> <td>degree, degree, metre</td></tr>
+     *   <tr><td>EPSG:6404</td> <td>Spherical 3D CS</td>   <td>latitude, longitude, radius</td>             <td>north, east, up</td> <td>degree, degree, metre</td></tr>
+     *   <tr><td>EPSG:6499</td> <td>Vertical CS</td>       <td>height (H)</td>                              <td>up</td>              <td>metre</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -796,11 +796,11 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Axes</th>                                    <th>Orientations</th>    <th>Unit</th></tr>
-     *   <tr><td>EPSG::6422</td> <td>latitude, longitude</td>                     <td>north, east</td>     <td>degree</td></tr>
-     *   <tr><td>EPSG::6424</td> <td>longitude, latitude</td>                     <td>east, north</td>     <td>degree</td></tr>
-     *   <tr><td>EPSG::6429</td> <td>longitude, latitude</td>                     <td>east, north</td>     <td>radian</td></tr>
-     *   <tr><td>EPSG::6423</td> <td>latitude, longitude, ellipsoidal height</td> <td>north, east, up</td> <td>degree, degree, metre</td></tr>
+     *   <tr><th>Code</th>      <th>Axes</th>                                    <th>Orientations</th>    <th>Unit</th></tr>
+     *   <tr><td>EPSG:6422</td> <td>latitude, longitude</td>                     <td>north, east</td>     <td>degree</td></tr>
+     *   <tr><td>EPSG:6424</td> <td>longitude, latitude</td>                     <td>east, north</td>     <td>degree</td></tr>
+     *   <tr><td>EPSG:6429</td> <td>longitude, latitude</td>                     <td>east, north</td>     <td>radian</td></tr>
+     *   <tr><td>EPSG:6423</td> <td>latitude, longitude, ellipsoidal height</td> <td>north, east, up</td> <td>degree, degree, metre</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -827,9 +827,9 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Axes</th>       <th>Orientations</th> <th>Unit</th></tr>
-     *   <tr><td>EPSG::6498</td> <td>depth (D)</td>  <td>down</td>         <td>metre</td></tr>
-     *   <tr><td>EPSG::6499</td> <td>height (H)</td> <td>up</td>           <td>metre</td></tr>
+     *   <tr><th>Code</th>      <th>Axes</th>       <th>Orientations</th> <th>Unit</th></tr>
+     *   <tr><td>EPSG:6498</td> <td>depth (D)</td>  <td>down</td>         <td>metre</td></tr>
+     *   <tr><td>EPSG:6499</td> <td>height (H)</td> <td>up</td>           <td>metre</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -876,11 +876,11 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Axes</th>                    <th>Orientations</th> <th>Unit</th></tr>
-     *   <tr><td>EPSG::4406</td> <td>easting, northing (E,N)</td> <td>east, north</td>  <td>kilometre</td></tr>
-     *   <tr><td>EPSG::4496</td> <td>easting, northing (E,N)</td> <td>east, north</td>  <td>metre</td></tr>
-     *   <tr><td>EPSG::4500</td> <td>northing, easting (N,E)</td> <td>north, east</td>  <td>metre</td></tr>
-     *   <tr><td>EPSG::4491</td> <td>westing, northing (W,N)</td> <td>west, north</td>  <td>metre</td></tr>
+     *   <tr><th>Code</th>      <th>Axes</th>                    <th>Orientations</th> <th>Unit</th></tr>
+     *   <tr><td>EPSG:4406</td> <td>easting, northing (E,N)</td> <td>east, north</td>  <td>kilometre</td></tr>
+     *   <tr><td>EPSG:4496</td> <td>easting, northing (E,N)</td> <td>east, north</td>  <td>metre</td></tr>
+     *   <tr><td>EPSG:4500</td> <td>northing, easting (N,E)</td> <td>north, east</td>  <td>metre</td></tr>
+     *   <tr><td>EPSG:4491</td> <td>westing, northing (W,N)</td> <td>west, north</td>  <td>metre</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -908,8 +908,8 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Axes</th>                        <th>Orientations</th>    <th>Unit</th></tr>
-     *   <tr><td>EPSG::6404</td> <td>latitude, longitude, radius</td> <td>north, east, up</td> <td>degree, degree, metre</td></tr>
+     *   <tr><th>Code</th>      <th>Axes</th>                        <th>Orientations</th>    <th>Unit</th></tr>
+     *   <tr><td>EPSG:6404</td> <td>latitude, longitude, radius</td> <td>north, east, up</td> <td>degree, degree, metre</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -974,11 +974,11 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th>   <th>Unit</th></tr>
-     *   <tr><td>EPSG::106</td>  <td>Latitude (φ)</td>  <td>degree</td></tr>
-     *   <tr><td>EPSG::107</td>  <td>Longitude (λ)</td> <td>degree</td></tr>
-     *   <tr><td>EPSG::1</td>    <td>Easting (E)</td>   <td>metre</td></tr>
-     *   <tr><td>EPSG::2</td>    <td>Northing (N)</td>  <td>metre</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th>   <th>Unit</th></tr>
+     *   <tr><td>EPSG:106</td>  <td>Latitude (φ)</td>  <td>degree</td></tr>
+     *   <tr><td>EPSG:107</td>  <td>Longitude (λ)</td> <td>degree</td></tr>
+     *   <tr><td>EPSG:1</td>    <td>Easting (E)</td>   <td>metre</td></tr>
+     *   <tr><td>EPSG:2</td>    <td>Northing (N)</td>  <td>metre</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -1007,12 +1007,12 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="Authority codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::9002</td> <td>decimal degree</td></tr>
-     *   <tr><td>EPSG::9001</td> <td>metre</td></tr>
-     *   <tr><td>EPSG::9030</td> <td>kilometre</td></tr>
-     *   <tr><td>EPSG::1040</td> <td>second</td></tr>
-     *   <tr><td>EPSG::1029</td> <td>year</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:9002</td> <td>decimal degree</td></tr>
+     *   <tr><td>EPSG:9001</td> <td>metre</td></tr>
+     *   <tr><td>EPSG:9030</td> <td>kilometre</td></tr>
+     *   <tr><td>EPSG:1040</td> <td>second</td></tr>
+     *   <tr><td>EPSG:1029</td> <td>year</td></tr>
      * </table>
      *
      * See {@link org.apache.sis.measure.Units#valueOfEPSG(int)} for a more complete list of codes.</div>
@@ -1041,12 +1041,12 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="EPSG codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::8801</td> <td>Latitude of natural origin</td></tr>
-     *   <tr><td>EPSG::8802</td> <td>Longitude of natural origin</td></tr>
-     *   <tr><td>EPSG::8805</td> <td>Scale factor at natural origin</td></tr>
-     *   <tr><td>EPSG::8806</td> <td>False easting</td></tr>
-     *   <tr><td>EPSG::8807</td> <td>False northing</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:8801</td> <td>Latitude of natural origin</td></tr>
+     *   <tr><td>EPSG:8802</td> <td>Longitude of natural origin</td></tr>
+     *   <tr><td>EPSG:8805</td> <td>Scale factor at natural origin</td></tr>
+     *   <tr><td>EPSG:8806</td> <td>False easting</td></tr>
+     *   <tr><td>EPSG:8807</td> <td>False northing</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -1104,11 +1104,11 @@ public abstract class GeodeticAuthorityF
      * A frequently used authority is "EPSG", which includes the following codes:
      *
      * <table class="sis" summary="EPSG codes examples">
-     *   <tr><th>Code</th>       <th>Description</th></tr>
-     *   <tr><td>EPSG::1133</td> <td>ED50 to WGS 84 (1)</td></tr>
-     *   <tr><td>EPSG::1241</td> <td>NAD27 to NAD83 (1)</td></tr>
-     *   <tr><td>EPSG::1173</td> <td>NAD27 to WGS 84 (4)</td></tr>
-     *   <tr><td>EPSG::6326</td> <td>NAD83(2011) to NAVD88 height (1)</td></tr>
+     *   <tr><th>Code</th>      <th>Description</th></tr>
+     *   <tr><td>EPSG:1133</td> <td>ED50 to WGS 84 (1)</td></tr>
+     *   <tr><td>EPSG:1241</td> <td>NAD27 to NAD83 (1)</td></tr>
+     *   <tr><td>EPSG:1173</td> <td>NAD27 to WGS 84 (4)</td></tr>
+     *   <tr><td>EPSG:6326</td> <td>NAD83(2011) to NAVD88 height (1)</td></tr>
      * </table></div>
      *
      * <div class="section">Default implementation</div>
@@ -1189,7 +1189,7 @@ public abstract class GeodeticAuthorityF
                     final int n = code.indexOf(DefaultNameSpace.DEFAULT_SEPARATOR, s + 1);
                     if (n >= 0) {
                         /*
-                         * The separator sometime appears twice, as in "EPSG::4326" or "EPSG:8.8:4326".
+                         * The separator sometime appears twice, as in "EPSG::4326" or "EPSG:8.9:4326".
                          * The part between the two separators is the verion number, which we ignore in
                          * this simple version.
                          */

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectSet.java?rev=1731686&r1=1731685&r2=1731686&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectSet.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectSet.java [UTF-8] Mon Feb 22 16:56:41 2016
@@ -64,7 +64,7 @@ import org.apache.sis.internal.jdk8.JDK8
  * {@code IdentifiedObjectSet} can be used as the set returned by implementations of the
  * {@link GeodeticAuthorityFactory#createFromCoordinateReferenceSystemCodes(String, String)} method.
  * Deferred creation can have great performance impact since some set may contain as much as 40 entries
- * (e.g. transformations from <cite>"ED50"</cite> (EPSG::4230) to <cite>"WGS 84"</cite> (EPSG::4326))
+ * (e.g. transformations from <cite>"ED50"</cite> (EPSG:4230) to <cite>"WGS 84"</cite> (EPSG:4326))
  * while some users only want to look for the first entry.
  *
  * <div class="section">Exception handling</div>

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/UnavailableFactoryException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/UnavailableFactoryException.java?rev=1731686&r1=1731685&r2=1731686&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/UnavailableFactoryException.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/UnavailableFactoryException.java [UTF-8] Mon Feb 22 16:56:41 2016
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.referencing.factory;
 
+import org.opengis.referencing.AuthorityFactory;
+
 
 /**
  * Thrown when a factory can not be created because a resource is missing.
@@ -27,7 +29,7 @@ package org.apache.sis.referencing.facto
  * By contrast, {@link MissingFactoryResourceException} means that at least one particular object
  * can not be created, but other objects may be okay.
  *
- * @author  Martin Desruisseaux (IRD)
+ * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.7
  * @version 0.7
  * @module
@@ -41,6 +43,11 @@ public class UnavailableFactoryException
     private static final long serialVersionUID = -661925454228937249L;
 
     /**
+     * The factory that can not perform its work, or {@code null} if unknown.
+     */
+    private AuthorityFactory factory;
+
+    /**
      * Construct an exception with no detail message.
      */
     public UnavailableFactoryException() {
@@ -69,4 +76,33 @@ public class UnavailableFactoryException
     public UnavailableFactoryException(String message, Throwable cause) {
         super(message, cause);
     }
+
+    /**
+     * Specifies which factory is unavailable. This information can be provided when the exception occurred
+     * at some later stage <em>after</em> the factory construction (never inside the factory constructor),
+     * for example the first time that the factory tried to create an object.
+     *
+     * <div class="note"><b>Example:</b>
+     * {@link org.apache.sis.referencing.factory.sql.EPSGFactory} may have been successfully created with
+     * a valid {@link javax.sql.DataSource}. But the call to {@link javax.sql.DataSource#getConnection()}
+     * happens only later (the first time that user invokes a method requiring a search in the database).
+     * In case of failure to connect to the database, user may discover late that the factory is actually
+     * unavailable. User may want to be informed about which factory is unavailable, for example in order
+     * to remove it from the list of factory managed by {@link MultiAuthoritiesFactory}.</div>
+     *
+     * @param factory The factory which is unavailable.
+     */
+    public void setUnavailableFactory(final AuthorityFactory factory) {
+        this.factory = factory;
+    }
+
+    /**
+     * Returns the factory which has been found unavailable, or {@code null} if unspecified.
+     * See {@link #setUnavailableFactory(AuthorityFactory)} for more details.
+     *
+     * @return The factory that should be considered as unavailable.
+     */
+    public AuthorityFactory getUnavailableFactory() {
+        return factory;
+    }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java?rev=1731686&r1=1731685&r2=1731686&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java [UTF-8] Mon Feb 22 16:56:41 2016
@@ -160,7 +160,9 @@ final class AuthorityCodes extends Abstr
         final int conditionStart = buffer.length();
         if (table.showColumn != null) {
             buffer.append(table.showColumn).append("<>0 AND ");
+            // Do not put spaces around "<>" - SQLTranslator searches for this exact match.
         }
+        // Do not put spaces around "=" - SQLTranslator searches for this exact match.
         buffer.append("DEPRECATED=0 ORDER BY ").append(table.codeColumn);
         sql[ALL] = factory.translator.apply(buffer.toString());
         /*

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java?rev=1731686&r1=1731685&r2=1731686&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] Mon Feb 22 16:56:41 2016
@@ -71,8 +71,10 @@ import org.apache.sis.internal.metadata.
 import org.apache.sis.internal.metadata.TransformationAccuracy;
 import org.apache.sis.internal.metadata.sql.SQLUtilities;
 import org.apache.sis.internal.referencing.DeprecatedCode;
+import org.apache.sis.internal.referencing.EPSGParameterDomain;
 import org.apache.sis.internal.referencing.Formulas;
 import org.apache.sis.internal.system.Loggers;
+import org.apache.sis.internal.system.Semaphores;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.CollectionsExt;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
@@ -107,6 +109,7 @@ import org.apache.sis.util.Localized;
 import org.apache.sis.util.Version;
 import org.apache.sis.util.collection.Containers;
 import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.measure.NumberRange;
 import org.apache.sis.measure.Units;
 
 import static org.apache.sis.internal.referencing.ServicesForMetadata.CONNECTION;
@@ -162,6 +165,38 @@ public class EPSGDataAccess extends Geod
         CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory, Localized
 {
     /**
+     * The deprecated ellipsoidal coordinate systems and their replacements. Those coordinate systems are deprecated
+     * because they use a unit of measurement which is no longer supported by OGC (for example degree-minute-second).
+     * Those replacements can be used only if the ellipsoidal CS is used for the base geographic CRS of a derived or
+     * projected CRS, because the units of measurement of the base CRS do not impact the units of measurements of the
+     * derived CRS.
+     *
+     * <p>We perform those replacements for avoiding a "Unit conversion from “DMS” to “°” is non-linear" exception
+     * at projected CRS creation time.</p>
+     *
+     * @see #replaceDeprecatedCS
+     */
+    private static final Map<Integer,Integer> DEPRECATED_CS = deprecatedCS();
+    static Map<Integer,Integer> deprecatedCS() {
+        final Map<Integer,Integer> m = new HashMap<Integer,Integer>(24);
+
+        // Ellipsoidal 2D CS. Axes: latitude, longitude. Orientations: north, east. UoM: degree
+        Integer replacement = 6422;
+        m.put(6402, replacement);
+        for (int code = 6405; code <= 6412; code++) {
+            m.put(code, replacement);
+        }
+
+        // Ellipsoidal 3D CS. Axes: latitude, longitude, ellipsoidal height. Orientations: north, east, up. UoM: degree, degree, metre.
+        replacement = 6423;
+        m.put(6401, replacement);
+        for (int code = 6413; code <= 6420; code++) {
+            m.put(code, replacement);
+        }
+        return m;
+    }
+
+    /**
      * The namespace of EPSG names and codes. This namespace is needed by all {@code createFoo(String)} methods.
      * The {@code EPSGDataAccess} constructor relies on the {@link EPSGFactory#nameFactory} caching mechanism
      * for giving us the same {@code NameSpace} instance than the one used by previous {@code EPSGDataAccess}
@@ -270,10 +305,20 @@ public class EPSGDataAccess extends Geod
      * {@code true} for disabling the logging of warnings when this factory creates deprecated objects.
      * This flag should be always {@code false}, except during {@link Finder#find(IdentifiedObject)}
      * execution since that method may temporarily creates deprecated objects which are later discarded.
+     * May also be {@code false} when creating base CRS of deprecated projected or derived CRS.
      */
     private transient boolean quiet;
 
     /**
+     * {@code true} if {@link #createCoordinateReferenceSystem(String)} is allowed to replace deprecated
+     * coordinate system at CRS creation time. This flag should be set to {@code true} only when creating
+     * the base CRS of a projected or derived CRS.
+     *
+     * @see #DEPRECATED_CS
+     */
+    private transient boolean replaceDeprecatedCS;
+
+    /**
      * The {@code ConcurrentAuthorityFactory} that created this Data Access Object (DAO).
      * The owner supplies caching for all {@code createFoo(String)} methods.
      */
@@ -359,7 +404,7 @@ public class EPSGDataAccess extends Geod
      *   │  └─ Function ……………………………………… Browse
      *   └─ Online resource (2 of 2)
      *      ├─ Linkage ………………………………………… jdbc:derby:/my/path/to/SIS_DATA/Databases/SpatialMetadata
-     *      ├─ Description ……………………………… EPSG dataset version 8.8 on “Apache Derby Embedded JDBC Driver” version 10.12.
+     *      ├─ Description ……………………………… EPSG dataset version 8.9 on “Apache Derby Embedded JDBC Driver” version 10.12.
      *      └─ Function ……………………………………… Connection
      * }
      */
@@ -401,7 +446,7 @@ public class EPSGDataAccess extends Geod
              *
              *    Linkage:      jdbc:derby:/my/path/to/SIS_DATA/Databases/SpatialMetadata
              *    Function:     Connection
-             *    Description:  EPSG dataset version 8.8 on “Apache Derby Embedded JDBC Driver” version 10.12.
+             *    Description:  EPSG dataset version 8.9 on “Apache Derby Embedded JDBC Driver” version 10.12.
              *
              * TODO: A future version should use Citations.EPSG as a template.
              *       See the "EPSG" case in ServiceForUtility.createCitation(String).
@@ -427,7 +472,7 @@ addURIs:    for (int i=0; ; i++) {
                 }
                 final DefaultOnlineResource r = new DefaultOnlineResource();
                 try {
-                    r.setLinkage(new URI(url));
+                    r.setLinkage(new URI(SQLUtilities.getSimplifiedURL(metadata)));
                 } catch (URISyntaxException exception) {
                     unexpectedException("getAuthority", exception);
                 }
@@ -658,7 +703,7 @@ addURIs:    for (int i=0; ; i++) {
                     statements.put(KEY, statement);
                     lastTableForName = table;
                 }
-                statement.setString(1, SQLUtilities.toLikePattern(code));
+                statement.setString(1, toLikePattern(code));
                 Integer resolved = null;
                 final ResultSet result = statement.executeQuery();
                 try {
@@ -790,8 +835,8 @@ addURIs:    for (int i=0; ; i++) {
      * @return The boolean at the specified column, or {@code null}.
      * @throws SQLException if an error occurred while querying the database.
      */
-    private static boolean getOptionalBoolean(final ResultSet result, final int columnIndex) throws SQLException {
-        return result.getInt(columnIndex) != 0;
+    private boolean getOptionalBoolean(final ResultSet result, final int columnIndex) throws SQLException {
+        return translator.useBoolean() ? result.getBoolean(columnIndex) : (result.getInt(columnIndex) != 0);
     }
 
     /**
@@ -941,6 +986,9 @@ addURIs:    for (int i=0; ; i++) {
      * The given {@code name} may be prefixed by {@code "epsg_"} and may contain abbreviations of the full name.
      * For example {@code "epsg_coordoperation"} is considered as a match for {@code "Coordinate_Operation"}.
      *
+     * <p>The table name should be one of the values enumerated in the {@code epsg_table_name} type of the
+     * {@code EPSG_Prepare.sql} file.</p>
+     *
      * @param  expected  The expected table name (e.g. {@code "Coordinate_Operation"}).
      * @param  name      The actual table name.
      * @return Whether the given {@code name} is considered to match the expected name.
@@ -956,16 +1004,14 @@ addURIs:    for (int i=0; ; i++) {
     }
 
     /**
-     * Logs a warning saying that the given code is deprecated and returns a message proposing a replacement.
+     * Logs a warning saying that the given code is deprecated and returns the code of the proposed replacement.
      *
      * @param  table  The table of the deprecated code.
      * @param  code   The deprecated code.
      * @param  locale The locale for logging messages.
-     * @return A message proposing a replacement, or {@code null} if none.
+     * @return The proposed replacement (may be the "(none)" text).
      */
-    private InternationalString getSupersession(final String table, final Integer code, final Locale locale)
-            throws SQLException
-    {
+    private String getSupersession(final String table, final Integer code, final Locale locale) throws SQLException {
         String reason = null;
         Object replacedBy = null;
         final ResultSet result = executeQuery("Deprecation",
@@ -1005,7 +1051,7 @@ addURIs:    for (int i=0; ; i++) {
             record.setLoggerName(Loggers.CRS_FACTORY);
             Logging.log(EPSGDataAccess.class, method, record);
         }
-        return Vocabulary.formatInternational(Vocabulary.Keys.SupersededBy_1, replacedBy);
+        return (String) replacedBy;
     }
 
     /**
@@ -1019,42 +1065,21 @@ addURIs:    for (int i=0; ; i++) {
      * @return The name together with a set of properties.
      */
     @SuppressWarnings("ReturnOfCollectionOrArrayField")
-    private Map<String,Object> createProperties(final String table, final String name, final Integer code,
+    private Map<String,Object> createProperties(final String table, String name, final Integer code,
             String remarks, final boolean deprecated) throws SQLException, FactoryDataException
     {
-        properties.clear();
-        GenericName gn = null;
-        final Locale locale = getLocale();
-        final Citation authority = owner.getAuthority();
-        final InternationalString edition = authority.getEdition();
-        final String version = (edition != null) ? edition.toString() : null;
-        if (name != null) {
-            gn = owner.nameFactory.createGenericName(namespace, Constants.EPSG, name);
-            properties.put("name", gn);
-            properties.put(NamedIdentifier.CODE_KEY,      name);
-            properties.put(NamedIdentifier.VERSION_KEY,   version);
-            properties.put(NamedIdentifier.AUTHORITY_KEY, authority);
-            properties.put(AbstractIdentifiedObject.LOCALE_KEY, locale);
-            final NamedIdentifier id = new NamedIdentifier(properties);
-            properties.clear();
-            properties.put(IdentifiedObject.NAME_KEY, id);
-        }
-        if (code != null) {
-            final String codeString = code.toString();
-            final ImmutableIdentifier identifier;
-            if (deprecated) {
-                identifier = new DeprecatedCode(authority, Constants.EPSG, codeString, version, getSupersession(table, code, locale));
-                properties.put(AbstractIdentifiedObject.DEPRECATED_KEY, Boolean.TRUE);
-            } else {
-                identifier = new ImmutableIdentifier(authority, Constants.EPSG, codeString, version,
-                                    (gn != null) ? gn.toInternationalString() : null);
-            }
-            properties.put(IdentifiedObject.IDENTIFIERS_KEY, identifier);
-        }
-        properties.put(IdentifiedObject.REMARKS_KEY, remarks);
         /*
          * Search for aliases. Note that searching for the object code is not sufficient. We also need to check if the
          * record is really from the table we are looking for since different tables may have objects with the same ID.
+         *
+         * Some aliases are identical to the name except that some letters are replaced by their accented letters.
+         * For example "Reseau Geodesique Francais" → "Réseau Géodésique Français". If we find such alias, replace
+         * the name by the alias so we have proper display in user interface. Notes:
+         *
+         *   - WKT formatting will still be compliant with ISO 19162 because the WKT formatter replaces accented
+         *     letters by ASCII ones.
+         *   - We do not perform this replacement directly in our EPSG database because ASCII letters are more
+         *     convenient for implementing accent-insensitive searches.
          */
         final List<GenericName> aliases = new ArrayList<GenericName>();
         final ResultSet result = executeQuery("Alias",
@@ -1076,15 +1101,55 @@ addURIs:    for (int i=0; ; i++) {
                             namingSystems.put(naming, ns);
                         }
                     }
-                    aliases.add(owner.nameFactory.createLocalName(ns, alias));
+                    if (CharSequences.toASCII(alias).toString().equals(name)) {
+                        name = alias;
+                    } else {
+                        aliases.add(owner.nameFactory.createLocalName(ns, alias));
+                    }
                 }
             }
         } finally {
             result.close();
         }
+        /*
+         * At this point we can fill the properties map.
+         */
+        properties.clear();
+        GenericName gn = null;
+        final Locale locale = getLocale();
+        final Citation authority = owner.getAuthority();
+        final InternationalString edition = authority.getEdition();
+        final String version = (edition != null) ? edition.toString() : null;
+        if (name != null) {
+            gn = owner.nameFactory.createGenericName(namespace, Constants.EPSG, name);
+            properties.put("name", gn);
+            properties.put(NamedIdentifier.CODE_KEY,      name);
+            properties.put(NamedIdentifier.VERSION_KEY,   version);
+            properties.put(NamedIdentifier.AUTHORITY_KEY, authority);
+            properties.put(AbstractIdentifiedObject.LOCALE_KEY, locale);
+            final NamedIdentifier id = new NamedIdentifier(properties);
+            properties.clear();
+            properties.put(IdentifiedObject.NAME_KEY, id);
+        }
         if (!aliases.isEmpty()) {
             properties.put(IdentifiedObject.ALIAS_KEY, aliases.toArray(new GenericName[aliases.size()]));
         }
+        if (code != null) {
+            final String codeString = code.toString();
+            final ImmutableIdentifier identifier;
+            if (deprecated) {
+                final String replacedBy = getSupersession(table, code, locale);
+                identifier = new DeprecatedCode(authority, Constants.EPSG, codeString, version,
+                        Character.isDigit(replacedBy.charAt(0)) ? replacedBy : null,
+                        Vocabulary.formatInternational(Vocabulary.Keys.SupersededBy_1, replacedBy));
+                properties.put(AbstractIdentifiedObject.DEPRECATED_KEY, Boolean.TRUE);
+            } else {
+                identifier = new ImmutableIdentifier(authority, Constants.EPSG, codeString, version,
+                                    (gn != null) ? gn.toInternationalString() : null);
+            }
+            properties.put(IdentifiedObject.IDENTIFIERS_KEY, identifier);
+        }
+        properties.put(IdentifiedObject.REMARKS_KEY, remarks);
         properties.put(AbstractIdentifiedObject.LOCALE_KEY, locale);
         properties.put(ReferencingServices.MT_FACTORY, owner.mtFactory);
         return properties;
@@ -1114,6 +1179,16 @@ addURIs:    for (int i=0; ; i++) {
     }
 
     /**
+     * Returns a string like the given string but with accented letters replaced by ASCII letters
+     * and all characters that are not letter or digit replaced by the wildcard % character.
+     *
+     * @see SQLUtilities#toLikePattern(String)
+     */
+    private static String toLikePattern(final String name) {
+        return SQLUtilities.toLikePattern(CharSequences.toASCII(name).toString());
+    }
+
+    /**
      * Returns an arbitrary object from a code. The default implementation delegates to more specific methods,
      * for example {@link #createCoordinateReferenceSystem(String)}, {@link #createDatum(String)}, <i>etc.</i>
      * until a successful one is found.
@@ -1165,7 +1240,7 @@ addURIs:    for (int i=0; ; i++) {
                     if (isPrimaryKey) {
                         stmt.setInt(1, pk);
                     } else {
-                        stmt.setString(1, SQLUtilities.toLikePattern(code));
+                        stmt.setString(1, toLikePattern(code));
                     }
                     Integer present = null;
                     final ResultSet result = stmt.executeQuery();
@@ -1272,6 +1347,9 @@ addURIs:    for (int i=0; ; i++) {
                 /*
                  * Note: Do not invoke 'createProperties' now, even if we have all required informations,
                  *       because the 'properties' map is going to overwritten by calls to 'createDatum', etc.
+                 *
+                 * The following switch statement should have a case for all "epsg_crs_kind" values enumerated
+                 * in the "EPSG_Prepare.sql" file, except that the values in this Java code are in lower cases.
                  */
                 final CRSFactory crsFactory = owner.crsFactory;
                 final CoordinateReferenceSystem crs;
@@ -1285,7 +1363,11 @@ addURIs:    for (int i=0; ; i++) {
                     if (type.equalsIgnoreCase("geographic 2d") ||
                         type.equalsIgnoreCase("geographic 3d"))
                     {
-                        final EllipsoidalCS cs = owner.createEllipsoidalCS(getString(code, result, 8));
+                        Integer csCode = getInteger(code, result, 8);
+                        if (replaceDeprecatedCS) {
+                            csCode = JDK8.getOrDefault(DEPRECATED_CS, csCode, csCode);
+                        }
+                        final EllipsoidalCS cs = owner.createEllipsoidalCS(csCode.toString());
                         final String datumCode = getOptionalString(result, 9);
                         final GeodeticDatum datum;
                         if (datumCode != null) {
@@ -1316,14 +1398,66 @@ addURIs:    for (int i=0; ; i++) {
                         result.close();      // Must be closed before call to createFoo(String)
                         ensureNoCycle(ProjectedCRS.class, epsg);
                         try {
-                            final CartesianCS   cs       = owner.createCartesianCS(csCode);
-                            final GeographicCRS baseCRS  = owner.createGeographicCRS(geoCode);
-                            final CoordinateOperation op = owner.createCoordinateOperation(opCode);
-                            if (op instanceof Conversion) {
-                                crs = crsFactory.createProjectedCRS(createProperties("Coordinate Reference System",
-                                        name, epsg, area, scope, remarks, deprecated), baseCRS, (Conversion) op, cs);
+                            final CartesianCS cs = owner.createCartesianCS(csCode);
+                            final Conversion op;
+                            try {
+                                op = (Conversion) owner.createCoordinateOperation(opCode);
+                            } catch (ClassCastException e) {
+                                // Should never happen in a well-formed EPSG database.
+                                // If happen anyway, the ClassCastException cause will give more hints than just the message.
+                                throw (NoSuchAuthorityCodeException) noSuchAuthorityCode(Projection.class, opCode).initCause(e);
+                            }
+                            final CoordinateReferenceSystem baseCRS;
+                            final boolean resumeParamChecks;
+                            if (!deprecated) {
+                                baseCRS = owner.createCoordinateReferenceSystem(geoCode);
+                                resumeParamChecks = false;
                             } else {
-                                throw noSuchAuthorityCode(Projection.class, opCode);
+                                /*
+                                 * If the ProjectedCRS is deprecated, one reason among others may be that it uses one of
+                                 * the deprecated coordinate systems. Those deprecated CS used non-linear units like DMS.
+                                 * Apache SIS can not instantiate a ProjectedCRS when the baseCRS uses such units, so we
+                                 * set a flag asking to replace the deprecated CS by a supported one. Since that baseCRS
+                                 * would not be exactly as defined by EPSG, we must not cache it because we do not want
+                                 * 'owner.createGeographicCRS(geoCode)' to return that modified CRS. Since the same CRS
+                                 * may be recreated every time a deprecated ProjectedCRS is created, we temporarily
+                                 * shutdown the loggings in order to avoid the same warning to be logged many time.
+                                 */
+                                try {
+                                    quiet = true;
+                                    replaceDeprecatedCS = true;
+                                    baseCRS = createCoordinateReferenceSystem(geoCode);         // Do not cache that CRS.
+                                } finally {
+                                    replaceDeprecatedCS = false;
+                                    quiet = false;
+                                }
+                                /*
+                                 * The crsFactory method calls will indirectly create a parameterized MathTransform.
+                                 * Their constructor will try to verify the parameter validity. But some deprecated
+                                 * CRS had invalid parameter values (they were deprecated precisely for that reason).
+                                 * If and only if we are creating a deprecated CRS, temporarily suspend the parameter
+                                 * checks.
+                                 */
+                                resumeParamChecks = !Semaphores.queryAndSet(Semaphores.SUSPEND_PARAMETER_CHECK);
+                                // Try block must be immediately after above line (do not insert any code between).
+                            }
+                            try {
+                                /*
+                                 * For a ProjectedCRS, the baseCRS is always geographic. So in theory we would not
+                                 * need the 'instanceof' check. However the EPSG dataset version 8.9 also uses the
+                                 * "projected" type for CRS that are actually derived CRS. See EPSG:5820 and 5821.
+                                 */
+                                final Map<String, Object> properties = createProperties("Coordinate Reference System",
+                                                                        name, epsg, area, scope, remarks, deprecated);
+                                if (baseCRS instanceof GeographicCRS) {
+                                    crs = crsFactory.createProjectedCRS(properties, (GeographicCRS) baseCRS, op, cs);
+                                } else {
+                                    crs = crsFactory.createDerivedCRS(properties, baseCRS, op, cs);
+                                }
+                            } finally {
+                                if (resumeParamChecks) {
+                                    Semaphores.clear(Semaphores.SUSPEND_PARAMETER_CHECK);
+                                }
                             }
                         } finally {
                             endOfRecursivity(ProjectedCRS.class, epsg);
@@ -1493,6 +1627,10 @@ addURIs:    for (int i=0; ; i++) {
                 } catch (NumberFormatException exception) {
                     unexpectedException("createDatum", exception);          // Not a fatal error.
                 }
+                /*
+                 * The following switch statement should have a case for all "epsg_datum_kind" values enumerated
+                 * in the "EPSG_Prepare.sql" file, except that the values in this Java code are in lower cases.
+                 */
                 final DatumFactory datumFactory = owner.datumFactory;
                 final Datum datum;
                 {   // On the JDK7 branch, this is a switch on strings.
@@ -1593,7 +1731,7 @@ addURIs:    for (int i=0; ; i++) {
                       " COORD_OP_METHOD_CODE," +
                       " TARGET_CRS_CODE" +
                 " FROM [Coordinate_Operation]" +
-               " WHERE DEPRECATED=0" +
+               " WHERE DEPRECATED=0" +           // Do not put spaces around "=" - SQLTranslator searches for this exact match.
                  " AND TARGET_CRS_CODE = "       + BursaWolfInfo.TARGET_CRS +
                  " AND COORD_OP_METHOD_CODE >= " + BursaWolfInfo.MIN_METHOD_CODE +
                  " AND COORD_OP_METHOD_CODE <= " + BursaWolfInfo.MAX_METHOD_CODE +
@@ -1888,7 +2026,7 @@ addURIs:    for (int i=0; ; i++) {
                 DefaultGeographicBoundingBox bbox = null;
                 if (!Double.isNaN(ymin) || !Double.isNaN(ymax) || !Double.isNaN(xmin) || !Double.isNaN(xmax)) {
                     /*
-                     * Fix an error found in EPSG::3790 New Zealand - South Island - Mount Pleasant mc
+                     * Fix an error found in EPSG:3790 New Zealand - South Island - Mount Pleasant mc
                      * for older database (this error is fixed in EPSG database 8.2).
                      *
                      * Do NOT apply anything similar for the x axis, because xmin > xmax is not error:
@@ -1976,6 +2114,10 @@ addURIs:    for (int i=0; ; i++) {
                 final boolean deprecated = getOptionalBoolean(result, 6);
                 final CoordinateSystemAxis[] axes = createCoordinateSystemAxes(epsg, dimension);
                 final Map<String,Object> properties = createProperties("Coordinate System", name, epsg, remarks, deprecated);   // Must be after axes.
+                /*
+                 * The following switch statement should have a case for all "epsg_cs_kind" values enumerated
+                 * in the "EPSG_Prepare.sql" file, except that the values in this Java code are in lower cases.
+                 */
                 final CSFactory csFactory = owner.csFactory;
                 CoordinateSystem cs = null;
                 {   // On the JDK7 branch, this is a switch on strings.
@@ -2231,7 +2373,7 @@ addURIs:    for (int i=0; ; i++) {
      * Current implementation first checks if {@link Units#valueOfEPSG(int)} can provide a hard-coded unit
      * for the given code before to try to parse the information found in the database. This is done that
      * way for better support of non-straightforward units like <cite>sexagesimal degrees</cite>
-     * (EPSG::9110 and 9111).
+     * (EPSG:9110 and 9111).
      *
      * <div class="note"><b>Example:</b>
      * some EPSG codes for units are:
@@ -2340,51 +2482,77 @@ addURIs:    for (int i=0; ; i++) {
         ResultSet result = null;
         try {
             result = executeQuery("Coordinate_Operation Parameter", "PARAMETER_CODE", "PARAMETER_NAME",
-                "SELECT PARAMETER_CODE," +
-                      " PARAMETER_NAME," +
-                      " DESCRIPTION," +
-                      " DEPRECATED" +
-                " FROM [Coordinate_Operation Parameter]" +
-                " WHERE PARAMETER_CODE = ?", code);
+                    "SELECT PARAMETER_CODE," +
+                          " PARAMETER_NAME," +
+                          " DESCRIPTION," +
+                          " DEPRECATED" +
+                    " FROM [Coordinate_Operation Parameter]" +
+                    " WHERE PARAMETER_CODE = ?", code);
 
             while (result.next()) {
                 final Integer epsg       = getInteger  (code, result, 1);
                 final String  name       = getString   (code, result, 2);
                 final String  remarks    = getOptionalString (result, 3);
                 final boolean deprecated = getOptionalBoolean(result, 4);
-                MeasurementRange<?> valueDomain = null;
-                final Class<?> type;
+                Class<?> type = Double.class;
                 /*
-                 * Search for units. We will choose the most commonly used one in parameter values.
                  * If the parameter appears to have at least one non-null value in the "Parameter File Name" column,
                  * then the type is assumed to be URI as a string. Otherwise, the type is a floating point number.
                  */
-                final ResultSet resultUnits = executeQuery("ParameterUnit",
-                        "SELECT MIN(UOM_CODE) AS UOM," +
-                              " MIN(PARAM_VALUE_FILE_REF) AS PARAM_FILE" +
-                            " FROM [Coordinate_Operation Parameter Value]" +
+                ResultSet r = executeQuery("ParameterType",
+                        "SELECT PARAM_VALUE_FILE_REF FROM [Coordinate_Operation Parameter Value]" +
+                        " WHERE (PARAMETER_CODE = ?) AND PARAM_VALUE_FILE_REF IS NOT NULL", epsg);
+                try {
+                    while (r.next()) {
+                        String element = getOptionalString(r, 1);
+                        if (element != null && !element.isEmpty()) {
+                            type = String.class;
+                            break;
+                        }
+                    }
+                } finally {
+                    r.close();
+                }
+                /*
+                 * Search for units.   We typically have many different units but all of the same dimension
+                 * (for example metres, kilometres, feet, etc.). In such case, the units Set will have only
+                 * one element and that element will be the most frequently used unit.  But some parameters
+                 * accept units of different dimensions.   For example the "Ordinate 1 of evaluation point"
+                 * (EPSG:8617) parameter value may be in metres or in degrees.   In such case the units Set
+                 * will have two elements.
+                 */
+                final Set<Unit<?>> units = new LinkedHashSet<Unit<?>>();
+                r = executeQuery("ParameterUnit",
+                        "SELECT UOM_CODE FROM [Coordinate_Operation Parameter Value]" +
                         " WHERE (PARAMETER_CODE = ?)" +
                         " GROUP BY UOM_CODE" +
                         " ORDER BY COUNT(UOM_CODE) DESC", epsg);
                 try {
-                    if (resultUnits.next()) {
-                        String element = getOptionalString(resultUnits, 2);
-                        type = (element != null) ? String.class : Double.class;
-                        element = getOptionalString(resultUnits, 1);
-                        if (element != null) {
-                            valueDomain = MeasurementRange.create(Double.NEGATIVE_INFINITY, false,
-                                    Double.POSITIVE_INFINITY, false,
-                                    owner.createUnit(element));
+next:               while (r.next()) {
+                        final String c = getOptionalString(r, 1);
+                        if (c != null) {
+                            final Unit<?> candidate = owner.createUnit(c);
+                            for (final Unit<?> e : units) {
+                                if (candidate.isCompatible(e)) {
+                                    continue next;
+                                }
+                            }
+                            units.add(candidate);
                         }
-                    } else {
-                        type = Double.class;
                     }
                 } finally {
-                    resultUnits.close();
+                    r.close();
                 }
                 /*
                  * Now creates the parameter descriptor.
                  */
+                final NumberRange<?> valueDomain;
+                switch (units.size()) {
+                    case 0:  valueDomain = null; break;
+                    default: valueDomain = new EPSGParameterDomain(units); break;
+                    case 1:  valueDomain = MeasurementRange.create(Double.NEGATIVE_INFINITY, false,
+                                    Double.POSITIVE_INFINITY, false, CollectionsExt.first(units)); break;
+                }
                 @SuppressWarnings({"unchecked", "rawtypes"})
                 final ParameterDescriptor<?> descriptor = new DefaultParameterDescriptor(
                         createProperties("Coordinate_Operation Parameter", name, epsg, remarks, deprecated),
@@ -2478,14 +2646,14 @@ addURIs:    for (int i=0; ; i++) {
                     param = parameters.parameter(name);
                 } catch (ParameterNotFoundException exception) {
                     /*
-                     * Wraps the unchecked ParameterNotFoundException into the checked NoSuchIdentifierException,
+                     * Wrap the unchecked ParameterNotFoundException into the checked NoSuchIdentifierException,
                      * which is a FactoryException subclass.  Note that in principle, NoSuchIdentifierException is for
                      * MathTransforms rather than parameters. However we are close in spirit here since we are setting
                      * up MathTransform's parameters. Using NoSuchIdentifierException allows CoordinateOperationSet to
-                     * know that the failure is probably caused by a MathTransform not yet supported in Apache SIS (or
-                     * only partially supported) rather than some more serious failure in the database side. Callers
-                     * can use this information in order to determine if they should try the next coordinate operation
-                     * or propagate the exception.
+                     * know that the failure is probably caused by a MathTransform not yet supported in Apache SIS
+                     * (or only partially supported) rather than some more serious failure in the database side.
+                     * Callers can use this information in order to determine if they should try the next coordinate
+                     * operation or propagate the exception.
                      */
                     final NoSuchIdentifierException e = new NoSuchIdentifierException(error()
                             .getString(Errors.Keys.CanNotSetParameterValue_1, name), name);
@@ -2880,7 +3048,7 @@ addURIs:    for (int i=0; ; i++) {
             } while ((searchTransformations = !searchTransformations) == true);
             /*
              * Search finished. We may have a lot of coordinate operations
-             * (e.g. about 40 for "ED50" (EPSG::4230) to "WGS 84" (EPSG::4326)).
+             * (e.g. about 40 for "ED50" (EPSG:4230) to "WGS 84" (EPSG:4326)).
              * Alter the ordering using the information supplied in the supersession table.
              */
             final String[] codes = set.getAuthorityCodes();
@@ -3018,7 +3186,7 @@ addURIs:    for (int i=0; ; i++) {
             }
             buffer.append(getSearchDomain() == Domain.ALL_DATASET
                           ? " ORDER BY ABS(DEPRECATED), "
-                          : " AND DEPRECATED=0 ORDER BY ");
+                          : " AND DEPRECATED=0 ORDER BY ");     // Do not put spaces around "=" - SQLTranslator searches for this exact match.
             if (isFloat) {
                 buffer.append("ABS(").append(select).append("-?), ");
             }
@@ -3136,7 +3304,8 @@ addURIs:    for (int i=0; ; i++) {
                       " FROM [Coordinate_Operation] AS CO" +
                 " INNER JOIN [Coordinate Reference System] AS SRC ON SRC.COORD_REF_SYS_CODE = CO.SOURCE_CRS_CODE" +
                 " INNER JOIN [Coordinate Reference System] AS TGT ON TGT.COORD_REF_SYS_CODE = CO.TARGET_CRS_CODE" +
-                      " WHERE CO.DEPRECATED = 0 AND COORD_OP_METHOD_CODE = ?";
+                      " WHERE CO.DEPRECATED=0 AND COORD_OP_METHOD_CODE = ?";
+                // Do not put spaces in "DEPRECATED=0" - SQLTranslator searches for this exact match.
             } else {
                 key = "DerivedDimensions";
                 sql = "SELECT DISTINCT SRC.COORD_SYS_CODE," +
@@ -3144,7 +3313,7 @@ addURIs:    for (int i=0; ; i++) {
                       " FROM [Coordinate Reference System] AS TGT" +
                 " INNER JOIN [Coordinate Reference System] AS SRC ON TGT.SOURCE_GEOGCRS_CODE = SRC.COORD_REF_SYS_CODE" +
                 " INNER JOIN [Coordinate_Operation] AS CO ON TGT.PROJECTION_CONV_CODE = CO.COORD_OP_CODE" +
-                      " WHERE CO.DEPRECATED = 0 AND COORD_OP_METHOD_CODE = ?";
+                      " WHERE CO.DEPRECATED=0 AND COORD_OP_METHOD_CODE = ?";
             }
             final ResultSet result = executeQuery(key, sql, method);
             try {

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java?rev=1731686&r1=1731685&r2=1731686&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] Mon Feb 22 16:56:41 2016
@@ -44,10 +44,6 @@ import org.apache.sis.referencing.factor
 import org.apache.sis.referencing.factory.UnavailableFactoryException;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Localized;
-import org.apache.sis.util.ObjectConverters;
-
-// Branch-dependent imports
-import org.apache.sis.internal.jdk7.Path;
 
 
 /**
@@ -152,10 +148,10 @@ public class EPSGFactory extends Concurr
     private final String schema;
 
     /**
-     * The path where to search for EPSG definition files if {@code EPSGFactory} needs to create the database,
-     * or {@code null} for searching in the {@linkplain Class#getResource(String) resources} instead.
+     * A provider of SQL scripts to use if {@code EPSGFactory} needs to create the database,
+     * or {@code null} for the default mechanism.
      */
-    private final Path scriptDirectory;
+    private final InstallationScriptProvider scriptProvider;
 
     /**
      * The translator from the SQL statements using MS-Access dialect to SQL statements using the dialect
@@ -219,9 +215,9 @@ public class EPSGFactory extends Concurr
      *   <td>{@link String}</td>
      *   <td>The database schema that contains the EPSG tables (see {@linkplain #install install}).</td>
      *  </tr><tr>
-     *   <td>{@code scriptDirectory}</td>
-     *   <td>{@link java.nio.file.Path}, {@link java.io.File} or {@link java.net.URL}</td>
-     *   <td>The directory that contains the EPSG definition files (see {@linkplain #install install}).</td>
+     *   <td>{@code scriptProvider}</td>
+     *   <td>{@link InstallationScriptProvider}</td>
+     *   <td>A provider of SQL scripts to use if {@code EPSGFactory} needs to create the database.</td>
      *  </tr><tr>
      *   <td>{@code locale}</td>
      *   <td>{@link Locale}</td>
@@ -250,11 +246,11 @@ public class EPSGFactory extends Concurr
         if (properties == null) {
             properties = Collections.emptyMap();
         }
-        DataSource ds   = (DataSource) properties.get("dataSource");
-        Locale locale   = ObjectConverters.convert(properties.get("locale"),  Locale.class);
-        schema          = ObjectConverters.convert(properties.get("schema"),  String.class);
-        catalog         = ObjectConverters.convert(properties.get("catalog"), String.class);
-        scriptDirectory = ObjectConverters.convert(properties.get("scriptDirectory"), Path.class);
+        DataSource ds  = (DataSource)                 properties.get("dataSource");
+        Locale locale  = (Locale)                     properties.get("locale");
+        schema         = (String)                     properties.get("schema");
+        catalog        = (String)                     properties.get("catalog");
+        scriptProvider = (InstallationScriptProvider) properties.get("scriptProvider");
         if (locale == null) {
             locale = Locale.getDefault();
         }
@@ -334,14 +330,13 @@ public class EPSGFactory extends Concurr
      *     schemas in table definitions} or in {@linkplain DatabaseMetaData#supportsSchemasInDataManipulation()
      *     data manipulation}, then this property is ignored.</li>
      *
-     *   <li><b>{@code scriptDirectory}:</b><br>
-     *     a {@link java.nio.file.Path}, {@link java.io.File} or {@link java.net.URL} to a directory containing
-     *     the SQL scripts to execute. If non-null, that directory shall contain at least files matching the
-     *     {@code *Tables*.sql}, {@code *Data*.sql} and {@code *FKeys*.sql} patterns (those files are provided by EPSG).
-     *     Files matching the {@code *Patches*.sql}, {@code *Indexes*.sql} and {@code *Grant*.sql} patterns
-     *     (provided by Apache SIS) are optional but recommended.
-     *     If no directory is specified, then this method will search for resources provided by the
-     *     {@code geotk-epsg.jar} bundle.</li>
+     *   <li><b>{@code scriptProvider}:</b><br>
+     *     an {@link InstallationScriptProvider} giving the SQL scripts to execute for creating the EPSG database.
+     *     If no provider is specified, then this method will search on the classpath (with {@link java.util.ServiceLoader})
+     *     for user-provided implementations of {@code InstallationScriptProvider}.
+     *     If no user-specified provider is found, then this method will search for
+     *     {@code "EPSG_Tables.sql"}, {@code "EPSG_Data.sql"} and {@code "EPSG_FKeys.sql"} files in the
+     *     {@code $SIS_DATA/Databases/ExternalSources} directory.</li>
      * </ul>
      *
      * <p><b>Legal constraint:</b>
@@ -370,7 +365,7 @@ public class EPSGFactory extends Concurr
                         installer.prependNamespace(catalog);
                     }
                 }
-                installer.run(scriptDirectory);
+                installer.run(scriptProvider);
                 success = true;
             } finally {
                 if (ac) {
@@ -410,6 +405,7 @@ public class EPSGFactory extends Concurr
      */
     @Override
     protected EPSGDataAccess newDataAccess() throws FactoryException {
+        UnavailableFactoryException exception;
         Connection connection = null;
         try {
             connection = dataSource.getConnection();
@@ -432,17 +428,20 @@ public class EPSGFactory extends Concurr
             }
             if (tr.isTableFound()) {
                 return newDataAccess(connection, tr);
+            } else {
+                connection.close();
+                exception = new UnavailableFactoryException(SQLTranslator.tableNotFound(locale));
             }
-            connection.close();
         } catch (Exception e) {                     // Really want to catch all exceptions here.
             if (connection != null) try {
                 connection.close();
             } catch (SQLException e2) {
                 // e.addSuppressed(e2) on the JDK7 branch.
             }
-            throw new UnavailableFactoryException(e.getLocalizedMessage(), e);
+            exception = new UnavailableFactoryException(e.getLocalizedMessage(), e);
         }
-        throw new UnavailableFactoryException(SQLTranslator.tableNotFound(locale));
+        exception.setUnavailableFactory(this);
+        throw exception;
     }
 
     /**



Mime
View raw message