<br><font size=2 face="sans-serif">Tessella Ref: NPD/6091/PR/TN/2009JUN19/12:11:41<br>
<br>
Thanks Martin - I've tried your suggestions. &nbsp;Results as follows:</font>
<br>
<br><font size=2 face="sans-serif">Setting:</font>
<br>
<br><font size=2><tt>Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER,
Boolean.TRUE);</tt></font>
<br>
<br><font size=2 face="sans-serif">doesn't appear to have any effect on
produced results.</font>
<br>
<br><font size=2 face="sans-serif">Using:</font>
<br>
<br><font size=2><tt>String code = ((AbstractAuthorityFactory) <br>
CRS.getAuthorityFactory(true)).getIdentifiedObjectFinder(CoordinateReferenceSystem.class).findIdentifier(crs);</tt></font>
<br>
<br><font size=2 face="sans-serif">reliably produces the same result as
CRS.lookupIdentifier(crs, true); - I still can't get back any valid results
when specifying the Citations object.</font>
<br>
<br><font size=2 face="sans-serif">I've noticed for other CRS objects (e.g.
DefaultVerticalCRS.GEOIDAL_HEIGHT), as well as the test object, I also
get back null values - is this as you'd expect?</font>
<br>
<br><font size=2 face="sans-serif">NB, I've tried the various different
combinations of using the above with the different inputs to lookupIdentifier,
and get the same results as per my last email.</font>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br>
<br><font size=2 face="sans-serif">Calum.<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Martin Desruisseaux &lt;martin.desruisseaux@geomatys.fr&gt;</b>
</font>
<p><font size=1 face="sans-serif">19/06/2009 11:24</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">Calum.Byrom@tessella.com</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">Jon Blower &lt;j.d.blower@reading.ac.uk&gt;,
Geotoolkit@lists.osgeo.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [geotk] Finding a CRS code/URN from
a CoordinateReferenceSystem &nbsp; &nbsp; &nbsp; &nbsp; object</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Hello Calum<br>
<br>
Calum.Byrom@tessella.com a écrit :<br>
&gt; Thanks for the quick response. &nbsp;As requested, crs.toString()
gives:<br>
&gt; <br>
&gt; GEOGCS[&quot;ED50&quot;,<br>
&gt; &nbsp; DATUM[&quot;European Datum 1950&quot;,<br>
&gt; &nbsp; &nbsp; SPHEROID[&quot;International 1924&quot;, 6378388.0,
297.0]],<br>
&gt; &nbsp; PRIMEM[&quot;Greenwich&quot;, 0.0],<br>
&gt; &nbsp; UNIT[&quot;degree&quot;, 0.017453292519943295],<br>
&gt; &nbsp; AXIS[&quot;Longitude&quot;, EAST],<br>
&gt; &nbsp; AXIS[&quot;Latitude&quot;, NORTH]]<br>
&gt; <br>
&gt; (...snip...)<br>
&gt; <br>
&gt; the test data returns 'null' for CRS.lookupIdentifier(Citations.EPSG,
<br>
&gt; crs, true) - and for any combinations of the input parameters;<br>
<br>
In the EPSG database, the axis order for geographic CRS is (latitude, <br>
longitude). The CRS posted above has the opposite axis order (as we can
see from <br>
the AXIS[...] elements). Consequently by default the lookupIdentifier methods
<br>
consider that the given CRS doesn't match the definition in the EPSG database.<br>
<br>
It is possible to force the library to treat axis order as if it was (longitude,
<br>
latitude) despite what EPSG define. There is two way of doing that: you
can set <br>
the (longitude, latitude) axis order on a system-wide basis (convenient
if you <br>
are sure that all your data are that way, but not recommanded if you need
to <br>
deal with latest OGC standards like WMS 1.3.0 and above):<br>
<br>
 &nbsp; Hints.putSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER,
Boolean.TRUE);<br>
<br>
or you can force the (longitude, latitude) axis order on a case-by-case
basis:<br>
<br>
 &nbsp; String code = ((AbstractAuthorityFactory) <br>
CRS.getAuthorityFactory(true)).getIdentifiedObjectFinder(CoordinateReferenceSystem.class).findIdentifier(crs);<br>
<br>
<br>
&gt; the 'real' data returns 'CRS:84' (what I'm actually looking for!)
for <br>
&gt; CRS.lookupIdentifier(crs, true) but 'null' for any other combination
of <br>
&gt; inputs.<br>
<br>
CRS:84 is defined by the WMS specification as (longitude, latitude) - at
the <br>
opposite of what EPSG define - so this matches your CRS. Other combinaison
of <br>
parameters will consider that there is no match if the specified authority
is <br>
Citations.EPSG, unless axis order has been forced as described above.<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
Martin<br>
<br>
P.S.: I may be away of internet for the next week, since I'm traveling
to the <br>
OGC meeting. So I may be slow in answering the next emails.<br>
</tt></font>
<br><font size=2 face="sans-serif"><br>
<br>
<br>
<br>
<br>
<br>
</font>