Examples of ReferenceIdentifier


Examples of org.opengis.referencing.ReferenceIdentifier

        //
        // //
        if (params != null) {
            for (GeneralParameterValue gParam : params) {
                final ParameterValue<?> param = (ParameterValue<?>) gParam;
                final ReferenceIdentifier name = param.getDescriptor().getName();
                extractParameter(param, name);
            }
        }
        setDefaultParameters();
        setBaseParameters(reader);
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        IdentifiedObject find = finder.find(crs);

        assertNotNull("With full scan allowed, the CRS should be found.", find);

        assertTrue("Should found an object equals (ignoring metadata) to the requested one.",CRS.equalsIgnoreMetadata(crs, find));
        ReferenceIdentifier found = AbstractIdentifiedObject.getIdentifier(find, factory.getAuthority());
    //assertEquals("4326",found.getCode());
    assertNotNull( found );

        finder.setFullScanAllowed(false);
        String id = finder.findIdentifier(crs);
        // this is broken because, as we know from above, it is ambiguous, so it may not be EPSG:4326 in the cache at all!
        // assertEquals("The CRS should still in the cache.","EPSG:4326", id);
        assertEquals("The CRS should still in the cache.",
                found.getCodeSpace()+':'+found.getCode(), id);
    }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        IdentifiedObject find = finder.find(crs);
       
        assertNotNull("With full scan allowed, the CRS should be found.", find);
       
        assertTrue("Should found an object equals (ignoring metadata) to the requested one.",CRS.equalsIgnoreMetadata(crs, find));
        ReferenceIdentifier found = AbstractIdentifiedObject.getIdentifier(find, factory.getAuthority());
    //assertEquals("4326",found.getCode());
        assertNotNull( found );
        finder.setFullScanAllowed(false);
        String id = finder.findIdentifier(crs);
        assertEquals("The CRS should still be in the cache.","EPSG:4326", id);
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        IdentifiedObject find = finder.find(crs);

        assertNotNull("With full scan allowed, the CRS should be found.", find);

        assertTrue("Should found an object equals (ignoring metadata) to the requested one.",CRS.equalsIgnoreMetadata(crs, find));
        ReferenceIdentifier found = AbstractIdentifiedObject.getIdentifier(find, factory.getAuthority());
    //assertEquals("4326",found.getCode());
        assertNotNull( found );
        finder.setFullScanAllowed(false);
        String id = finder.findIdentifier(crs);
        // this is broken because, as we know from above, it is ambiguous, so it may not be EPSG:4326 in the cache at all!
        // assertEquals("The CRS should still in the cache.","EPSG:4326", id);
        assertEquals("The CRS should still in the cache.",
                found.getCodeSpace()+':'+found.getCode(), id);
   }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

                   CRS.equalsIgnoreMetadata(crs, find));
        assertEquals("4326",
                AbstractIdentifiedObject.getIdentifier(find, factory.getAuthority()).getCode());
        finder.setFullScanAllowed(false);

        ReferenceIdentifier foundri = AbstractIdentifiedObject.getIdentifier(find, factory.getAuthority());

        // this is broken because, as we know from above, it is ambiguous, so it may not be EPSG:4326 in the cache at all!
        //        assertEquals("The CRS should still in the cache.",
        //                            "EPSG:4326", finder.findIdentifier(crs));
        assertEquals("The CRS should still in the cache.",
                foundri.getCodeSpace()+':'+foundri.getCode(), finder.findIdentifier(crs));

        /*
         * The PROJCS below intentionally uses a name different from the one found in the
         * EPSG database, in order to force a full scan (otherwise the EPSG database would
         * find it by name, but we want to test the scan).
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        // //
        if (params != null) {
            for (GeneralParameterValue gParam : params) {
                if (gParam instanceof ParameterValue<?>) {
                    final ParameterValue<?> param = (ParameterValue<?>) gParam;
                    final ReferenceIdentifier name = param.getDescriptor().getName();
                    extractParameter(param, name);
                }
            }
        }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

                continue;
            }

            // get name and default value
            final ParameterDescriptor desc = (ParameterDescriptor) descriptor;
            final ReferenceIdentifier name = desc.getName();
            final Object value = desc.getDefaultValue();

            // //
            //
            // Requested GridGeometry2D parameter
            //
            // //
            if (descriptor.getName().equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName())) {
                if (value == null)
                    continue;
                final GridGeometry2D gg = (GridGeometry2D) value;

                requestedBBox = new ReferencedEnvelope((Envelope) gg.getEnvelope2D());
                requestedRasterArea = gg.getGridRange2D().getBounds();
                requestedGridToWorld = (AffineTransform) gg.getGridToCRS2D();
                continue;
            }

            // //
            //
            // Use JAI ImageRead parameter
            //
            // //
            if (name.equals(AbstractGridFormat.USE_JAI_IMAGEREAD.getName())) {
                if (value == null)
                    continue;
                readType = ((Boolean) value) ? ReadType.JAI_IMAGEREAD : ReadType.DIRECT_READ;
                continue;
            }

            // //
            //
            // Overview Policy parameter
            //
            // //
            if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName())) {
                if (value == null)
                    continue;
                overviewPolicy = (OverviewPolicy) value;
                continue;
            }

            if (name.equals(AbstractGridFormat.INPUT_TRANSPARENT_COLOR.getName())) {
                if (value == null)
                    continue;
                inputTransparentColor = (Color) value;
                // paranoiac check on the provided transparent color
                inputTransparentColor = new Color(inputTransparentColor.getRed(),
                        inputTransparentColor.getGreen(), inputTransparentColor.getBlue());
                continue;

            }

            // if (name.equals(
            // GeoTiffFormat.OUTPUT_TRANSPARENT_COLOR.getName())) {
            // if(value==null)
            // continue;
            // outputTransparentColor = (Color) value;
            // // paranoiac check on the provided transparent color
            // outputTransparentColor = new Color(
            // outputTransparentColor.getRed(),
            // outputTransparentColor.getGreen(),
            // outputTransparentColor.getBlue());
            // continue;
            //
            // }
            //
            if (name.equals(GeoTiffFormat.BACKGROUND_VALUES.getName())) {
                if (value == null)
                    continue;
                backgroundValues = (double[]) value;
                continue;

            }
            //
            // if (name.equals(ImageMosaicFormat.MAX_ALLOWED_TILES.getName())) {
            // if(value==null)
            // continue;
            // maximumNumberOfGranules=(Integer)value;
            // continue;
            // }
            //
            //
//            if (name.equals(GeoTiffFormat.ALLOW_MULTITHREADING.getName())) {
//                if (value == null) {
//                    continue;
//                }
//                multithreadingAllowed = ((Boolean) value).booleanValue();
//                continue;
//            }

            // //
            //
            // Suggested tile size parameter. It must be specified with
            // the syntax: "TileWidth,TileHeight" (without quotes where TileWidth
            // and TileHeight are integer values)
            //
            // //
            if (name.equals(AbstractGridFormat.SUGGESTED_TILE_SIZE.getName())) {
                final String suggestedTileSize = (String) value;

                // Preliminary checks on parameter value
                if ((suggestedTileSize != null) && (suggestedTileSize.trim().length() > 0)) {
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

      // Checking params
      //
      if (params != null) {
        for (int i = 0; i < params.length; i++) {
          final ParameterValue param = (ParameterValue) params[i];
          final ReferenceIdentifier name = param.getDescriptor().getName();
          if (name.equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName())) {
            final GridGeometry2D gg = (GridGeometry2D) param.getValue();
            requestedEnvelope = new GeneralEnvelope((Envelope) gg.getEnvelope2D());
            dim = gg.getGridRange2D().getBounds();
            continue;
          }
          if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName())) {
            overviewPolicy=(OverviewPolicy) param.getValue();
            continue;
         
                    if (name.equals(AbstractGridFormat.INPUT_TRANSPARENT_COLOR.getName())) {
                        inputTransparentColor = (Color) param.getValue();
                        continue;
                   
                    if (name.equals(AbstractGridFormat.SUGGESTED_TILE_SIZE.getName())) {
                        String suggestedTileSize_= (String) param.getValue();
                        if(suggestedTileSize_!=null&&suggestedTileSize_.length()>0){
                            suggestedTileSize_=suggestedTileSize_.trim();
                            int commaPosition=suggestedTileSize_.indexOf(",");
                            if(commaPosition<0){
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        // //
        if (params != null) {
            for (GeneralParameterValue gParam : params) {
                if (gParam instanceof ParameterValue<?>) {
                    final ParameterValue<?> param = (ParameterValue<?>) gParam;
                    final ReferenceIdentifier name = param.getDescriptor().getName();
                    extractParameter(param, name);
                }
            }
        }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        if(!(descriptor instanceof ParameterDescriptor))
          continue;
       
        // get name and default value
        final ParameterDescriptor desc=(ParameterDescriptor) descriptor;
        final ReferenceIdentifier name = desc.getName();
        final Object value= desc.getDefaultValue();
       
          // //
          //
          // Requested GridGeometry2D parameter
          //
          // //
          if (descriptor.getName().equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName())) {
            if (value == null)
              continue;
              final GridGeometry2D gg = (GridGeometry2D)value;
             
              spatialRequestHelper.setRequestedGridGeometry(gg);
              continue;
          }
 
          // //
          //
          // Use JAI ImageRead parameter
          //
          // //
          if (name.equals(AbstractGridFormat.USE_JAI_IMAGEREAD.getName())) {
            if (value == null)
              continue;
              readType = ((Boolean)value)? ReadType.JAI_IMAGEREAD: ReadType.DIRECT_READ;
              continue;
          }
 
 
          // //
          //
          // Overview Policy parameter
          //
          // //
          if (name.equals(AbstractGridFormat.OVERVIEW_POLICY.getName())) {
              if (value == null)
                  continue;
              overviewPolicy = (OverviewPolicy) value;
              continue;
          }
         
          // //
                //
                // Decimation Policy parameter
                //
                // //
                if (name.equals(AbstractGridFormat.DECIMATION_POLICY.getName())) {
                    if (value == null)
                            continue;
                    decimationPolicy = (DecimationPolicy) value;
                    continue;
                }
 
                // //
                //
                // Interpolation parameter
                //
                // //
                if (name.equals(ImageMosaicFormat.INTERPOLATION.getName())) {
                    if (value == null) {
                            continue;
                    }
                    interpolation = (Interpolation) value;
                    continue;
                }
               
               
          if (name.equals(AbstractGridFormat.INPUT_TRANSPARENT_COLOR.getName())) {
            if(value==null)
              continue;
        inputTransparentColor = (Color) value;
        // paranoiac check on the provided transparent color
        inputTransparentColor = new Color(
            inputTransparentColor.getRed(),
            inputTransparentColor.getGreen(),
            inputTransparentColor.getBlue());
        continue;
 
      }
 
      if (name.equals(ImageMosaicFormat.FADING.getName())) {
            if(value==null)
              continue;
        blend = ((Boolean) value).booleanValue();
        continue;
 
      }
      if (name.equals(
          ImageMosaicFormat.OUTPUT_TRANSPARENT_COLOR.getName())) {
            if(value==null)
              continue;
        outputTransparentColor = (Color) value;
        // paranoiac check on the provided transparent color
        outputTransparentColor = new Color(
            outputTransparentColor.getRed(),
            outputTransparentColor.getGreen(),
            outputTransparentColor.getBlue());
        continue;
 
      }
     
      if (name.equals(
          ImageMosaicFormat.BACKGROUND_VALUES.getName())) {
            if(value==null)
              continue;
        backgroundValues = (double[]) value;
        continue;
 
      }   
   
      if (name.equals(ImageMosaicFormat.MAX_ALLOWED_TILES.getName())) {
            if(value==null)
              continue;
        maximumNumberOfGranules=(Integer)value;
        continue;
      }  
     
      if (name.equals(ImageMosaicFormat.DEFAULT_ARTIFACTS_FILTER_THRESHOLD.getName())) {
                          if (value==null)
                                  continue;
                          defaultArtifactsFilterThreshold =(Integer)value;
                          continue;
                  }    
     
      if (name.equals(ImageMosaicFormat.ARTIFACTS_FILTER_PTILE_THRESHOLD.getName())) {
                            if (value==null)
                                    continue;
                            artifactsFilterPTileThreshold =(Double)value;
                            continue;
                    }    
     
     
      if (name.equals(ImageMosaicFormat.ALLOW_MULTITHREADING.getName())) {
            if(value==null)
              continue;
        multithreadingAllowed = ((Boolean) value).booleanValue();
        continue;
      }    
     
            if (name.equals(ImageMosaicFormat.FOOTPRINT_BEHAVIOR.getName())) {
                if (value == null)
                    continue;
                footprintBehavior = FootprintBehavior.valueOf((String) value);
                continue;
            }
     
        
          // //
          //
          // Suggested tile size parameter. It must be specified with
          // the syntax: "TileWidth,TileHeight" (without quotes where TileWidth
          // and TileHeight are integer values)
          //
          // //
          if (name.equals(AbstractGridFormat.SUGGESTED_TILE_SIZE.getName())) {
              final String suggestedTileSize = (String) value;
 
              // Preliminary checks on parameter value
              if ((suggestedTileSize != null)
                      && (suggestedTileSize.trim().length() > 0)) {
 
                  if (suggestedTileSize
                          .contains(AbstractGridFormat.TILE_SIZE_SEPARATOR)) {
                      final String[] tilesSize = suggestedTileSize
                              .split(AbstractGridFormat.TILE_SIZE_SEPARATOR);
                      if (tilesSize.length == 2) {
                          try {
                              // Getting suggested tile size
                              final int tileWidth = Integer.valueOf(tilesSize[0] .trim());
                              final int tileHeight = Integer.valueOf(tilesSize[1].trim());
                              tileDimensions= new Dimension(tileWidth,tileHeight);
                          } catch (NumberFormatException nfe) {
                              if (LOGGER.isLoggable(Level.WARNING)) {
                                  LOGGER.log(Level.WARNING, "Unable to parse "
                                          + "suggested tile size parameter");
                              }
                          }
                      }
                  }
              }
          }
         
            if (name.equals(ImageMosaicFormat.ACCURATE_RESOLUTION.getName())) {
                if (value == null)
                    continue;
                accurateResolution = ((Boolean) value).booleanValue();
                return;
            }
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.