Package org.opengis.referencing.crs

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem


        }

        @SuppressWarnings("unchecked")
        private void calculateBounds() {
            org.opengis.geometry.Envelope env = null;
            CoordinateReferenceSystem crs = null;

            Map<String, CRSEnvelope> boundingBoxes = layer.getBoundingBoxes();

            if (boundingBoxes.isEmpty()) {
                crs = DefaultGeographicCRS.WGS84;
View Full Code Here


    /* (non-Javadoc)
   * @see org.locationtech.udig.catalog.wmsc.server.TileSet#setBoundingBox(org.geotools.data.ows.CRSEnvelope)
   */
    public void setBoundingBox( CRSEnvelope bbox ) {
        CoordinateReferenceSystem crs = null;
        try {
            crs = CRS.decode(bbox.getEPSGCode());
        } catch (Exception ex) {
            System.out.println("Cannot decode tile epsg code: " + bbox.getEPSGCode()); //$NON-NLS-1$
        }
View Full Code Here

      // display the map
      IMap map = toolContext.getMap();
      mapLabel.setText("Map: " + map.getName()); //$NON-NLS-1$
      // display the CRS.
      CoordinateReferenceSystem crs = getCurrentMapCrs(map);
      crsLabel.setText("CRS: " + crs.getName().toString()); //$NON-NLS-1$
    }

  }
View Full Code Here

   * @return the current map's CRS or null if current map is null
   */
  private CoordinateReferenceSystem getCurrentMapCrs(IMap map) {
   
        IViewportModel viewportModel = map.getViewportModel();
        CoordinateReferenceSystem mapCrs = viewportModel.getCRS();
    return mapCrs;
  }
View Full Code Here

    private void addViewportModelListener() {
        viewportListener = new IViewportModelListener(){
            public void changed( ViewportModelEvent event ) {
                if (event.getType() == EventType.CRS){
                    //need to update the overview map crs
                    CoordinateReferenceSystem newcrs = (CoordinateReferenceSystem)event.getNewValue();
                    mapviewer.getMap().getViewportModelInternal().setCRS(newcrs);
                }else if (event.getType() == EventType.BOUNDS){
                    //bounds have changed change the overview box correspondingly
                    if (!mainmap.getViewportModel().isBoundsChanging()) {
                        ReferencedEnvelope bnds = findNewOverviewZoom(mainmap.getViewportModel().getBounds(), mainmap.getRenderManager().getMapDisplay(), mapviewer.getMap().getViewportModel().getBounds());
View Full Code Here

        if( isAoiFilter() ){
            try {
                IAOIService aoiService = PlatformGIS.getAOIService();
                ReferencedEnvelope extent = aoiService.getExtent();
                if( extent != null ){
                    CoordinateReferenceSystem crs = extent.getCoordinateReferenceSystem();
                    Geometry geometry = aoiService.getGeometry();
                    CoordinateReferenceSystem dataCRS = schema.getCoordinateReferenceSystem();
                    if (!CRS.equalsIgnoreMetadata(crs,dataCRS)) {
                        MathTransform transform = CRS.findMathTransform(crs, dataCRS);
                        geometry = JTS.transform(geometry, transform);
                    }
                    String the_geom = schema.getGeometryDescriptor().getName().getLocalPart();
View Full Code Here

        double scale = getScaleDenominator();
        if (newCRS == null)
            throw new IllegalArgumentException("A CRS cannot be null"); //$NON-NLS-1$
        if (newCRS.equals(cRS))
            return;
        CoordinateReferenceSystem oldCRS = getCRS();
        if (getBounds().isNull() || !validState()) {
            setCRSGen(newCRS);

        } else {
            Coordinate center = getCenter();
View Full Code Here

    /**
     * @generated
     */
    public void setCRSGen(CoordinateReferenceSystem newCRS) {
        CoordinateReferenceSystem oldCRS = cRS;
        cRS = newCRS;
        boolean oldCRSESet = cRSESet;
        cRSESet = true;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
View Full Code Here

     * <!-- begin-user-doc --> <!-- end-user-doc -->
     *
     * @generated NOT
     */
    public void unsetCRS() {
        CoordinateReferenceSystem oldCRS = cRS;
        boolean oldCRSESet = cRSESet;
        cRS = getDefaultCRS();
        cRSESet = false;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.UNSET,
View Full Code Here

                try {
                    FeatureSource<SimpleFeatureType, SimpleFeature> source = parent.getDS()
                            .getFeatureSource(typename);

                    bounds = source.getBounds();
                    CoordinateReferenceSystem crs = getCRS();

                    if (bounds == null) {

                        // try getting an envelope out of the crs
                        org.opengis.geometry.Envelope envelope = CRS.getEnvelope(crs);
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.