Package org.geotools.referencing.factory

Examples of org.geotools.referencing.factory.ReferencingFactoryContainer


            }

            if (epsg != null) {
                monitor.subTask(Messages.LOADING + epsg);
                Hints hints = new Hints(Hints.CRS_AUTHORITY_FACTORY, PropertyAuthorityFactory.class);
                ReferencingFactoryContainer referencingFactoryContainer = ReferencingFactoryContainer
                        .instance(hints);

                PropertyAuthorityFactory factory = new PropertyAuthorityFactory(
                        referencingFactoryContainer, Citations.fromName("EPSG"), epsg); //$NON-NLS-1$
View Full Code Here


        // //
        //
        // Creating a proper projected CRS
        //
        // //
        final ReferencingFactoryContainer fg = ReferencingFactoryContainer.instance(hints);
        ParameterValueGroup params;
        try {
            params = mtFactory.getDefaultParameters("Mercator_2SP");

            params.parameter("standard_parallel_1").setValue(standardParallel);
            params.parameter("central_meridian").setValue(centralMeridian);
            params.parameter("false_northing").setValue(0);
            params.parameter("false_easting").setValue(0);
            params.parameter("latitude_of_origin").setValue(natOriginLat);

            // //
            //
            // Setting the CRS
            //
            // // 
            final Map<String, String> props = new HashMap<String, String>();
            props.put("name", "Mercator CRS");
            projectedCRS = fg.createProjectedCRS(props, sourceCRS, null, params, DefaultCartesianCS.PROJECTED);
        } catch (FactoryException e) {
            if (LOGGER.isLoggable(Level.FINE))
              LOGGER.log(Level.FINE,e.getLocalizedMessage());
        }
        return projectedCRS;
View Full Code Here

        // //
        //
        // Creating a proper projected CRS
        //
        // //
        final ReferencingFactoryContainer fg = ReferencingFactoryContainer.instance(hints);
        ParameterValueGroup params;
        try {
            params = mtFactory.getDefaultParameters("Mercator_1SP");

            params.parameter("central_meridian").setValue(centralMeridian);
            params.parameter("latitude_of_origin").setValue(latitudeOfOrigin);
            params.parameter("false_northing").setValue(falseNorthing);
            params.parameter("false_easting").setValue(falseEasting);
            params.parameter("scale_factor").setValue(scaleFactor);

            // //
            //
            // Setting the CRS
            //
            // //
            final Map<String, String> props = new HashMap<String, String>();
            props.put("name", "Mercator CRS");
            projectedCRS = fg.createProjectedCRS(props, sourceCRS, null, params, DefaultCartesianCS.PROJECTED);
        } catch (FactoryException e) {
           if (LOGGER.isLoggable(Level.FINE))
               LOGGER.log(Level.FINE,e.getLocalizedMessage());
        }
        return projectedCRS;
View Full Code Here

}

void factories() {
    // factories start
    Hints hints = null; // configure hints for the group of factories
    ReferencingFactoryContainer group = new ReferencingFactoryContainer(hints);
    CRSFactory crsFactory = group.getCRSFactory();
    CSFactory csFactory = group.getCSFactory();
    DatumFactory datumFactory = group.getDatumFactory();
    // factories end
}
View Full Code Here

    map.put(Hints.CRS_FACTORY, crsFactory);
    map.put(Hints.MATH_TRANSFORM_FACTORY, mtFactory);
   
    Hints hints = new Hints(map);
   
    ReferencingFactoryContainer container = new ReferencingFactoryContainer(hints);
    // referencingFactoryContainer end
}
View Full Code Here

