Package org.opengis.referencing

Examples of org.opengis.referencing.NoSuchAuthorityCodeException


                throw new NoSuchIdentifierException(Errors.format(Errors.Keys.UnknownAuthority_1, authority), authority);
            }
        } catch (NumberFormatException e) {
            cause = e;
        }
        final NoSuchAuthorityCodeException e = new NoSuchAuthorityCodeException(
                Errors.format(Errors.Keys.NoSuchAuthorityCode_3, authority, CoordinateReferenceSystem.class, value),
                authority, value, code);
        e.initCause(cause);
        throw e;
    }
View Full Code Here


    {
        if (code == null) {
            return null;
        }
        if( !code.startsWith( AUTHORITY_PREFIX )){
            throw new NoSuchAuthorityCodeException( "This factory only understand EPSG codes", AUTHORITY, code );
        }
        final String EPSG_NUMBER = code.substring( code.indexOf(':')+1 ).trim();
       
        if( cache.containsKey( EPSG_NUMBER ) ){
            Object value = cache.get( EPSG_NUMBER );
            if( value instanceof Throwable ){
                throw new FactoryException( "WKT for "+code+" could not be parsed", (Throwable) value );
            }
            if( value instanceof CoordinateReferenceSystem){
                return (CoordinateReferenceSystem) value;
            }           
        }
        String wkt = epsg.getProperty( EPSG_NUMBER );
        if( wkt == null ) {
            throw new NoSuchAuthorityCodeException( "Unknown EPSG_NUMBER", AUTHORITY, code );
        }
        if( wkt.indexOf( EPSG_NUMBER ) == -1){
          wkt = wkt.trim();
          wkt = wkt.substring(0, wkt.length()-1 );
          wkt += ",AUTHORITY[\"EPSG\",\""+EPSG_NUMBER+"\"]]";
View Full Code Here

                    code = authority + GenericName.DEFAULT_SEPARATOR + code;
                    return code;
                }
            }
        }
        throw new NoSuchAuthorityCodeException(Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2,
                "code", code), BASE_URL, code);
    }
View Full Code Here

                    String uriCode = segments[3];
                    return new HTTP_URI_Parser(uriText, uriType, uriAuthority, uriVersion, uriCode);
                }
            }
        }
        throw new NoSuchAuthorityCodeException(
                Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$1, uriText), AUTHORITY, uriText);
    }
View Full Code Here

        }
    }

    private NoSuchAuthorityCodeException noSuchAuthorityException(String code) throws NoSuchAuthorityCodeException {
        String authority = "EPSG";
        return new NoSuchAuthorityCodeException(Errors.format(ErrorKeys.NO_SUCH_AUTHORITY_CODE_$3,
                   code, authority, EngineeringCRS.class), authority, code);
    }
View Full Code Here

     * Creates an exception for a missing factory. We actually returns an instance of
     * {@link NoSuchAuthorityCodeException} because this kind of exception is treated
     * especially by {@link FallbackAuthorityFactory}.
     */
    private FactoryException missingFactory(final Class category, final String code) {
        return new NoSuchAuthorityCodeException(Errors.format(ErrorKeys.FACTORY_NOT_FOUND_$1,
                category), Citations.getIdentifier(getAuthority()), trimAuthority(code));
    }
View Full Code Here

                        }
                    }
                }
            }
        }
        throw new NoSuchAuthorityCodeException(
                Errors.format(ErrorKeys.ILLEGAL_IDENTIFIER_$1, type), "urn:ogc:def", type);
    }
View Full Code Here

                longitude = Double.parseDouble(parts[2]);
                latitude  = Double.parseDouble(parts[3]);
            }
        } catch(NumberFormatException exception) {
            // If a number can't be parsed, then this is an invalid authority code.
            NoSuchAuthorityCodeException e = noSuchAuthorityCode(type, text);
            e.initCause(exception);
            throw e;
        }
       
        if (!(longitude>=Longitude.MIN_VALUE && longitude<=Longitude.MAX_VALUE &&
              latitude >= Latitude.MIN_VALUE && latitude <= Latitude.MAX_VALUE))
View Full Code Here

     */
    private static NoSuchAuthorityCodeException noSuchAuthorityCode(final Class  type,
                                                                    final String code)
    {
        final String authority = "AUTO";
        return new NoSuchAuthorityCodeException(Errors.format(ErrorKeys.NO_SUCH_AUTHORITY_CODE_$3,
                   code, authority, type), authority, code);
    }
View Full Code Here

        final int i;
        try {
            i = Integer.parseInt(c);
        } catch (NumberFormatException exception) {
            // If a number can't be parsed, then this is an invalid authority code.
            NoSuchAuthorityCodeException e = noSuchAuthorityCode(CoordinateReferenceSystem.class, code);
            e.initCause(exception);
            throw e;
        }
        ensureInitialized();
        final CoordinateReferenceSystem crs = crsMap.get(i);
        if (crs != null) {
View Full Code Here

TOP

Related Classes of org.opengis.referencing.NoSuchAuthorityCodeException

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.