WKT parser should emmit a warning when a unit is incompatible with an axis
--------------------------------------------------------------------------
Key: GEOT-1495
URL: http://jira.codehaus.org/browse/GEOT-1495
Project: GeoTools
Issue Type: Improvement
Components: core referencing
Affects Versions: 2.4-RC0
Reporter: Martin Desruisseaux
Assignee: Martin Desruisseaux
Priority: Minor
Consider the following WKT, which contains an error:
{code:none}
PROJCS["Lambert Azimuthal Equal Area",
GEOGCS["NAD83",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 1980", 6378137.0, 298.257222]],
PRIMEM["Greenwich", 0.0],
UNIT["m", 1.0]],
PROJECTION["Lambert_Azimuthal_Equal_Area"],
PARAMETER["latitude_of_center", 45.0],
UNIT["m", 1.0]]
{code}
The error lies in the first {{UNIT}} element, which should be an angular unit
like {{UNIT["degree", 0.017453292519943295]}} rather than a linear unit.
However current WKT parser ignores the unit name ({{"m"}} vs {{"degree"}}) and
looks only at the numerical value, which is expected to be a scale factor
relative to _radians_ for geographic CRS axis, or a scale factor relative to
_metres_ for projected CRS axis.
Consequently, the first {{UNIT}} element in the above example has been
interpreted like {{UNIT["radians", 1]}} because of the 1 numerical value. This
leads to unexpected behavior for the user. The WKT parser should probably
throws an exception when such inconsistent unit is found, or at the very least
logs a warning.
This task will be easier to fix when we will switch from JSR-108 to JSR-275
units library.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel