On Thu, Aug 23, 2012 at 8:10 PM, <[email protected]> wrote:
> Hi all,****
>
> a class which formerly worked well for me now throws an exception when
> moving my project to geotools-api 9 snapshot:****
>
> ** **
>
> org.opengis.referencing.crs.CoordinateReferenceSystem cors =
> org.geotools.referencing.CRS.decode(“EPSG:25832”);****
>
> ** **
>
> throws the exception:****
>
> org.opengis.referencing.NoSuchAuthorityCodeException: No authority was
> defined for code "25832". Did you forget "AUTHORITY:NUMBER"?****
>
> ** **
>
> Is it a bug? I found some bugtracking to geotiff reader when prompting the
> message to the search engine.****
>
> If yes, does anyone know a proper workaround?
>
Just tried out against 9.x, the following:
import org.geotools.referencing.CRS;
public class Decode {
public static void main(String[] args) throws Exception {
System.out.println(CRS.decode("EPSG:25832"));
}
}
prints out:
PROJCS["ETRS89 / UTM zone 32N",
GEOGCS["ETRS89",
DATUM["European Terrestrial Reference System 1989",
SPHEROID["GRS 1980", 6378137.0, 298.257222101,
AUTHORITY["EPSG","7019"]],
TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
AUTHORITY["EPSG","6258"]],
PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
UNIT["degree", 0.017453292519943295],
AXIS["Geodetic latitude", NORTH],
AXIS["Geodetic longitude", EAST],
AUTHORITY["EPSG","4258"]],
PROJECTION["Transverse_Mercator", AUTHORITY["EPSG","9807"]],
PARAMETER["central_meridian", 9.0],
PARAMETER["latitude_of_origin", 0.0],
PARAMETER["scale_factor", 0.9996],
PARAMETER["false_easting", 500000.0],
PARAMETER["false_northing", 0.0],
UNIT["m", 1.0],
AXIS["Easting", EAST],
AXIS["Northing", NORTH],
AUTHORITY["EPSG","25832"]]
Normally that error happens if:
* you don't have a EPSG database in your classpath (either epsg-hsql or
epsg-wtk, I've tried
with the former)
* you have two or more of them, eventually with different version numbers
(happens a lot
to people not using maven to manage dependencies)
Cheers
Andrea
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users