Package org.opengis.referencing.crs

Examples of org.opengis.referencing.crs.CoordinateReferenceSystem


        Map map = getMap();
        if (map == null) {
            getSite().getPage().closeEditor(this, false);
            return;
        }
        CoordinateReferenceSystem crs = map.getViewportModel().getCRS();
        if (crs == null || crs.getName() == null) {
            return;
        }

        final String full = crs.getName().getCode();
        if (full == null || isSame(full))
            return;

        Display display = PlatformUI.getWorkbench().getDisplay();
        if (display == null)
View Full Code Here


    /**
     * <!-- begin-user-doc --> <!-- end-user-doc -->
     * @generated
     */
    public void setCRSGen(CoordinateReferenceSystem newCRS) {
        CoordinateReferenceSystem oldCRS = cRS;
        cRS = newCRS;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ProjectPackage.LAYER__CRS,
                    oldCRS, cRS));
    }
View Full Code Here

     * @param monitor
     * @return
     */
    private CoordinateReferenceSystem getCRSInternal(IProgressMonitor monitor) {
        try {
            CoordinateReferenceSystem crs = getGeoResource().getInfo(monitor).getCRS();
            if (crs != null)
                return crs;
        } catch (Exception e) {
            ProjectPlugin.log(null, e);
        }
View Full Code Here

    private String oldName;

    @Override
    protected Control createContents( Composite parent ) {
        final Layer layer = (Layer) getElement();
        final CoordinateReferenceSystem layerCRS = layer.getCRS();
        ReferencedEnvelope bounds = layer.getBounds(ProgressManager.instance().get(), layerCRS);
       
        final List<SummaryData> data=new ArrayList<SummaryData>();
        String name = layer.getName();
        nameData=new SummaryData(Messages.LayerSummary_name, name==null?"":name); //$NON-NLS-1$
View Full Code Here

  private static ReferencedEnvelope calculateBounds(double width,
      Dimension displaySize, ReferencedEnvelope originalExtent) {
    Coordinate center = originalExtent.centre();
    double height = width * displaySize.height / displaySize.width;
    CoordinateReferenceSystem crs = originalExtent
        .getCoordinateReferenceSystem();
    double minx = center.x - width / 2;
    double maxx = center.x + width / 2;
    double miny = center.y - height / 2;
    double maxy = center.y + height / 2;
View Full Code Here

   
    if( bounds.getWidth()==0 || bounds.getHeight()==0){
      return -1;
    }

    CoordinateReferenceSystem crs = bounds.getCoordinateReferenceSystem();

    int width = displaySize.width;
    int height = displaySize.height;
    boolean isLatLong = isLatLong(crs);
View Full Code Here

  @Ignore
  @Test
  public void testFixIssue() throws Exception {
    final Layer layer= map.getLayersInternal().get(0);
    layer.setCRS(DefaultGeographicCRS.WGS84);
    CoordinateReferenceSystem crs = CRS.decode("EPSG:3005");//$NON-NLS-1$
    map.getViewportModelInternal().setCRS(crs);
    FeatureIssue issue=new FeatureIssue(Priority.LOW, "Description",layer, features[0], "test" ); //$NON-NLS-1$ //$NON-NLS-2$
   
    if( issue.getViewPartId()!=null  ){
      IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
View Full Code Here

        createContext(map);
        context.getRenderManagerInternal().setMapDisplay(new TestMapDisplay(new Dimension( 1000, 200)));

        map.getViewportModelInternal().setBounds(0,100,0,90);
       
        CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
        Envelope result = BasicFeatureRenderer.validateBounds(new ReferencedEnvelope(0,50,0,10, crs), new NullProgressMonitor(), context);
       
        assertEquals( new Envelope( 0,50,0,10 ), result);

        result = BasicFeatureRenderer.validateBounds(new ReferencedEnvelope( 0,170,0,10, crs), new NullProgressMonitor(), context);
View Full Code Here

    @SuppressWarnings("deprecation")
    @Ignore
    @Test
    public void testBC_ALBERS_Viewport() throws Exception {
        CRSFactory fac = (CRSFactory) ReferencingFactoryFinder.getCRSFactories(null).iterator().next();
        CoordinateReferenceSystem crs = fac.createFromWKT(BC_ALBERS_WKT);
       
        GeometryFactory gfac = new GeometryFactory();
       
        double maxx = -120;
        double maxy = 59.9;
View Full Code Here

        map.getViewportModelInternal().setCRS(DefaultGeographicCRS.WGS84);
       
        createContext(map);
       
        map.getViewportModelInternal().setBounds(-150,-120,45,65);
        CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
       
        Envelope result = BasicFeatureRenderer.validateBounds(new ReferencedEnvelope( 0,20,0,20,crs ), new NullProgressMonitor(), context);
        assertTrue( result.isNull() );
    }
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.