Examples of FeatureType


Examples of org.opengis.feature.type.FeatureType

    public FeatureTypeInfo buildFeatureType( FeatureSource featureSource )  {
        if ( store == null || !( store instanceof DataStoreInfo ) ) {
            throw new IllegalStateException( "Data store not set.");
        }
       
        FeatureType featureType = featureSource.getSchema();
       
        FeatureTypeInfo ftinfo = catalog.getFactory().createFeatureType();
        ftinfo.setStore( store );
        ftinfo.setEnabled(true);
       
        //naming
        ftinfo.setNativeName( featureType.getName().getLocalPart() );
        ftinfo.setName( featureType.getName().getLocalPart() );
       
        WorkspaceInfo workspace = store.getWorkspace();
        NamespaceInfo namespace = catalog.getNamespaceByPrefix( workspace.getName() );
        if ( namespace == null ) {
            namespace = catalog.getDefaultNamespace();
        }
       
        ftinfo.setNamespace( namespace );
       
        CoordinateReferenceSystem crs = featureType.getCoordinateReferenceSystem();
        if (crs == null && featureType.getGeometryDescriptor() != null) {
            crs = featureType.getGeometryDescriptor().getCoordinateReferenceSystem();
        }
        ftinfo.setNativeCRS(crs);
       
        // srs look and set (by default we just use fast lookup)
        try {
            lookupSRS(ftinfo, false);
        } catch (Exception e) {
            LOGGER.log(Level.WARNING, "SRS lookup failed", e);
        }
        setupProjectionPolicy(ftinfo);
       
        // quick metadata
        ftinfo.setTitle(featureType.getName().getLocalPart());
       
        return ftinfo;
    }
View Full Code Here

