Package org.opengis.referencing.crs

Examples of org.opengis.referencing.crs.GeographicCRS


                csFactory.createCoordinateSystemAxis(name("Latitude")"lat",  AxisDirection.NORTH, degrees));
        out.println();
        out.println("create Coodinate Reference System....5: ");
        out.println(ellCS); // No WKT for coordinate systems

        final GeographicCRS geogCRS;
        geogCRS = crsFactory.createGeographicCRS(name("Airy1830"), datum, ellCS);
        out.println();
        out.println("create Coodinate Reference System....6: ");
        out.println(geogCRS.toWKT());

        final MathTransform p;
        final ParameterValueGroup param = mtFactory.getDefaultParameters("Transverse_Mercator");
        param.parameter("semi_major")        .setValue(airy1830.getSemiMajorAxis());
        param.parameter("semi_minor")        .setValue(airy1830.getSemiMinorAxis());
View Full Code Here


      final double centralMeridian = Double.parseDouble(centralMeridianS);
      final double equatorialRadius = 1000 * Double.parseDouble(equatorialRadiusS);
      final double natOriginLat = Double.parseDouble(natOriginLatS);
      final double inverseFlattening = 1 / Double.parseDouble(flatteningS);

      GeographicCRS sourceCRS = CRSUtilities.getBaseCRS(equatorialRadius, inverseFlattening,true);
      nativeCrs = CRSUtilities.getMercator2SPProjectedCRS(standardParallel, centralMeridian, natOriginLat,
              sourceCRS, null);
//       if (nativeCrs!=null)
//         projectionNameS = nativeCrs.getName().toString();
//       else
View Full Code Here

   
    public static GeographicCRS getBaseCRS(final double firstParameter,
            final double secondParameter, final boolean isSecondParameterInverseFlattening){
        final DefaultGeodeticDatum datum;
        datum = CRSUtilities.getDefaultGeodeticDatum("WGS84", firstParameter, secondParameter, SI.METER, isSecondParameterInverseFlattening);
        final GeographicCRS sourceCRS = new DefaultGeographicCRS("WGS-84", datum, DefaultGeographicCRS.WGS84.getCoordinateSystem());
        return sourceCRS;
    }
View Full Code Here

/**
* A method with some examples of premade static objects.
*/
void premadeObjects() {
    // premadeObjects start
    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    GeodeticDatum wgs84Datum = org.geotools.referencing.datum.DefaultGeodeticDatum.WGS84;
    PrimeMeridian greenwichMeridian = org.geotools.referencing.datum.DefaultPrimeMeridian.GREENWICH;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;
    CoordinateSystemAxis latAxis = org.geotools.referencing.cs.DefaultCoordinateSystemAxis.GEODETIC_LATITUDE;
    // premadeObjects end
View Full Code Here

    System.out.println("Creating a CRS by hand:");
    // createCRSByHand1 start
    MathTransformFactory mtFactory = ReferencingFactoryFinder.getMathTransformFactory(null);
    CRSFactory crsFactory = ReferencingFactoryFinder.getCRSFactory(null);
   
    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;
   
    ParameterValueGroup parameters = mtFactory.getDefaultParameters("Transverse_Mercator");
    parameters.parameter("central_meridian").setValue(-111.0);
    parameters.parameter("latitude_of_origin").setValue(0.0);
View Full Code Here

   
    map.clear();
    map.put("name", "NAD 27");
    map.put("authority", "9999");
    // TODO add an authority code here (should be an identifier)
    GeographicCRS nad27CRS = crsFactory.createGeographicCRS(map, clark1866datum, ellipsCS);
    // createCRSByHand2 end
    System.out.println(nad27CRS.toWKT());
    System.out.println("Identified CRS object:");
    printIdentifierStuff(nad27CRS);
   
    System.out.println("------------------------------------------");
   
View Full Code Here

                 * it is not defined to be on a particular datum; it is only approximative bounds.
                 * We try to get the GeographicCRS from the user-supplied CRS and fallback on WGS
                 * 84 only if we found none.
                 */
                final SingleCRS     targetCRS = getHorizontalCRS(crs);
                final GeographicCRS sourceCRS = CRSUtilities.getStandardGeographicCRS2D(targetCRS);
                merged.setCoordinateReferenceSystem(sourceCRS);
                try {
                    envelope = transform(envelope, targetCRS);
                } catch (TransformException exception) {
                    /*
 
View Full Code Here

                    } catch (FactoryException e) {
                        Logging.recoverableException(CRS.class, "getHorizontalCRS", e);
                        horizontalCS = new DefaultEllipsoidalCS(properties, axis0, axis1);
                    }
                    properties = CRSUtilities.changeDimensionInName(crs, "3D", "2D");
                    GeographicCRS horizontalCRS;
                    try {
                        horizontalCRS = ReferencingFactoryFinder.getCRSFactory(null).
                                createGeographicCRS(properties, datum, horizontalCS);
                    } catch (FactoryException e) {
                        Logging.recoverableException(CRS.class, "getHorizontalCRS", e);
View Full Code Here

    /**
     * Returns a projected CRS for test purpose.
     */
    private static CoordinateReferenceSystem getProjectedCRS(final GridCoverage2D coverage) {
        try {
            final GeographicCRS  base = (GeographicCRS) coverage.getCoordinateReferenceSystem();
            final Ellipsoid ellipsoid = base.getDatum().getEllipsoid();
            final DefaultMathTransformFactory factory = new DefaultMathTransformFactory();
            final ParameterValueGroup parameters = factory.getDefaultParameters("Oblique_Stereographic");
            parameters.parameter("semi_major").setValue(ellipsoid.getSemiMajorAxis());
            parameters.parameter("semi_minor").setValue(ellipsoid.getSemiMinorAxis());
            parameters.parameter("central_meridian").setValue(5);
View Full Code Here

  }

  public GeographicCRS createGeographicCRS(String code)
      throws FactoryException {
    final String key = toKey(code);
    GeographicCRS crs = (GeographicCRS) cache.get(key);
    if (crs == null) {
      try {
        cache.writeLock(key);
        crs = (GeographicCRS) cache.peek(key);
        if (crs == null) {
View Full Code Here

TOP

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

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.