Begining with the first exception on the list...

Andrea Aime a écrit :
> Issues converting EPSG:66616413
> org.geotools.referencing.wkt.UnformattableObjectException: Invalid WKT
> format.
>     at org.geotools.referencing.wkt.Formattable.toWKT(Formattable.java:184)

There is two ways to format WKT in Geotools:

   crs.toWKT()
   crs.toString()

Both are the same, except that 'toWKT()' check if the CRS is not too complex for
the WKT syntax and thrown an exception if it is, while 'toString()' silently
drop the problematic elements or use non-standard formatting.

In the particular case of EPSG:66616413, there is what I get using trunk on
revision 24607 (just commited some work a few minutes ago that are needed for
this output. Note: do not put the "-colors" argument if you are not on a ANSI
X3.64 compatible terminal. If you are - Linux terminal should be okay -, try
this "-colors" argument. More details on it below):

-----------------------------------------------------------------------------
java org.geotools.referencing.CRS -colors EPSG:66616413
GEOGCS["LKS92 (3D deg)",
  DATUM["Latvia 1992",
    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","6661"]],
  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
  UNIT["degree", 0.017453292519943295],
  AXIS["Geodetic latitude", NORTH],
  AXIS["Geodetic longitude", EAST],
  AXIS["Ellipsoidal height", UP],
  AUTHORITY["EPSG","66616413"]]

Warning: This "GeographicCRS" object is too complex for WKT syntax.
-----------------------------------------------------------------------------

This is a 3D CRS, and there is no way I'm aware of to specify the unit of the
vertical axis, since the only "UNIT" element is already used for the lat,long 
axis.

It would be possible for the WKT formatter to write 3D-Geographic CRS as
COMPD_CS[GEOGCS..., VERT_CS]. I wonder if you have any example of 3D-Geographic
CRS formatted as WKT, so we can see what the common practice is?

Geoserver could use 'crs.toString()' instead of 'crs.toWKT()' if it wants to get
ride of those exceptions, but I'm not sure I would recommand that if it is
important to get valid WKT. I'm not sure that Geotools itself could parse the
above 3D CRS.

        Martin

P.S.: the "java org.geotools.referencing.CRS" command mentionned above is the
proposed replacement for "java
org.geotools.referencing.factory.epsg.DefaultFactory". It should work for any
factories instead of "EPSG" only. The "-colors" argument try to highlight the
elements relevant to "CRS.equalsIgnoreCase", plus Bursa-Wolf parameters. If the
WKT is invalid, it also tries to highlight the "too complex" element.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to