Package org.opengis.referencing

Examples of org.opengis.referencing.IdentifiedObject


     *         corresponding to the specified {@code code} has no description.
     * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found.
     * @throws FactoryException if the query failed for some other reason.
     */
    public InternationalString getDescriptionText(final String code) throws FactoryException {
        IdentifiedObject identifiedObject = createObject(code);
    final Identifier identifier = identifiedObject.getName();
        if (identifier instanceof GenericName) {
            return ((GenericName) identifier).toInternationalString();
        }
        return new SimpleInternationalString( identifier.getCode() );
    }
View Full Code Here


                select = "ELLIPSOID_CODE";
                from   = "[Ellipsoid]";
                where  = "SEMI_MAJOR_AXIS";
                code   = Double.toString(((Ellipsoid) object).getSemiMajorAxis());
            } else {
                IdentifiedObject dependency;
                if (object instanceof GeneralDerivedCRS) {
                    dependency = ((GeneralDerivedCRS) object).getBaseCRS();
                    where      = "SOURCE_GEOGCRS_CODE";
                } else if (object instanceof SingleCRS) {
                    dependency = ((SingleCRS) object).getDatum();
                    where      = "DATUM_CODE";
                } else if (object instanceof GeodeticDatum) {
                    dependency = ((GeodeticDatum) object).getEllipsoid();
                    select     = "DATUM_CODE";
                    from       = "[Datum]";
                    where      = "ELLIPSOID_CODE";
                } else {
                    return super.getCodeCandidates(object);
                }
                dependency = getIdentifiedObjectFinder(dependency.getClass()).find(dependency);
                Identifier id = AbstractIdentifiedObject.getIdentifier(dependency, getAuthority());
                if (id == null || (code = id.getCode()) == null) {
                    return super.getCodeCandidates(object);
                }
            }
View Full Code Here

        @Override
        protected IdentifiedObject deriveEquivalent(final IdentifiedObject candidate,
                                                    final IdentifiedObject model)
                throws FactoryException
        {
            final IdentifiedObject modified = replaceObject(candidate);
            if (modified != candidate) {
                if (CRS.equalsIgnoreMetadata(modified, model)) {
                    return modified;
                }
            }
View Full Code Here

         * to the specified object. The default implementation performs the same lookup than
         * the backing store and caches the result.
         */
        @Override
        public IdentifiedObject find(final IdentifiedObject object) throws FactoryException {
            IdentifiedObject candidate;

            candidate = (IdentifiedObject) findCache.get(object);
            if (candidate != null) {
                return candidate;
            }
            try {
                findCache.writeLock(object); // avoid searching for the same object twice
                IdentifiedObject found = super.find(object);
                if( found == null) {
                    return null; // not found
                }
                candidate = (IdentifiedObject) findCache.peek(object);
                if( candidate == null ){
View Full Code Here

        /**
         * Returns the identifier for the specified object.
         */
        @Override
        public String findIdentifier(final IdentifiedObject object) throws FactoryException {
            IdentifiedObject candidate;
            candidate = (IdentifiedObject) findCache.get(object);
            if (candidate != null) {
                return getIdentifier(candidate);
            }
            return super.findIdentifier(object);
View Full Code Here

        /**
         * Lookups for the specified object.
         */
        @Override
        public IdentifiedObject find(final IdentifiedObject object) throws FactoryException {
            IdentifiedObject candidate = super.find(object);
            if (candidate != null) {
                return candidate;
            }
            IdentifiedObjectFinder finder;
            final Iterator<AuthorityFactory> it = fromFactoryRegistry().iterator();
View Full Code Here

        finder.setFullScanAllowed(false);
        assertNull("Should not find the CRS without a scan.",
                   finder.find(DefaultGeographicCRS.WGS84));

        finder.setFullScanAllowed(true);
        IdentifiedObject find = finder.find(DefaultGeographicCRS.WGS84);
        assertNotNull("With scan allowed, should find the CRS.", find);
        assertTrue(CRS.equalsIgnoreMetadata(DefaultGeographicCRS.WGS84, find));
        assertEquals("Expected a right-handed CS.", +90, getAngle((CoordinateReferenceSystem) find), EPS);
        /*
         * Search a CRS using (latitude,longitude) axis order. The IdentifiedObjectFinder
View Full Code Here

  protected abstract Set generateAuthorityCodes( Class type ) throws FactoryException;

  public abstract InternationalString getDescriptionText(String codethrows FactoryException;
  public IdentifiedObject createObject(String code) throws FactoryException {
    final String key = toKey(code);
    IdentifiedObject obj = (IdentifiedObject) cache.get(key);
    if (obj == null) {
      try {
        cache.writeLock(key);
        obj = (IdentifiedObject) cache.peek(key);
        if (obj == null) {
View Full Code Here

  //
  // AuthorityFactory
  //   
  public IdentifiedObject createObject(String code) throws FactoryException {
    final String key = toKey(code);
    IdentifiedObject obj = (IdentifiedObject) cache.get(key);
    if (obj == null) {
      try {
        cache.writeLock(key);
        obj = (IdentifiedObject) cache.peek(key);
        if (obj == null) {
View Full Code Here

             *
             * TODO: avoid to search for the same object twice. For now we consider that this
             *       is not a big deal if the same object is searched twice; it is "just" a
             *       waste of CPU.
             */
            IdentifiedObject candidate;
            candidate = (IdentifiedObject) findCache.get(object);
           
            if (candidate == null) {
                // Must delegates to 'finder' (not to 'super') in order to take
                // advantage of the method overriden by AllAuthoritiesFactory.
                IdentifiedObject found = finder.find(object);
                if (found != null) {
                    try {
                        findCache.writeLock(object);
                        candidate = (IdentifiedObject) findCache.peek(object);
                        if( candidate == null ){
View Full Code Here

TOP

Related Classes of org.opengis.referencing.IdentifiedObject

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.