Examples of toWKT()


Examples of org.geotools.referencing.crs.AbstractCRS.toWKT()

     * @throws FactoryException if an error occured while querying the factory.
     */
    @Test
    public void testIntern() throws FactoryException {
        final AbstractCRS epsgCrs = (AbstractCRS) CRS.decode("EPSG:4326");
        final String      wkt     = epsgCrs.toWKT();
        final AbstractCRS wktCrs  = (AbstractCRS) CRS.parseWKT(wkt);

        assertTrue   ("equals ignore metadata",  epsgCrs.equals(wktCrs, false));
        assertFalse  ("equals compare metadata", epsgCrs.equals(wktCrs, true));
        assertFalse  ("equals",   epsgCrs.equals(wktCrs));
View Full Code Here

Examples of org.geotools.referencing.crs.DefaultProjectedCRS.toWKT()

        GeographicCRS base = DefaultGeographicCRS.WGS84;
        MathTransform mt   = factory.createParameterizedTransform(parameters);
        CartesianCS cs = DefaultCartesianCS.PROJECTED;
        CoordinateReferenceSystem crs = new DefaultProjectedCRS("Lambert", base, mt, cs);

        final String wkt = crs.toWKT();
        assertTrue(wkt.contains("semi_major"));
        assertTrue(wkt.contains("semi_minor"));
        final Parser parser = new Parser();
        CoordinateReferenceSystem check = parser.parseCoordinateReferenceSystem(wkt);
        assertEquals(wkt, check.toWKT());
View Full Code Here

Examples of org.geotools.referencing.wkt.Formattable.toWKT()

    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

Examples of org.geotools.referencing.wkt.Formattable.toWKT()

   
    @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

Examples of org.geotools.referencing.wkt.Formattable.toWKT()

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

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem.toWKT()

            }
            if (crs != null) {
                memento.putString(CRS, encode(crs.toWKT()));
            }
            if (reproject != null) {
                memento.putString(REPOJECT, encode(reproject.toWKT()));
            }
            if (handle != null) {
                memento.putString(HANDLE, encode(handle));
            }
            if (maxFeature != Integer.MAX_VALUE) {
View Full Code Here

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem.toWKT()

            }
            if (crs != null) {
                memento.putString(CRS, encode(crs.toWKT()));
            }
            if (reproject != null) {
                memento.putString(REPOJECT, encode(reproject.toWKT()));
            }
            if (handle != null) {
                memento.putString(HANDLE, encode(handle));
            }
            if (maxFeature != Integer.MAX_VALUE) {
View Full Code Here

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem.toWKT()

                });

                CoordinateReferenceSystem readCrs = crsChooser.getCrs();
                if (readCrs != null) {
                    BufferedWriter bWriter = new BufferedWriter(new FileWriter(projFile));
                    String crsString = readCrs.toWKT();
                    bWriter.write(crsString);
                    bWriter.close();
                } else {
                    return false;
                }
View Full Code Here

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem.toWKT()

        st.setDouble(index + 2, box.getMaxX());
        st.setDouble(index + 3, box.getMaxY());

        if (box.getCoordinateReferenceSystem() != null) {
            CoordinateReferenceSystem crs = box.getCoordinateReferenceSystem();
            st.setBlob(index + 4, Hibernate.createBlob(crs.toWKT().getBytes()));
        } else {
            st.setBlob(index + 4, (Blob) null);
        }
    }
View Full Code Here

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem.toWKT()

        assertFalse(window.isShown());
       
        tester.clickLink("form:crs:wkt", true);
        assertTrue(window.isShown());
       
        tester.assertModelValue("form:crs:popup:content:wkt", crs.toWKT());
    }
   
    public void testPopupWindowNoCRS() throws Exception {
        // see GEOS-3207
        tester.startPage( new CRSPanelTestPage() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.