void referencingFactoryContainer2() {
    // referencingFactoryContainer2 start
    Hints hints = GeoTools.getDefaultHints();
    DatumFactory datumFactory = ReferencingFactoryFinder.getDatumFactory( hints );
   
    ReferencingFactoryContainer container = new ReferencingFactoryContainer( hints );
   
    ifdatumFactory == container.getDatumFactory() ){
        System.out.println( "Will be the same DatumFactory");
    }
    // referencingFactoryContainer2 end
}
View Full Code Here

         * CRS with a different datum, then the datum shift must be applied on the horizontal and
         * vertical components together.
         */
        for (final SingleCRS target : targets) {
            if (needsGeodetic3D(sources, target)) {
                final ReferencingFactoryContainer factories = getFactoryContainer();
                final CoordinateReferenceSystem source3D = factories.toGeodetic3D(sourceCRS);
                final CoordinateReferenceSystem target3D = factories.toGeodetic3D(targetCRS);
                if (source3D!=sourceCRS || target3D!=targetCRS) {
                    return createOperation(source3D, target3D);
                }
                /*
                 * TODO: Search for non-ellipsoidal height, and lets supplemental axis pass through.
View Full Code Here

         * affine transform. This transform also drop source dimensions not used
         * for any target coordinates.
         */
        assert count == targets.size() : count;
        while (count!=0 && steps[--count].getMathTransform().isIdentity());
        final ReferencingFactoryContainer factories = getFactoryContainer();
        CoordinateOperation operation = null;
        CoordinateReferenceSystem sourceStepCRS = sourceCRS;
        final XMatrix select = MatrixFactory.create(dimensions+1, indices.length+1);
        select.setZero();
        select.setElement(dimensions, indices.length, 1);
        for (int j=0; j<dimensions; j++) {
            select.setElement(j, indices[j], 1);
        }
        if (!select.isIdentity()) {
            if (ordered.length == 1) {
                sourceStepCRS = ordered[0];
            } else {
                sourceStepCRS = factories.getCRSFactory().createCompoundCRS(
                                    getTemporaryName(sourceCRS), ordered);
            }
            operation = createFromAffineTransform(AXIS_CHANGES, sourceCRS, sourceStepCRS, select);
        }
        /*
         * Now creates the pass through transforms for each transformation steps found above.
         * We get (or construct temporary) source and target CRS for this step. They will be
         * given to the constructor of the pass through operation, after the construction of
         * pass through transform.
         */
        int lower, upper=0;
        for (int i=0; i<targets.size(); i++) {
            CoordinateOperation step = steps[i];
            final Map<String,?> properties = AbstractIdentifiedObject.getProperties(step);
            final CoordinateReferenceSystem source = ordered[i];
            final CoordinateReferenceSystem target = targets.get(i);
            final CoordinateReferenceSystem targetStepCRS;
            ordered[i] = target; // Used for the construction of targetStepCRS.
            MathTransform mt = step.getMathTransform();
            if (i >= count) {
                targetStepCRS = targetCRS;
            } else if (mt.isIdentity()) {
                targetStepCRS = sourceStepCRS;
            } else if (ordered.length == 1) {
                targetStepCRS = ordered[0];
            } else {
                targetStepCRS = factories.getCRSFactory().createCompoundCRS(
                                    getTemporaryName(target), ordered);
            }
            lower  = upper;
            upper += getDimension(source);
            if (lower!=0 || upper!=dimensions) {
View Full Code Here

     * Invoked when the {@link #hints} map should be initialized. This method may
     * be overridden by subclasses like {@link BufferedCoordinateOperationFactory}.
     */
    void initializeHints() {
        assert Thread.holdsLock(hints);
        final ReferencingFactoryContainer factories = getFactoryContainer();
        hints.putAll(factories.getImplementationHints());
    }
View Full Code Here

        // //
        //
        // Creating a proper projected CRS
        //
        // //
        final ReferencingFactoryContainer fg = ReferencingFactoryContainer.instance(hints);
        ParameterValueGroup params;
        try {
            params = mtFactory.getDefaultParameters("Mercator_2SP");
            params.parameter("standard_parallel_1").setValue(standardParallel);
            params.parameter("central_meridian").setValue(centralMeridian);
            params.parameter("false_northing").setValue(0);
            params.parameter("false_easting").setValue(0);
            params.parameter("latitude_of_origin").setValue(natOriginLat);

            // //
            //
            // Setting the CRS
            //
            // //

            final Map<String, String> props = new HashMap<String, String>();
            props.put("name", "Mercator CRS");
            projectedCRS = fg.createProjectedCRS(props, sourceCRS, null, params,
                    DefaultCartesianCS.PROJECTED);
        } catch (FactoryException e) {
            throw new DataSourceException(e);
        }
        return projectedCRS;
View Full Code Here

TOP

Related Classes of org.geotools.referencing.factory.ReferencingFactoryContainer

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.