Package org.opengis.referencing.crs

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem


                if (fs != null) {
                    bounds = (ReferencedEnvelope) fs.getBounds();
                }

                if (bounds == null) {
                    CoordinateReferenceSystem crs = fs.getSchema().getCoordinateReferenceSystem();

                    // try getting an envelope out of the crs
                    org.opengis.geometry.Envelope envelope = CRS.getEnvelope(crs);

                    if (envelope != null) {
View Full Code Here


        Point point = geom.getCentroid();
       
        IMap imap = ApplicationGIS.getActiveMap();
        if( imap == ApplicationGIS.NO_MAP ) return;
       
        CoordinateReferenceSystem world = imap.getViewportModel().getCRS();
        CoordinateReferenceSystem wsg84 = DefaultGeographicCRS.WGS84;
       
        double buffer = 0.01; // how much of the wgs84 world to see
        Envelope view = point.buffer( buffer ).getEnvelopeInternal();
       
        MathTransform transform;
View Full Code Here

        if (xpath.equals(DEFAULT)){
            xpath = geometryDescriptor.getName().getLocalPart();
        }
        Geometry geometry = (Geometry) value;
        if( geometry.getUserData() == null ){
            CoordinateReferenceSystem crs = geometryDescriptor.getCoordinateReferenceSystem();
            if( crs != null ){
                String srsName = CRS.toSRS(crs);
                geometry.setUserData(srsName);
            }
        }
View Full Code Here

                ReferencingFactoryFinder.scanForPlugins(); // hook everything up
                monitor.worked(10);
            }

            monitor.subTask(Messages.PLEASE_WAIT);
            CoordinateReferenceSystem wgs84 = CRS.decode("EPSG:4326"); //$NON-NLS-1$
            if (wgs84 == null) {
                String msg = "Unable to locate EPSG authority for EPSG:4326; consider removing temporary 'GeoTools' directory and trying again."; //$NON-NLS-1$
                System.out.println(msg);
                // throw new FactoryException(msg);
            }
View Full Code Here

            monitor = new NullProgressMonitor();

        monitor.beginTask(Messages.EPSG_SETUP, IProgressMonitor.UNKNOWN);
        try {
            monitor.subTask(Messages.PLEASE_WAIT);
            CoordinateReferenceSystem wgs84 = CRS.decode("EPSG:4326"); //$NON-NLS-1$
            if (wgs84 == null) {
                String msg = "Unable to locate EPSG authority for EPSG:4326; consider removing temporary 'GeoTools' directory and trying again."; //$NON-NLS-1$
                System.out.println(msg);
                // throw new FactoryException(msg);
            }
View Full Code Here

     *
     * @return true if referencing is working and we get the expected result
     * @throws Exception if we cannot even get that far
     */
    private static void verifyReferencingEpsg() throws Exception {
        CoordinateReferenceSystem WGS84 = CRS.decode("EPSG:4326"); // latlong //$NON-NLS-1$
        CoordinateReferenceSystem BC_ALBERS = CRS.decode("EPSG:3005"); //$NON-NLS-1$

        MathTransform transform = CRS.findMathTransform(BC_ALBERS, WGS84);
        DirectPosition here = new DirectPosition2D(BC_ALBERS, 1187128, 395268);
        DirectPosition there = new DirectPosition2D(WGS84, -123.47009173007372, 48.54326498732153);

View Full Code Here

    private static void verifyReferencingOperation() throws Exception {
        // ReferencedEnvelope[-0.24291497975705742 : 0.24291497975711265, -0.5056179775280899 :
        // -0.0]
        // ReferencedEnvelope[-0.24291497975705742 : 0.24291497975711265, -0.5056179775280899 :
        // -0.0]
        CoordinateReferenceSystem EPSG4326 = CRS.decode("EPSG:4326"); //$NON-NLS-1$
        ReferencedEnvelope pixelBounds = new ReferencedEnvelope(-0.24291497975705742,
                0.24291497975711265, -0.5056179775280899, 0.0, EPSG4326);
        CoordinateReferenceSystem WGS84 = DefaultGeographicCRS.WGS84;

        ReferencedEnvelope latLong = pixelBounds.transform(WGS84, false);
        if (latLong == null) {
            String msg = "Unable to transform EPSG:4326 to DefaultGeographicCRS.WGS84"; //$NON-NLS-1$
            System.out.println(msg);
View Full Code Here

    private SimpleFeature findFirstFeature( ILayer layer, ReferencedEnvelope bbox )
            throws Exception {

        FeatureSource<SimpleFeatureType, SimpleFeature> source = layer.getResource(FeatureSource.class, null);
        SimpleFeatureType type = source.getSchema();
        CoordinateReferenceSystem crs = layer.getCRS();

        if (!bbox.getCoordinateReferenceSystem().equals(crs)) {
            bbox = bbox.transform(crs, true);
        }
        FilterFactory2 factory = (FilterFactory2) CommonFactoryFinder.getFilterFactory(GeoTools
View Full Code Here

     * @throws MismatchedDimensionException
     */
  public static ReferencedEnvelope calcualteExtent( final IMap currentMap )
            throws MismatchedDimensionException {
        if (!currentMap.equals(ApplicationGIS.NO_MAP)) {
      CoordinateReferenceSystem worldCRS = currentMap.getViewportModel().getCRS();
      try {
                if( worldCRS.getIdentifiers() == null || worldCRS.getIdentifiers().isEmpty()){
                    // sanity check! look up the good definition in the EPSG database!!
                    String code = CRS.lookupIdentifier(worldCRS, true);
                    if( code != null ){
                        worldCRS = CRS.decode(code);
                    }
View Full Code Here

    // set map units.
    IMap map = handler.getContext().getMap();
    assert map != null;

    CoordinateReferenceSystem crs = MapUtil.getCRS(map);
    Unit<?> mapUnits = GeoToolsUtils.getDefaultCRSUnit(crs);

    parallelContext.setUnits(mapUnits);

    EditBlackboard bb = handler.getEditBlackboard(handler.getEditLayer());
View Full Code Here

TOP

Related Classes of org.opengis.referencing.crs.CoordinateReferenceSystem

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.