Package org.geotools.referencing.wkt

Examples of org.geotools.referencing.wkt.Formatter


            indentation = Preferences.userNodeForPackage(org.geotools.referencing.wkt.Formattable.class)
                    .getInt("Indentation", indentation);
        } catch (SecurityException ignore) {
            // Ignore. Will fallback on the default indentation.
        }
        final Formatter formatter = new Formatter(Symbols.DEFAULT, indentation);
        formatter.append(this);
        return formatter.toString();
    }
View Full Code Here


    /**
     * Test WKT formatting of transforms backed by matrix.
     */
    @Test
    public void testMatrix() {
        final Formatter  formatter = new Formatter();
        final GeneralMatrix matrix = new GeneralMatrix(4);
        matrix.setElement(0,24);
        matrix.setElement(1,0, -2);
        matrix.setElement(2,37);
        MathTransform transform = ProjectiveTransform.create(matrix);
        assertFalse(transform instanceof AffineTransform);
        formatter.append(transform);
        assertEquals("PARAM_MT[\"Affine\", "          +
                     "PARAMETER[\"num_row\", 4], "    +
                     "PARAMETER[\"num_col\", 4], "    +
                     "PARAMETER[\"elt_0_2\", 4.0], "  +
                     "PARAMETER[\"elt_1_0\", -2.0], " +
                     "PARAMETER[\"elt_2_3\", 7.0]]", formatter.toString());
        matrix.setSize(3,3);
        transform = ProjectiveTransform.create(matrix);
        assertTrue(transform instanceof AffineTransform);
        formatter.clear();
        formatter.append(transform);
        assertEquals("PARAM_MT[\"Affine\", "          +
                     "PARAMETER[\"num_row\", 3], "    +
                     "PARAMETER[\"num_col\", 3], "    +
                     "PARAMETER[\"elt_0_2\", 4.0], "  +
                     "PARAMETER[\"elt_1_0\", -2.0]]", formatter.toString());
    }
View Full Code Here

TOP

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

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.