Examples of org.opengis.feature.type.FeatureType

    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        //pre process parsee tree to make sure types match up
        FeatureTypeInfo meta = catalog.getFeatureTypeByName(instance.getNamespace(), instance.getName());
        if (meta != null) {
            FeatureType featureType = meta.getFeatureType();

            //go through each attribute, performing various hacks to make make sure things
            // cocher
            for (PropertyDescriptor pd : featureType.getDescriptors()) {
                if (pd instanceof AttributeDescriptor) {
                    AttributeDescriptor attributeType = (AttributeDescriptor) pd;
                    String name = attributeType.getLocalName();
                    Class type = attributeType.getType().getBinding();
View Full Code Here

Examples of org.openquark.cal.services.FeatureName.FeatureType

     * @param locale the locale associated with the empty metadata.
     * @return the correct instance of CALFeatureMetadata without any fields initialized
     */
    public static CALFeatureMetadata getEmptyMetadata(CALFeatureName featureName, Locale locale) {
       
        FeatureType type = featureName.getType();
       
        if (type == CALFeatureName.FUNCTION) {
            return new FunctionMetadata(featureName, locale);
           
        } else if (type == CALFeatureName.CLASS_METHOD) {
View Full Code Here

Examples of ucar.nc2.constants.FeatureType

  private static void mergeOverwriteDataType( ThreddsMetadataBuilder first,
                                              ThreddsMetadataBuilder second,
                                              ThreddsMetadataBuilder mergedThreddsMetadata )
  {
    FeatureType dataType = second.getDataType() != null ? second.getDataType() : first.getDataType();
    if ( dataType != null )
      mergedThreddsMetadata.setDataType( dataType );
  }
View Full Code Here

Examples of ucar.nc2.constants.FeatureType

          }

        } else if (elem.getName().equals("typedDatasetFactory")) {
          String typeName = elem.getAttributeValue("datatype");
          String className = elem.getAttributeValue("class");
          FeatureType datatype = FeatureType.valueOf(typeName.toUpperCase());
          if (null == datatype) {
            errlog.append("TypedDatasetFactory "+className+" unknown datatype= "+typeName+"\n");
            continue;
          }
View Full Code Here

Examples of ucar.nc2.constants.FeatureType

  private void amendFromODL(NetcdfFile ncfile, String structMetadata) throws IOException {
    Group rootg = ncfile.getRootGroup();

    ODLparser parser = new ODLparser();
    Element root = parser.parseFromString(structMetadata); // now we have the ODL in JDOM elements
    FeatureType featureType = null;

    // SWATH
    Element swathStructure = root.getChild("SwathStructure");
    if (swathStructure != null) {
      List<Element> swaths = (List<Element>) swathStructure.getChildren();
      for (Element elemSwath : swaths) {
        Element swathNameElem = elemSwath.getChild("SwathName");
        if (swathNameElem == null) {
          log.warn("No SwathName element in " + elemSwath.getName());
          continue;
        }
        String swathName = swathNameElem.getText();
        Group swathGroup = findGroupNested(rootg, swathName);
        //if (swathGroup == null)
        //  swathGroup = findGroupNested(rootg, H4header.createValidObjectName(swathName));

        if (swathGroup != null) {
          featureType = amendSwath(ncfile, elemSwath, swathGroup);
        } else {
          log.warn("Cant find swath group " + swathName);
        }
      }
    }

    // GRID
    Element gridStructure = root.getChild("GridStructure");
    if (gridStructure != null) {
      List<Element> grids = (List<Element>) gridStructure.getChildren();
      for (Element elemGrid : grids) {
        Element gridNameElem = elemGrid.getChild("GridName");
        if (gridNameElem == null) {
          log.warn("Ne GridName element in " + elemGrid.getName());
          continue;
        }
        String gridName = gridNameElem.getText();
        Group gridGroup = findGroupNested(rootg, gridName);
        //if (gridGroup == null)
        //  gridGroup = findGroupNested(rootg, H4header.createValidObjectName(gridName));
        if (gridGroup != null) {
          featureType = amendGrid(elemGrid, gridGroup);
        } else {
          log.warn("Cant find Grid group " + gridName);
        }
      }
    }

    // POINT - NOT DONE YET
    Element pointStructure = root.getChild("PointStructure");
    if (pointStructure != null) {
      List<Element> pts = (List<Element>) pointStructure.getChildren();
      for (Element elem : pts) {
        Element nameElem = elem.getChild("PointName");
        if (nameElem == null) {
          log.warn("No PointName element in " + elem.getName());
          continue;
        }
        String name = nameElem.getText();
        Group ptGroup = findGroupNested(rootg, name);
        //if (ptGroup == null)
        //  ptGroup = findGroupNested(rootg, H4header.createValidObjectName(name));
        if (ptGroup != null) {
          featureType = FeatureType.POINT;
        } else {
          log.warn("Cant find Point group " + name);
        }
      }
    }

    if (featureType != null) {
      if (showWork) System.out.println("***EOS featureType= "+featureType.toString());
      rootg.addAttribute(new Attribute("cdm_data_type", featureType.toString()));
    }

  }
View Full Code Here

Examples of ucar.nc2.constants.FeatureType

    }

  }

  private FeatureType amendSwath(NetcdfFile ncfile, Element swathElem, Group parent) {
    FeatureType featureType = FeatureType.SWATH;
    List<Dimension> unknownDims = new ArrayList<Dimension>();

    // Dimensions
    Element d = swathElem.getChild("Dimension");
    List<Element> dims = (List<Element>) d.getChildren();
View Full Code Here

Examples of ucar.nc2.constants.FeatureType

   * @param key if starts with ":", replace with value of global attribute
   * @param errlog error messages here
   * @return featureType, or null
   */
  static public FeatureType getFeatureType(NetcdfDataset ds, String key, Formatter errlog) {
    FeatureType ft = null;
    String fts = getLiteral(ds, key, errlog);
    if (fts != null) {
      ft = FeatureType.valueOf(fts.toUpperCase());
      if ((ft == null) && (errlog != null))
        errlog.format(" Cant find Feature type %s from %s\n", fts, key);
View Full Code Here

Examples of ucar.nc2.constants.FeatureType

        assertNotNull( catBuilder );

        DatasetBuilder dsBldr = CatalogXmlUtils.assertCatalogWithContainerDatasetAsExpected( catBuilder, docBaseUri );
        ThreddsMetadataBuilder tmdBldr = dsBldr.getThreddsMetadataBuilder();
        FeatureType dataType = tmdBldr.getDataType();
        assertEquals( dataType, FeatureType.RADIAL );
    }
View Full Code Here

Examples of ucar.nc2.constants.FeatureType

  }

  private void checkIfTrajectory(TableConfig st) {
    // deal with possible trajectory - only do this if dataset has metadata
    FeatureType ft = FeatureDatasetFactoryManager.findFeatureType(ds);
    if (ft == FeatureType.TRAJECTORY) {
      st.featureType = FeatureType.TRAJECTORY;
      TableConfig pc = new TableConfig(Table.Type.Top, "single");
      st.parent = pc;
      pc.addChild(st);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.