Interface Parser

All Known Implementing Classes:
AbstractParser, DefaultMathTransformFactory, DefaultMathTransformFactory.NoCache, GeodeticObjectFactory, GeodeticObjectParser, MathTransformParser, WKTFormat.Parser

public interface Parser
A parser or a factory capable to create an object from a string in the WKT format. The created objects may be Coordinate Reference Systems, Math Transforms or geometric objects for instance.

Parsing services may be provided by factories which implement this interface:

Similar services are also available as convenience static methods: Non-fatal anomalies found in Well Known Texts are reported in a logger named "org.apache.sis.io.wkt". Warnings may be for unknown or unsupported WKT elements, inconsistent unit definitions (unit symbol, scale factor or EPSG code), unparsable axis abbreviations, etc. However, this parser does not verify if the overall parsed object matches the EPSG (or other authority) definition. For such verification, see CRS.fromWKT(String).
Since:
0.6
Version:
0.6
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates the object from a string.
  • Method Details

    • createFromWKT

      Object createFromWKT(String text) throws org.opengis.util.FactoryException
      Creates the object from a string. Objects returned by this method are typically (but not necessarily) Coordinate Reference Systems or Math Transforms. If the given text contains non-fatal anomalies, warnings may be reported in a logger named "org.apache.sis.io.wkt".
      Tip: for processing warnings in a different way than logging them, one can use CompoundFormat.parseObject(String) followed by a call to WKTFormat.getWarnings().
      Parameters:
      text - object encoded in Well-Known Text format (version 1 or 2).
      Returns:
      the result of parsing the given text.
      Throws:
      org.opengis.util.FactoryException - if the object creation failed.