Examples of CartesianCS


Examples of org.opengis.referencing.cs.CartesianCS

     *         or {@code false} for the other way around.
     * @return The axes to use instead of the ones in the given CS,
     *         or {@code cs} if the CS axes should be used as-is.
     */
    public static CartesianCS forGeocentricCRS(final CartesianCS cs, final boolean toLegacy) {
        final CartesianCS check = toLegacy ? standard() : LEGACY;
        final int dimension = check.getDimension();
        if (cs.getDimension() != dimension) {
            return cs;
        }
        for (int i=0; i<dimension; i++) {
            if (!cs.getAxis(i).getDirection().equals(check.getAxis(i).getDirection())) {
                return cs;
            }
        }
        return toLegacy ? LEGACY : standard();
    }
View Full Code Here

Examples of org.opengis.referencing.cs.CartesianCS

        parameters.parameter("false_easting").setValue(0.0);
        parameters.parameter("false_northing").setValue(0.0);

        GeographicCRS base = DefaultGeographicCRS.WGS84;
        MathTransform mt   = factory.createParameterizedTransform(parameters);
        CartesianCS cs = DefaultCartesianCS.PROJECTED;
        CoordinateReferenceSystem crs = new DefaultProjectedCRS("Lambert", base, mt, cs);

        final String wkt = crs.toWKT();
        assertTrue(wkt.contains("semi_major"));
        assertTrue(wkt.contains("semi_minor"));
View Full Code Here

Examples of org.opengis.referencing.cs.CartesianCS

        out.println("create Coodinate System....7: ");
        out.println(param);

        // NOTE: we could use the following pre-defined constant instead:
        //       DefaultCartesianCS.PROJECTED;
        final CartesianCS cartCS;
        cartCS = csFactory.createCartesianCS(name("Cartesian"),
                 csFactory.createCoordinateSystemAxis(name("Easting")"x", AxisDirection.EAST,  meters),
                 csFactory.createCoordinateSystemAxis(name("Northing"), "y", AxisDirection.NORTH, meters));
        out.println();
        out.println("create Coodinate Reference System....8: ");
View Full Code Here

Examples of org.opengis.referencing.cs.CartesianCS

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

Examples of org.opengis.referencing.cs.CartesianCS

    // 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);
    parameters.parameter("scale_factor").setValue(0.9996);
View Full Code Here

Examples of org.opengis.referencing.cs.CartesianCS

    CoordinateSystemAxis zAxis = csFactory.createCoordinateSystemAxis(map, "Z",
            AxisDirection.GEOCENTRIC_Z, SI.METER);
   
    map.clear();
    map.put("name", "Rendered Cartesian CS");
    CartesianCS worldCS = csFactory.createCartesianCS(map, xAxis, yAxis, zAxis);
   
    // Now, the geocentric coordinate reference system that we'd use for output - eg to a 3D
    // renderer
    map.clear();
    map.put("name", "Output Cartesian CS");
View Full Code Here

Examples of org.opengis.referencing.cs.CartesianCS

  //
  // CSAuthority
  //
  public CartesianCS createCartesianCS(String code) throws FactoryException {
    final String key = toKey(code);
    CartesianCS cs = (CartesianCS) cache.get(key);
    if (cs == null) {
      try {
        cache.writeLock(key);
        cs = (CartesianCS) cache.peek(key);
        if (cs == null) {
View Full Code Here

Examples of org.opengis.referencing.cs.CartesianCS

                    final String csCode  = getString(result,  7, code);
                    final String geoCode = getString(result,  9, code);
                    final String opCode  = getString(result, 10, code);
                    result.close(); // Must be close before createGeographicCRS
                    result = null;
                    final CartesianCS         cs = createCartesianCS(csCode);
                    final GeographicCRS  baseCRS = createGeographicCRS(geoCode);
                    final CoordinateOperation op = createCoordinateOperation(opCode);
                    if (op instanceof Conversion) {
                        final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                        crs = factory.createProjectedCRS(properties, baseCRS, (Conversion)op, cs);
                    } else {
                         throw noSuchAuthorityCode(Projection.class, opCode);
                    }
                }
                /* ----------------------------------------------------------------------
                 *   VERTICAL CRS
                 * ---------------------------------------------------------------------- */
                else if (type.equalsIgnoreCase("vertical")) {
                    final String        csCode = getString(result, 7, code);
                    final String        dmCode = getString(result, 8, code);
                    final VerticalCS    cs     = createVerticalCS   (csCode);
                    final VerticalDatum datum  = createVerticalDatum(dmCode);
                    final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                    crs = factory.createVerticalCRS(properties, datum, cs);
                }
                /* ----------------------------------------------------------------------
                 *   COMPOUND CRS
                 *
                 *   NOTE: This method invokes itself recursively.
                 *         Consequently, we can't use 'result' anymore.
                 * ---------------------------------------------------------------------- */
                else if (type.equalsIgnoreCase("compound")) {
                    final String code1 = getString(result, 11, code);
                    final String code2 = getString(result, 12, code);
                    result.close();
                    result = null;
                    final CoordinateReferenceSystem crs1, crs2;
                    if (!safetyGuard.add(epsg)) {
                        throw recursiveCall(CompoundCRS.class, epsg);
                    } try {
                        crs1 = createCoordinateReferenceSystem(code1);
                        crs2 = createCoordinateReferenceSystem(code2);
                    } finally {
                        safetyGuard.remove(epsg);
                    }
                    // Note: Don't invoke 'generateProperties' sooner.
                    final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                    crs  = factory.createCompoundCRS(properties,
                           new CoordinateReferenceSystem[] {crs1, crs2});
                }
                /* ----------------------------------------------------------------------
                 *   GEOCENTRIC CRS
                 * ---------------------------------------------------------------------- */
                else if (type.equalsIgnoreCase("geocentric")) {
                    final String           csCode = getString(result, 7, code);
                    final String           dmCode = getString(result, 8, code);
                    final CoordinateSystem cs     = createCoordinateSystem(csCode);
                    final GeodeticDatum    datum  = createGeodeticDatum   (dmCode);
                    final Map<String,Object> properties = generateProperties(name, epsg, area, scope, remarks);
                    if (cs instanceof CartesianCS) {
                        crs = factory.createGeocentricCRS(properties, datum, (CartesianCS) cs);
                    } else if (cs instanceof SphericalCS) {
                        crs = factory.createGeocentricCRS(properties, datum, (SphericalCS) cs);
                    } else {
                        result.close();
                        throw new FactoryException(Errors.format(
                                ErrorKeys.ILLEGAL_COORDINATE_SYSTEM_FOR_CRS_$2,
                                cs.getClass(), GeocentricCRS.class));
                    }
                }
                /* ----------------------------------------------------------------------
                 *   ENGINEERING CRS
                 * ---------------------------------------------------------------------- */
 
View Full Code Here

Examples of org.opengis.referencing.cs.CartesianCS

        if (crsDescription.endsWith("POLAR")) {
          // we need to build a polar stereographic crs based on wgs
          // 84. I am not so sure about the parameters I used. we
          // should check them again

          final CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.PROJECTED;
          final MathTransformFactory mtFactory = ReferencingFactoryFinder
              .getMathTransformFactory(null);
          final ParameterValueGroup parameters = mtFactory
              .getDefaultParameters("Polar_Stereographic");
          parameters.parameter("central_meridian").setValue(0.0);
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.