Martin, Are you doing any kind of geometry validation on the parser? It would be good to log geometry errors and all that too. Invalid polygons present a real problem and are hard to detect in some cases.
Adam > On Jun 16, 2015, at 5:12 AM, Martin Desruisseaux > <[email protected]> wrote: > > Hello all > > In the process of reading a Well Known Text (WKT), some non-fatal > warnings may happen (this email ignores fatal errors, which throw > exception without logging anything). Examples of warnings are: > > * A metadata depends on an optional module which is not on the > classpath (example: TimeExtent). > * An unknown keyword has been found. The WKT specification requires > that we ignore unknown keywords (in order to allow users to extend > the WKT with their own elements, for example triaxal ellipsoids > [1]), but suggests that we emit a warning. > * An inconsistency is found. The specification said "In the event of > conflict in values given in the CRS WKT string and given by an > authority through an object’s name or an identifier, reading > software should throw an exception or give users a warning message. > The WKT values should be assumed to prevail." [2] > > An example of warning message currently produced by the WKT parser is > (advises about rewording the warning are welcome): > > Parsing of “WGS 84” done, but some elements were ignored. > • The text contains unknown elements: > ‣ “MYEXT” in PRIMEM, GEOGCS. > > What should be the policy about non-fatal warnings in Apache SIS? The > current approach is: > > * When using the WKTFormat object (which give maximum control on WKT > parsing and formatting), no warnings are logged. But a getWarnings() > method is provided, which allow users to decide what they want to do > [3]. > * When using the CRS.fromWKT(String) static convenience method [4], > currently warnings are ignored. > > Should non-fatal warnings be logged when using a static convenience > method? If yes, should it be at Level.WARNING or at another lever? > > Martin > > > [1] http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#146 > [2] http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#139 > [3] > https://builds.apache.org/job/sis-dev/javadoc/org/apache/sis/io/wkt/Warnings.html > [4] > https://builds.apache.org/job/sis-dev/javadoc/org/apache/sis/referencing/CRS.html#fromWKT-java.lang.String- > >
