Hello Michael

Le 24/01/2020 à 17:40, Michael Arneson a écrit :

Is there a way to get the CoordinateOperation from a CoordinateReferenceSystem created from a wtk?

    /CoordinateReferenceSystem fromCrs = CRS.fromWKT(wkt);/

    /.../

    /CoordinateOperation operationFromWKT = .../

Do we mean to get a CoordinateOperation directly from a WKT (not from a CoordinateReferenceSystem), with a WKT like the example below?

   http://docs.opengeospatial.org/is/18-010r7/18-010r7.html#143

If yes, then it can be done with the following class:

   http://sis.apache.org/apidocs/org/apache/sis/io/wkt/WKTFormat.html

Example:

   WKTFormat wf = new WKTFormat(null, null);
   Object obj = wf.parseObject(theWKT);
   Warnings warnings = wf.getWarnings();        // Optional but may be worth to 
do.
   if (warnings != null) {
        System.out.println(warnings);       // More advanced analysis could be 
done here.
   }

The obj result will be an instance of CoordinateOperation if the WKT was like the example in above-link, or a CoordinateReferenceSystem, or a Datum or any other WKT objects recognized by SIS.

Is what you were looking for, or was it something different?

    Martin


Reply via email to