/** * Returns the coordinate operation instance to be tested. When this method is invoked for the first time, * it creates the coordinate operation to test by invoking the corresponding method from * {@link CoordinateOperationFactory} with the current {@link #properties properties} map in argument. * The created object is then cached and returned in all subsequent invocations of this method. * * @return the geodetic datum instance to test. * @throws FactoryException if an error occurred while creating the coordinate operation instance. */ @Override @SuppressWarnings("null") public Conversion getIdentifiedObject() throws FactoryException { if (conversion == null) { validators.validate(definition); final CoordinateOperation operation = copFactory.createDefiningConversion(properties, method, definition); if (operation != null) { // For consistency with the behavior in other classes. assertInstanceOf(getName(), Conversion.class, operation); conversion = (Conversion) operation; } } return conversion; }
CoordinateReferenceSystem createCrs(String crsName, OperationMethod method, ParameterValueGroup parameters, GeodeticDatum datum) throws FactoryException { final CRSFactory crsFactory = ReferencingFactoryFinder.getCRSFactory(null); final CoordinateOperationFactory coFactory = ReferencingFactoryFinder.getCoordinateOperationFactory(null); final HashMap<String, Object> projProperties = new HashMap<String, Object>(); projProperties.put("name", crsName + " / " + datum.getName().getCode()); final Conversion conversion = coFactory.createDefiningConversion(projProperties, method, parameters); final HashMap<String, Object> baseCrsProperties = new HashMap<String, Object>(); baseCrsProperties.put("name", datum.getName().getCode()); final GeographicCRS baseCrs = crsFactory.createGeographicCRS(baseCrsProperties, datum, DefaultEllipsoidalCS.GEODETIC_2D); return crsFactory.createProjectedCRS(projProperties, baseCrs, conversion, DefaultCartesianCS.PROJECTED); } }
CoordinateReferenceSystem createCrs(String crsName, OperationMethod method, ParameterValueGroup parameters, GeodeticDatum datum) throws FactoryException { final CRSFactory crsFactory = ReferencingFactoryFinder.getCRSFactory(null); final CoordinateOperationFactory coFactory = ReferencingFactoryFinder.getCoordinateOperationFactory(null); final HashMap<String, Object> projProperties = new HashMap<String, Object>(); projProperties.put("name", crsName + " / " + datum.getName().getCode()); final Conversion conversion = coFactory.createDefiningConversion(projProperties, method, parameters); final HashMap<String, Object> baseCrsProperties = new HashMap<String, Object>(); baseCrsProperties.put("name", datum.getName().getCode()); final GeographicCRS baseCrs = crsFactory.createGeographicCRS(baseCrsProperties, datum, DefaultEllipsoidalCS.GEODETIC_2D); return crsFactory.createProjectedCRS(projProperties, baseCrs, conversion, DefaultCartesianCS.PROJECTED); } }
operation = new DeferredCoordinateOperation(opProperties, sourceCRS, targetCRS, owner); } else if (isConversion && (sourceCRS == null || targetCRS == null)) { operation = copFactory.createDefiningConversion(opProperties, method, parameters); } else if (isConcatenated) {
operation = new DeferredCoordinateOperation(opProperties, sourceCRS, targetCRS, owner); } else if (isConversion && (sourceCRS == null || targetCRS == null)) { operation = copFactory.createDefiningConversion(opProperties, method, parameters); } else if (isConcatenated) {
return opFactory.createDefiningConversion(properties, method, parameters); } catch (FactoryException exception) { throw parent.parseFailed(exception);
return opFactory.createDefiningConversion(properties, method, parameters); } catch (FactoryException exception) { throw parent.parseFailed(exception);
CoordinateOperationFactory coordinateOperationFactory = ReferencingFactoryFinder.getCoordinateOperationFactory(null); OperationMethod method = null; Conversion definingConversion = coordinateOperationFactory.createDefiningConversion(properties, method, parameters);
fromBase = opFactory.createDefiningConversion(referencing.getProperties(fromBase, true), fromBase.getMethod(), fromBase.getParameterValues()); cs = csFactory.createCartesianCS(csProps, axes[0], axes[1], axes[2]);
fromBase = opFactory.createDefiningConversion(referencing.getProperties(fromBase, true), fromBase.getMethod(), fromBase.getParameterValues()); cs = csFactory.createCartesianCS(csProps, axes[0], axes[1], axes[2]);
validators.validate(paramUTM); validators.validate(baseToUTM = copFactory .createDefiningConversion(name("Transverse_Mercator"), projectionMethod, paramUTM)); validators.validate(projectedCRS = crsFactory.createProjectedCRS(name("WGS 84 / UTM Zone 12 (2D)"), baseCRS, baseToUTM, projectedCS)); validators.validate(crs3D = crsFactory.createCompoundCRS(name("3D Compound WGS 84 / UTM Zone 12"), projectedCRS, heightCRS));