Package org.opengis.referencing.crs

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


}

public void toWKT() throws Exception {
    // toWKT start
    CoordinateReferenceSystem crs = CRS.decode("EPSG:32735");
    String wkt = crs.toWKT();
    System.out.println("wkt for EPSG:32735");
    System.out.println( wkt );
    // toWKT end
}
View Full Code Here


        //have doubts about following line, was the commented out 2nd clause to condition doing anything - colin      
        if (bcrs.equals(wgs84crs)) {    // || bcrs.equals(CRSUtils.WGS84_PROJ)) {
        return dp;
      }
        //again, what does the follllowing achieve? - colin
      if (bcrs.toWKT().indexOf("WGS84") > -1) {
        return dp;
      }
      if (bcrs instanceof GeographicCRS) {
        if (((GeographicCRS) bcrs).getDatum().equals(wgs84crs.getDatum())) {
          return dp;
View Full Code Here

     */
    private void showCRS() {
        if (mapPane != null && mapPane.getMapContent() != null) {
            CoordinateReferenceSystem crs = mapPane.getMapContent().getCoordinateReferenceSystem();
            JTextReporter.showDialog("Coordinate reference system",
                    crs.toWKT(),
                    JTextReporter.FLAG_MODAL);
        }
    }
}
View Full Code Here

            st.setNull(index, Types.VARCHAR);
        }
        else {
            CoordinateReferenceSystem crs = (CoordinateReferenceSystem) value;
            try {
                st.setString(index, storeAsWKT ? crs.toWKT() : "EPSG:"+CRS.lookupEpsgCode(crs, true));
            }
            catch(Exception e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

            }
            catch (FactoryException e) {
                XStreamPersister.LOGGER.warning( "Could not determine epsg code of crs, encoding as WKT");
            }
           
            return crs.toWKT();
        }
       
        @Override
        public Object fromString(String str) {
            if ( str.toUpperCase().startsWith( "EPSG:") ) {
View Full Code Here

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

        if (box.getCoordinateReferenceSystem() != null) {
            CoordinateReferenceSystem crs = box.getCoordinateReferenceSystem();
            if (storeCRSAsWKT) {
                st.setString(index+4, crs.toWKT());
            }
            else {
                try {
                    st.setString(index+4, "EPSG:"+ CRS.lookupEpsgCode(crs, true));
                }
View Full Code Here

            .key("maxx").value(bbox.getMaxX())
            .key("maxy").value(bbox.getMaxY());

        CoordinateReferenceSystem crs = bbox.getCoordinateReferenceSystem();
        if (crs != null) {
            json.key("crs").value(crs.toWKT());
        }

        json.endObject();
    }
View Full Code Here

            Integer epsgCode = EPSG_LOOKUP_CACHE.lookupEPSGCode(crs);
            if (epsgCode != null) {
                epsgCrs = CRS.decode("EPSG:" + epsgCode);
            }
            if (epsgCrs != null) {
                String epsgWKT = epsgCrs.toWKT();
                FileUtils.writeStringToFile(getPrjFile(), epsgWKT);
            }
        }
        catch (FactoryException e) {
            throw (IOException) new IOException().initCause(e);
View Full Code Here

                cropEnvelope = CRS.transform(cropEnvelope, sourceCRS);
            }
        } catch (TransformException e) {
            throw new WCS20Exception("Unable to initialize subsetting envelope",
                    WCS20Exception.WCS20ExceptionCode.SubsettingCrsNotSupported,
                    subsettingCRS.toWKT(), e);
        }

        GridCoverage2D cropped = WCSUtils.crop(coverage, cropEnvelope);
        cropped = GridCoverageWrapper.wrapCoverage(cropped, coverage, null, null, false);
        return cropped;
View Full Code Here

            st.setNull(index, Types.VARCHAR);
        }
        else {
            CoordinateReferenceSystem crs = (CoordinateReferenceSystem) value;
            try {
                st.setString(index, storeAsWKT ? crs.toWKT() : "EPSG:"+CRS.lookupEpsgCode(crs, true));
            }
            catch(Exception e) {
                throw new RuntimeException(e);
            }
        }
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.