/** * Unit constructor. * * @param symbol * @param name * of the unit, e.g. metre */ public Unit( final String symbol, final String name ) { this( symbol, name, CRSCodeType.valueOf( name ) ); }
/** * Unit constructor, which uses the name as the id. * * @param symbol * of the units, e.g. 'm' * @param name * human readable name, e.g. metre * @param scale * to convert to the base type. * @param baseType * the baseType */ public Unit( final String symbol, String name, final double scale, final IUnit baseType ) { this( symbol, name, CRSCodeType.valueOf( name ), scale, baseType ); }
/** * The id is as it is, not trimming 'upcasing' or other modifications will be done in this method. * * @param <V> * the type to cast to if the casting fails, null will be returned. * * @param id * to search the cache for * @return the {@link CRSIdentifiable} or <code>null</code> if it was not found or the wrong type was found. */ @SuppressWarnings("unchecked") public <V extends CRSResource> V getCachedIdentifiable( String id ) { if ( id == null ) { return null; } V result = (V) cachedIdentifiables.get( CRSCodeType.valueOf( id ) ); if ( LOG.isDebugEnabled() ) { LOG.debug( "Searched for id: " + id + " resulted in: " + ( ( result == null ) ? "null" : result.getCode() ) ); } return result; }
/** * Sets the id to "Snyder-StereoGraphic" * * @param trueScaleLatitude * the latitude (in radians) of a circle around the projection point, which contains the true scale. * @param geographicCRS * @param falseNorthing * @param falseEasting * @param naturalOrigin * @param units * @param scale */ public StereographicAzimuthal( double trueScaleLatitude, double falseNorthing, double falseEasting, Point2d naturalOrigin, IUnit units, double scale ) { this( trueScaleLatitude, falseNorthing, falseEasting, naturalOrigin, units, scale, new CRSIdentifiable( CRSCodeType.valueOf( "Snyder-StereoGraphic" ) ) ); }
/** * The id is as it is, not trimming 'upcasing' or other modifications will be done in this method. * * @param expectedType * The class of type T which is expected. * @param <V> * the type to cast to if the casting fails, null will be returned. * * @param id * to search the cache for * @return the {@link CRSIdentifiable} or <code>null</code> if it was not found or the wrong type was found. */ @SuppressWarnings("unchecked") public <V extends CRSResource> V getCachedIdentifiable( Class<V> expectedType, String id ) { if ( id == null ) { return null; } V result = null; try { result = (V) cachedIdentifiables.get( CRSCodeType.valueOf( id ) ); } catch ( ClassCastException cce ) { LOG.error( "Given id is not of type: " + expectedType.getCanonicalName() + " found following error: " + cce.getLocalizedMessage() ); } if ( LOG.isDebugEnabled() ) { LOG.debug( "Searched for id: " + id + " resulted in: " + ( ( result == null ) ? "null" : result.getCode() ) ); } return result; }
@Override public List<ICRS> getAvailableCRSs() throws CRSConfigurationException { List<ICRS> allSystems = new LinkedList<ICRS>(); Set<String> knownIds = new HashSet<String>(); List<CRSCodeType[]> allCRSIDs = getAvailableCRSCodes(); final int total = allCRSIDs.size(); // int count = 0; // int percentage = (int) Math.round( total / 100.d ); // int number = 0; LOG.info( "Trying to create a total of " + total + " coordinate systems." ); for ( CRSCodeType[] crsID : allCRSIDs ) { if ( crsID != null ) { String id = crsID[0].getOriginal(); if ( id != null && !"".equals( id.trim() ) ) { // if ( count++ % percentage == 0 ) { // System.out.println( ( number ) + ( ( number++ < 10 ) ? " " : "" ) + "% created" ); // } if ( !knownIds.contains( id.toLowerCase() ) ) { allSystems.add( getCRSByCode( CRSCodeType.valueOf( id ) ) ); for ( CRSCodeType code : crsID ) { knownIds.add( code.getOriginal().toLowerCase() ); } } } } } System.out.println(); return allSystems; }
+ ( EPSG_PRE + identifier ); PrimeMeridian pm = createPrimeMeridian( params ); result = new GeodeticDatum( ellipsoid, pm, null, CRSCodeType.valueOf( id ), name, version, description, areaOfUse );
/** * @param source * the geographic crs. * @param target * the geocentric crs. */ public GeocentricTransform( ICRS source, IGeocentricCRS target ) { this( source, target, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( source.getCode().toString(), target.getCode().toString() ) ) ) ); }
/** * @param sourceCRS * @param targetCRS */ public NotSupportedTransformation( ICRS sourceCRS, ICRS targetCRS ) { this( sourceCRS, targetCRS, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( sourceCRS.getCode().toString(), targetCRS.getCode().toString() ) ) ) ); }
/** * Construct a 3d transform. * * @param source * the source coordinate system * @param target * the target coordinate system. * * @param matrix */ public MatrixTransform( ICRS source, ICRS target, final Matrix3d matrix ) { this( source, target, matrix, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( source.getCode().toString(), target.getCode().toString() ) ) ) ); }
/** * Construct a 4d transform. * * @param source * the source coordinate system * @param target * the target coordinate system. * * @param matrix */ public MatrixTransform( ICRS source, ICRS target, Matrix4d matrix ) { this( source, target, matrix, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( source.getCode().toString(), target.getCode().toString() ) ) ) ); }
/** * Construct a transform. * * @param source * the source coordinate system * @param target * the target coordinate system. * * @param matrix */ public MatrixTransform( ICRS source, ICRS target, final GMatrix matrix ) { this( source, target, matrix, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( source.getCode().toString(), target.getCode().toString() ) ) ) ); }
/** * Creates a transform by concatenating two existing transforms. A concatenated transform applies two transforms, * one after the other. The dimension of the output space of the first transform must match the dimension of the * input space in the second transform. * * Creates an CRSIdentifiable using the {@link Transformation#createFromTo(String, String)} method. * * @param first * The first transformation to apply to given points. * @param second * The second transformation to apply to given points. */ public ConcatenatedTransform( Transformation first, Transformation second ) { this( first, second, new CRSIdentifiable( CRSCodeType.valueOf( Transformation.createFromTo( first.getCode().toString(), second.getCode().toString() ) ) ) ); }
/** * Construct a 4d transform. * * @param source * the source coordinate system * @param target * the target coordinate system. * * @param matrix * @param transformationName * the 'optional' name of the transformation, which is useful to specify the 'helmert' transformation. */ public MatrixTransform( ICRS source, ICRS target, Matrix4d matrix, String transformationName ) { this( source, target, matrix, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( source.getCode().toString(), target.getCode().toString() ) ) ) ); }
/** * @param projectedCRS * The crs containing a projection. */ public ProjectionTransform( IProjectedCRS projectedCRS ) { this( projectedCRS, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( projectedCRS.getGeographicCRS().getCode().toString(), projectedCRS.getCode().toString() ) ) ) ); }
/** * @param transformation * to apply * @param sourceCRS * in which the points will be defined. */ public DirectTransform( PolynomialTransformation transformation, CRS sourceCRS ) { this( transformation, sourceCRS, new CRSIdentifiable( CRSCodeType.valueOf( createFromTo( sourceCRS.getCode().toString(), transformation.getTargetCRS().getCode().toString() ) ) ) ); }
private Transformation createFromCompound( ICompoundCRS sourceCRS, ICRS targetCRS ) throws TransformationException { ICompoundCRS target; if ( targetCRS.getType() != COMPOUND ) { target = new CompoundCRS( sourceCRS.getHeightAxis(), targetCRS, sourceCRS.getDefaultHeight(), new CRSIdentifiable( new CRSCodeType[] { CRSCodeType.valueOf( targetCRS.getCode() + "_compound" ) } ) ); } else { target = (ICompoundCRS) targetCRS; } return createTransformation( sourceCRS, target ); }
target.getDefaultHeight(), new CRSIdentifiable( new CRSCodeType[] { CRSCodeType.valueOf( sourceCRS.getCode() + "_compound" ) } ) ); result = createTransformation( sTmp, target );
target.getDefaultHeight(), new CRSIdentifiable( new CRSCodeType[] { CRSCodeType.valueOf( sourceCRS.getCode() + "_compound" ) } ) ); result = createTransformation( sTmp, target );
target.getDefaultHeight(), new CRSIdentifiable( new CRSCodeType[] { CRSCodeType.valueOf( sourceCRS.getCode() + "_compound" ) } ) ); result = createTransformation( sTmp, target );