Package org.geotools.referencing.wkt

Examples of org.geotools.referencing.wkt.Formattable


     */
    String toSingleLineWKT(CoordinateReferenceSystem crs) {
        String wkt = null;
        try {
            // this is a lenient transformation, works with polar stereographics too
            Formattable formattable = (Formattable) crs;
            wkt = formattable.toWKT(0, false);
        } catch(ClassCastException e) {
            wkt = crs.toWKT();
        }
       
        wkt = wkt.replaceAll("\n", "").replaceAll("  ", "");
View Full Code Here


    }
   
    @Test
    public void testWKT() throws Exception {
        CoordinateReferenceSystem crs = CRS.decode("EPSG:" + CODE);
        Formattable formattable = (Formattable) crs;
        String wkt = formattable.toWKT(Citations.EPSG, 2);
       
        final String lineSep=System.getProperty("line.separator", "\n");
        String expected = "LOCAL_CS[\"Wildcard 2D cartesian plane in metric unit\", " +lineSep +
            "  LOCAL_DATUM[\"Unknown\", 0], " +lineSep +
            "  UNIT[\"m\", 1.0], " +lineSep +
View Full Code Here

}

public void toWKTFormat() throws Exception {
    // toWKTFormat start
    CoordinateReferenceSystem crs = CRS.decode("EPSG:32735");
    Formattable f = (Formattable) CRS.decode("EPSG:32735", true);
    String wkt = f.toWKT(Citations.ESRI, 2); // use 0 indent for single line
   
    System.out.println("wkt for EPSG:32735 (ESRI)");
    System.out.println( wkt );
    // toWKTFormat end
}
View Full Code Here

TOP

Related Classes of org.geotools.referencing.wkt.Formattable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.