Package org.geotools.imageio.metadataold

Examples of org.geotools.imageio.metadataold.Identification


  protected void setCoordinateReferenceSystemElement(SpatioTemporalImageReader reader) {
        getAttributesMap(reader);
        init(reader);
        CoordinateReferenceSystem crs = getCRS(SpatioTemporalMetadataFormat.PROJECTED);
        crs.setBaseCRS(new Identification("WGS 84", null, null,"EPSG:4326"));
       
        switch (hdf4_type) {
        case TeraScan:
           setTerascanCRS(crs);
           break;
        case APS:
          setAPSCRS(crs);
            break;
        }

        // //
        //
        // Setting Temporal CRS
        //
        // //
        setHasTemporalCRS(true);
        final TemporalCRS tCRS = getTemporalCRS();
        tCRS.setDatum(new Identification("ISO8601", null, null, null));
       
        String startTime = null;
      String endTime = null;
      Date startDate = null;
    Date endDate = null;
    switch (hdf4_type){
      case APS:
        startTime = attributesMap.get("timeStart");
        endTime = attributesMap.get("timeEnd");
        startDate = HDF4Utilities.getDateTime(startTime, HDF4Utilities.APS_DATETIME_FORMAT);
        endDate = HDF4Utilities.getDateTime(endTime, HDF4Utilities.APS_DATETIME_FORMAT);
        break;
      case TeraScan:
        final String startDates = attributesMap.get("data_start_date");
        final String startTimes = attributesMap.get("data_start_time");
        final String endDates = attributesMap.get("data_end_date");
        final String endTimes = attributesMap.get("data_end_time");
        startTime = new StringBuilder(startDates).append(" ").append(startTimes).toString();
        endTime = new StringBuilder(endDates).append(" ").append(endTimes).toString();
        startDate = HDF4Utilities.getDateTime(startTime, HDF4Utilities.TERASCAN_DATETIME_FORMAT);
        endDate = HDF4Utilities.getDateTime(endTime, HDF4Utilities.TERASCAN_DATETIME_FORMAT);
        break;
      }
    if (startDate != null)
      startInstant = new DefaultInstant(new DefaultPosition(startDate));
    if (endDate != null
      endInstant = new DefaultInstant(new DefaultPosition(endDate));

    final String timeOrigin = startInstant.getPosition().getDateTime().toString();
    tCRS.addAxis(new Identification("TIME"), "future", "hours since "+ timeOrigin, null);
        tCRS.addOrigin(timeOrigin);
    }
View Full Code Here


      // /////////////////////////////////////////////////////////////
      //
      // Mercator 1SP
      //
      // /////////////////////////////////////////////////////////////
      crs.setDefinedByConversion(new Identification(projectionNameS), null, null, null);
    crs.setIdentification(new Identification(projectionNameS));
       
        final String datum = attributesMap.get(HDF4APSStreamMetadata.DATUM);
        final String centralMeridianS = attributesMap.get(HDF4APSStreamMetadata.LONGITUDE_OF_CENTRAL_MERIDIAN);
        final String latitudeOfTrueScaleS = attributesMap.get(HDF4APSStreamMetadata.LATITUDE_OF_TRUE_SCALE);
        final String falseEastingS = attributesMap.get(HDF4APSStreamMetadata.FALSE_EASTINGS);
        final String falseNorthingS = attributesMap.get(HDF4APSStreamMetadata.FALSE_NORTHINGS);
        if (Utilities.ensureValidString(latitudeOfTrueScaleS, centralMeridianS, falseEastingS, falseNorthingS)) {
          final double centralMeridian = Double.parseDouble(centralMeridianS)/1000000d;
      final double latitudeOfTrueScale = Double.parseDouble(latitudeOfTrueScaleS)/1000000d;
      final double falseNorthing = Double.parseDouble(falseNorthingS);
      final double falseEasting = Double.parseDouble(falseEastingS);
       
          crs.addParameterValue(new Identification("central_meridian"),Double.toString(centralMeridian));
          crs.addParameterValue(new Identification("latitude_of_origin"), Double.toString(latitudeOfTrueScale));
          crs.addParameterValue(new Identification("false_northing"), falseNorthingS);
          crs.addParameterValue(new Identification("false_easting"), falseEastingS);
          crs.addParameterValue(new Identification("scale_factor"), "1");
         
          if (Double.parseDouble(datum)==12.0){
              crs.setDatum(Datum.GEODETIC_DATUM, new Identification("WGS_1984","World Geodetic System 1984", null, "EPSG:6326"));
              crs.addPrimeMeridian("0.0", new Identification("Greenwich", null, null,"EPSG:8901"));
              crs.addEllipsoid("6378137.0", null, "298.257223563", "meter",new Identification("WGS 84", null, null, "EPSG:7030"));
          }
      nativeCrs = CRSUtilities.getMercator1SPProjectedCRS(centralMeridian,latitudeOfTrueScale,
          falseEasting,falseNorthing,1,WGS84_CRS,null);
         
          crs.addAxis(new Identification("Easting"), "East", "metre", null);
          crs.addAxis(new Identification("Northing"), "North", "metre", null);
        }
  }
View Full Code Here

              sourceCRS, null);
//       if (nativeCrs!=null)
//         projectionNameS = nativeCrs.getName().toString();
//       else
      String projectionNameS = "Mercator_2SP";
        crs.setDefinedByConversion(new Identification(projectionNameS), null, null, null);
        crs.setIdentification(new Identification(projectionNameS));
     
           crs.addParameterValue(new Identification("standard_parallel_1"), standardParallelS);
           crs.addParameterValue(new Identification("central_meridian"), centralMeridianS);
           crs.addParameterValue(new Identification("latitude_of_origin"), natOriginLatS);
           crs.addParameterValue(new Identification("false_northing"), "0.0");
           crs.addParameterValue(new Identification("false_easting"), "0.0");
          
           // //
           // Datum and Ellipsoid
           // //
           crs.setDatum(Datum.GEODETIC_DATUM, new Identification("WGS_1984","World Geodetic System 1984", null, "EPSG:6326"));
           crs.addPrimeMeridian("0.0", new Identification("Greenwich", null, null,"EPSG:8901"));
           crs.addEllipsoid(Double.toString(Double.parseDouble(equatorialRadiusS)*1000), null, Double.toString(inverseFlattening), "meter",new Identification("WGS 84", null, null, "EPSG:7030"));

           crs.addAxis(new Identification("Easting"), "East", "metre", null);
           crs.addAxis(new Identification("Northing"), "North", "metre", null);
       }
   
  }
View Full Code Here

TOP

Related Classes of org.geotools.imageio.metadataold.Identification

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.