Class CRSReader

    • Constructor Detail

      • CRSReader

        public CRSReader​(String text)
        Constructor
        Parameters:
        text - well-known text
      • CRSReader

        public CRSReader​(TextReader reader)
        Constructor
        Parameters:
        reader - text reader
      • CRSReader

        public CRSReader​(String text,
                         boolean strict)
        Constructor
        Parameters:
        text - well-known text
        strict - strict rule enforcement
      • CRSReader

        public CRSReader​(TextReader reader,
                         boolean strict)
        Constructor
        Parameters:
        reader - text reader
        strict - strict rule enforcement
    • Method Detail

      • read

        public static CRS read​(String text)
                        throws IOException
        Read a Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • read

        public static CRS read​(String text,
                               boolean strict)
                        throws IOException
        Read a Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        strict - strict enforcement
        Returns:
        Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • read

        public static CRS read​(String text,
                               CRSType... expected)
                        throws IOException
        Read a Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        expected - expected types
        Returns:
        Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • read

        public static CRS read​(String text,
                               boolean strict,
                               CRSType... expected)
                        throws IOException
        Read a Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        strict - strict enforcement
        expected - expected types
        Returns:
        Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readCoordinateReferenceSystem

        public static CoordinateReferenceSystem readCoordinateReferenceSystem​(String text)
                                                                       throws IOException
        Read a Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readCoordinateReferenceSystem

        public static CoordinateReferenceSystem readCoordinateReferenceSystem​(String text,
                                                                              boolean strict)
                                                                       throws IOException
        Read a Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        strict - strict enforcement
        Returns:
        Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readSimpleCoordinateReferenceSystem

        public static SimpleCoordinateReferenceSystem readSimpleCoordinateReferenceSystem​(String text)
                                                                                   throws IOException
        Read a Simple Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Simple Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readSimpleCoordinateReferenceSystem

        public static SimpleCoordinateReferenceSystem readSimpleCoordinateReferenceSystem​(String text,
                                                                                          boolean strict)
                                                                                   throws IOException
        Read a Simple Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        strict - strict enforcement
        Returns:
        Simple Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readGeo

        public static GeoCoordinateReferenceSystem readGeo​(String text)
                                                    throws IOException
        Read a Geodetic or Geographic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Geodetic or Geographic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readGeodetic

        public static GeoCoordinateReferenceSystem readGeodetic​(String text)
                                                         throws IOException
        Read a Geodetic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Geodetic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readGeographic

        public static GeoCoordinateReferenceSystem readGeographic​(String text)
                                                           throws IOException
        Read a Geographic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Geographic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readProjected

        public static ProjectedCoordinateReferenceSystem readProjected​(String text)
                                                                throws IOException
        Read a Projected Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Projected Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readProjectedGeodetic

        public static ProjectedCoordinateReferenceSystem readProjectedGeodetic​(String text)
                                                                        throws IOException
        Read a Projected Geodetic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Projected Geodetic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readProjectedGeographic

        public static ProjectedCoordinateReferenceSystem readProjectedGeographic​(String text)
                                                                          throws IOException
        Read a Projected Geographic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Projected Geographic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readVertical

        public static VerticalCoordinateReferenceSystem readVertical​(String text)
                                                              throws IOException
        Read a Vertical Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Vertical Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readEngineering

        public static EngineeringCoordinateReferenceSystem readEngineering​(String text)
                                                                    throws IOException
        Read an Engineering Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Engineering Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readParametric

        public static ParametricCoordinateReferenceSystem readParametric​(String text)
                                                                  throws IOException
        Read an Parametric Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Parametric Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readTemporal

        public static TemporalCoordinateReferenceSystem readTemporal​(String text)
                                                              throws IOException
        Read an Temporal Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Temporal Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readDerived

        public static DerivedCoordinateReferenceSystem readDerived​(String text)
                                                            throws IOException
        Read a Derived Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Derived Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readCompound

        public static CompoundCoordinateReferenceSystem readCompound​(String text)
                                                              throws IOException
        Read a Compound Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Compound Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readCoordinateMetadata

        public static CoordinateMetadata readCoordinateMetadata​(String text)
                                                         throws IOException
        Read Coordinate Metadata from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Coordinate Metadata
        Throws:
        IOException - upon failure to read
      • readCoordinateOperation

        public static CoordinateOperation readCoordinateOperation​(String text)
                                                           throws IOException
        Read Coordinate Operation from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Coordinate Operation
        Throws:
        IOException - upon failure to read
      • readPointMotionOperation

        public static PointMotionOperation readPointMotionOperation​(String text)
                                                             throws IOException
        Read Point Motion Operation from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Point Motion Operation
        Throws:
        IOException - upon failure to read
      • readConcatenatedOperation

        public static ConcatenatedOperation readConcatenatedOperation​(String text)
                                                               throws IOException
        Read Concatenated Operation from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Concatenated Operation
        Throws:
        IOException - upon failure to read
      • readGeoCompat

        public static GeoCoordinateReferenceSystem readGeoCompat​(String text)
                                                          throws IOException
        Read a Backward Compatible Geodetic or Geographic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Geodetic or Geographic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readGeodeticCompat

        public static GeoCoordinateReferenceSystem readGeodeticCompat​(String text)
                                                               throws IOException
        Read a Backward Compatible Geodetic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Geodetic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readGeographicCompat

        public static GeoCoordinateReferenceSystem readGeographicCompat​(String text)
                                                                 throws IOException
        Read a Backward Compatible Geographic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Geographic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readProjectedCompat

        public static ProjectedCoordinateReferenceSystem readProjectedCompat​(String text)
                                                                      throws IOException
        Read a Backward Compatible Projected Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Projected Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readProjectedGeodeticCompat

        public static ProjectedCoordinateReferenceSystem readProjectedGeodeticCompat​(String text)
                                                                              throws IOException
        Read a Backward Compatible Projected Geodetic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Projected Geodetic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readProjectedGeographicCompat

        public static ProjectedCoordinateReferenceSystem readProjectedGeographicCompat​(String text)
                                                                                throws IOException
        Read a Backward Compatible Projected Geographic Coordinate Reference System from the well-known text
        Parameters:
        text - well-known text
        Returns:
        Projected Geographic Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • getTextReader

        public TextReader getTextReader()
        Get the text reader
        Returns:
        text reader
      • isStrict

        public boolean isStrict()
        Is strict rule enforcement enabled
        Returns:
        true if strict
      • setStrict

        public void setStrict​(boolean strict)
        Set the strict rule enforcement setting
        Parameters:
        strict - true for strict enforcement
      • read

        public CRS read()
                 throws IOException
        Read a CRS object from the well-known text
        Returns:
        CRS
        Throws:
        IOException - upon failure to read
      • readCoordinateReferenceSystem

        public CoordinateReferenceSystem readCoordinateReferenceSystem()
                                                                throws IOException
        Read a Coordinate Reference System from the well-known text
        Returns:
        Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readSimpleCoordinateReferenceSystem

        public SimpleCoordinateReferenceSystem readSimpleCoordinateReferenceSystem()
                                                                            throws IOException
        Read a Simple Coordinate Reference System from the well-known text
        Returns:
        Simple Coordinate Reference System
        Throws:
        IOException - upon failure to read
      • readKeyword

        public CRSKeyword readKeyword​(CRSKeyword... keywords)
                               throws IOException
        Read a specific WKT CRS keyword, next token when strict, until found when not
        Parameters:
        keywords - read until one of the keywords
        Returns:
        keyword read
        Throws:
        IOException - upon failure to read
      • readToKeyword

        public CRSKeyword readToKeyword​(CRSKeyword... keywords)
                                 throws IOException
        Read skipping tokens up until before an optional WKT CRS keyword
        Parameters:
        keywords - read until one of the keywords
        Returns:
        next keyword or null
        Throws:
        IOException - upon failure to read
      • readKeyword

        public CRSKeyword readKeyword​(boolean required,
                                      CRSKeyword... keywords)
                               throws IOException
        Read looking for a specific WKT CRS keyword, skipping others if not strict mode
        Parameters:
        required - true if keyword is required, read only until an external right delimiter
        keywords - read until one of the keywords
        Returns:
        keyword read
        Throws:
        IOException - upon failure to read
      • peekOptionalKeyword

        public CRSKeyword peekOptionalKeyword()
                                       throws IOException
        Peek an optional WKT CRS keyword
        Returns:
        keyword
        Throws:
        IOException - upon failure to read
      • peekOptionalKeywords

        public Set<CRSKeyword> peekOptionalKeywords()
                                             throws IOException
        Peek an optional WKT CRS keywords
        Returns:
        keywords
        Throws:
        IOException - upon failure to read
      • peekOptionalKeyword

        public CRSKeyword peekOptionalKeyword​(int num)
                                       throws IOException
        Peek an optional WKT CRS keyword
        Parameters:
        num - number of tokens out to peek at
        Returns:
        keyword
        Throws:
        IOException - upon failure to read
      • peekOptionalKeywords

        public Set<CRSKeyword> peekOptionalKeywords​(int num)
                                             throws IOException
        Peek an optional WKT CRS keywords
        Parameters:
        num - number of tokens out to peek at
        Returns:
        keywords
        Throws:
        IOException - upon failure to read
      • readLeftDelimiter

        public void readLeftDelimiter()
                               throws IOException
        Read a left delimiter
        Throws:
        IOException - upon failure to read
      • peekLeftDelimiter

        public boolean peekLeftDelimiter()
                                  throws IOException
        Peek if the next token is a left delimiter
        Returns:
        true if next token is a left delimiter
        Throws:
        IOException - upon failure to read
      • readRightDelimiter

        public void readRightDelimiter()
                                throws IOException
        Read skipping tokens until an external right delimiter (first right delimiter without a preceding left)
        Throws:
        IOException - upon failure to read
      • peekRightDelimiter

        public boolean peekRightDelimiter()
                                   throws IOException
        Peek if the next token is a right delimiter
        Returns:
        true if next token is a right delimiter
        Throws:
        IOException - upon failure to read
      • readSeparator

        public void readSeparator()
                           throws IOException
        Read a WKT Separator (comma)
        Throws:
        IOException - upon failure to read
      • peekSeparator

        public boolean peekSeparator()
                              throws IOException
        Peek if the next token is a WKT Separator (comma)
        Returns:
        true if next token is a separator
        Throws:
        IOException - upon failure to read
      • readEnd

        public void readEnd()
                     throws IOException
        "Read" an expected end, checking for unexpected trailing tokens
        Throws:
        IOException - upon failure to read
      • readKeywordDelimitedToken

        public String readKeywordDelimitedToken​(CRSKeyword keyword)
                                         throws IOException
        Read a keyword delimited token
        Parameters:
        keyword - expected keyword
        Returns:
        token
        Throws:
        IOException - upon failure to read
      • readScopeExtentIdentifierRemark

        public void readScopeExtentIdentifierRemark​(ScopeExtentIdentifierRemark object)
                                             throws IOException
        Read the usages (scope and extent), identifiers, and remark into the object
        Parameters:
        object - scope extent identifier remark object
        Throws:
        IOException - upon failure to read
      • readReferenceFrame

        public ReferenceFrame readReferenceFrame()
                                          throws IOException
        Read a Reference frame (datum)
        Returns:
        reference frame
        Throws:
        IOException - upon failure to read
      • readDynamic

        public Dynamic readDynamic()
                            throws IOException
        Read a Dynamic coordinate reference system
        Returns:
        dynamic
        Throws:
        IOException - upon failure to read
      • readAngleUnit

        public Unit readAngleUnit()
                           throws IOException
        Read an Angle Unit
        Returns:
        angle unit
        Throws:
        IOException - upon failure to read
      • readLengthUnit

        public Unit readLengthUnit()
                            throws IOException
        Read a Length Unit
        Returns:
        length unit
        Throws:
        IOException - upon failure to read
      • readParametricUnit

        public Unit readParametricUnit()
                                throws IOException
        Read a Parametric Unit
        Returns:
        parametric unit
        Throws:
        IOException - upon failure to read
      • readScaleUnit

        public Unit readScaleUnit()
                           throws IOException
        Read a Scale Unit
        Returns:
        scale unit
        Throws:
        IOException - upon failure to read
      • readTimeUnit

        public Unit readTimeUnit()
                          throws IOException
        Read a Time Unit
        Returns:
        time unit
        Throws:
        IOException - upon failure to read
      • readUnit

        public Unit readUnit​(UnitType type)
                      throws IOException
        Read a Unit
        Parameters:
        type - expected unit type
        Returns:
        unit
        Throws:
        IOException - upon failure to read
      • readAreaDescription

        public String readAreaDescription()
                                   throws IOException
        Read an Area description
        Returns:
        area description
        Throws:
        IOException - upon failure to read
      • readParameter

        public OperationParameter readParameter​(CRSType type)
                                         throws IOException
        Read an Operation parameter
        Parameters:
        type - coordinate reference system type
        Returns:
        operation parameter
        Throws:
        IOException - upon failure to read
      • readParametersAndFiles

        public List<OperationParameter> readParametersAndFiles​(CRSType type)
                                                        throws IOException
        Read Operation parameters and parameter files
        Parameters:
        type - coordinate reference system type
        Returns:
        operation parameters
        Throws:
        IOException - upon failure to read
      • readCoordinateOperationParameters

        public List<OperationParameter> readCoordinateOperationParameters()
                                                                   throws IOException
        Read Coordinate Operation parameters
        Returns:
        parameters
        Throws:
        IOException - upon failure to read
      • readVersion

        public String readVersion()
                           throws IOException
        Read an operation version
        Returns:
        operation version
        Throws:
        IOException - upon failure to read
      • readAccuracy

        public double readAccuracy()
                            throws IOException
        Read an operation accuracy
        Returns:
        operation accuracy
        Throws:
        IOException - upon failure to read
      • readAccuracyText

        public String readAccuracyText()
                                throws IOException
        Read an operation accuracy
        Returns:
        operation accuracy
        Throws:
        IOException - upon failure to read
        Since:
        1.1.0
      • readPointMotionOperationParameters

        public List<OperationParameter> readPointMotionOperationParameters()
                                                                    throws IOException
        Read Point Motion Operation parameters
        Returns:
        parameters
        Throws:
        IOException - upon failure to read
      • readGeoCompat

        public GeoCoordinateReferenceSystem readGeoCompat​(CRSType expectedType)
                                                   throws IOException
        Read a Backward Compatible Geodetic or Geographic CRS
        Parameters:
        expectedType - expected coordinate reference system type
        Returns:
        geodetic or geographic coordinate reference system
        Throws:
        IOException - upon failure to read
      • readProjectedCompat

        public ProjectedCoordinateReferenceSystem readProjectedCompat​(CRSType expectedBaseType)
                                                               throws IOException
        Read a Backward Compatible Projected CRS
        Parameters:
        expectedBaseType - expected base coordinate reference system type
        Returns:
        projected coordinate reference system
        Throws:
        IOException - upon failure to read
      • addTransformParameters

        public static void addTransformParameters​(String[] transform,
                                                  MapProjection mapProjection)
        Add transform parameters to the map projection
        Parameters:
        transform - transform array
        mapProjection - map projection
      • readMapProjectionCompat

        public MapProjection readMapProjectionCompat()
                                              throws IOException
        Read a Backward Compatible map projection
        Returns:
        map projection
        Throws:
        IOException - upon failure to read
      • readCoordinateSystemCompat

        public CoordinateSystem readCoordinateSystemCompat​(CRSType type,
                                                           ReferenceFrame datum)
                                                    throws IOException
        Read a Backward Compatible Coordinate System
        Parameters:
        type - coordinate reference system type
        datum - reference frame
        Returns:
        coordinate system
        Throws:
        IOException - upon failure to read
      • readVerticalDatumCompat

        public VerticalReferenceFrame readVerticalDatumCompat()
                                                       throws IOException
        Read a Backward Compatible vertical datum
        Returns:
        vertical reference frame
        Throws:
        IOException - upon failure to read
      • readEngineeringDatumCompat

        public EngineeringDatum readEngineeringDatumCompat()
                                                    throws IOException
        Read a Backward Compatible engineering datum
        Returns:
        engineering datum
        Throws:
        IOException - upon failure to read
      • readToWGS84Compat

        public String[] readToWGS84Compat()
                                   throws IOException
        Read a Backward Compatible To WGS84 transformation
        Returns:
        abridged transformation
        Throws:
        IOException - upon failure to read
      • readExtensionsCompat

        public Map<String,​Object> readExtensionsCompat()
                                                      throws IOException
        Read Backward Compatible Extensions
        Returns:
        extensions
        Throws:
        IOException - upon failure to read