当前位置: 首页>>代码示例>>Java>>正文


Java FeatureStore.getSchema方法代码示例

本文整理汇总了Java中org.geotools.data.FeatureStore.getSchema方法的典型用法代码示例。如果您正苦于以下问题:Java FeatureStore.getSchema方法的具体用法?Java FeatureStore.getSchema怎么用?Java FeatureStore.getSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.geotools.data.FeatureStore的用法示例。


在下文中一共展示了FeatureStore.getSchema方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveAll

import org.geotools.data.FeatureStore; //导入方法依赖的package包/类
/**
 * Method to store analysed image params in a table on the DDBB for posterior data mining
 *
 * @param layer
 * @param projection
 * @param imageCis
 */
public void saveAll(GeometryImage layer, String projection, Object[] imageCis,GeoImageReader gir) {
    try {
    	//Data store to get access to ddbb
        DataStore datastore = (DataStore) DataStoreFinder.getDataStore(config);
        //Access to the corresponding Imagery table on ddbb
        FeatureStore featurestore = (FeatureStore) datastore.getFeatureSource(imageCis[0].toString());
        SimpleFeatureType featuretype = (SimpleFeatureType) featurestore.getSchema();
        FeatureCollection features = createTabFeatures(featuretype,imageCis);
        featurestore.addFeatures(features);
        writeToDB(datastore, features);
        datastore.dispose();
        // store extracted VDS points
        save(null,projection,((SarImageReader)gir).getGeoTransform());
    } catch (Exception ex) {
    	logger.error(ex.getMessage(),ex);
    }
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:25,代码来源:PostgisIO.java

示例2: save

import org.geotools.data.FeatureStore; //导入方法依赖的package包/类
/**
* Save the corresponding VDS into corresponding format [kmz,xml,ddbb]
* @param layer
* @param projection
*/
  @Override
  public void save(File output, String projection,GeoTransform transform) {
      try {
      	//Data store to get access to ddbb
          DataStore datastore = (DataStore) DataStoreFinder.getDataStore(config);
          //Access to the corresponding VDS layer on ddbb f.i: 'VESSELS'
          FeatureStore featurestore = (FeatureStore) datastore.getFeatureSource(layername);
          SimpleFeatureType featuretype = (SimpleFeatureType) featurestore.getSchema();
          /* @FIX I need explanation
           impleFeatureTypeBuilder builder =  new SimpleFeatureTypeBuilder();
          builder.setName(featuretype.getName());

          builder.setCRS(featuretype.getCoordinateReferenceSystem());
          System.out.println(featuretype.getDescriptors().size());
          //build the type
          //SimpleFeatureType type = builder.buildFeatureType();
          // System.out.println(type.getDescriptors().size());
          //*/
          FeatureCollection features = createFeatures(featuretype, glayer, projection, gir.getGeoTransform());
          featurestore.addFeatures(features);
          writeToDB(datastore, features);
          datastore.dispose();


      } catch (Exception ex) {
      	logger.error(ex.getMessage(),ex);
      }
  }
 
开发者ID:ec-europa,项目名称:sumo,代码行数:34,代码来源:PostgisIO.java

示例3: addFeatures

import org.geotools.data.FeatureStore; //导入方法依赖的package包/类
/**
 * see interface for details.
 * @param fc
 *
 * @throws IOException
 */
public List<FeatureId> addFeatures(FeatureCollection<SimpleFeatureType, SimpleFeature> fc) throws IOException {
    FeatureStore<SimpleFeatureType, SimpleFeature> store = store();

    //check if the feature collection needs to be retyped
    if (!store.getSchema().equals(fc.getSchema())) {
        fc = new RetypingFeatureCollection(DataUtilities.simple(fc), store.getSchema());
    }

    return store().addFeatures(fc);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:17,代码来源:GeoServerFeatureStore.java

示例4: setFeatures

import org.geotools.data.FeatureStore; //导入方法依赖的package包/类
/**
 * DOCUMENT ME!
 *
 * @param reader DOCUMENT ME!
 *
 * @throws IOException DOCUMENT ME!
 */
public void setFeatures(FeatureReader<SimpleFeatureType, SimpleFeature> reader) throws IOException {
    FeatureStore<SimpleFeatureType, SimpleFeature> store = store();

    //check if the feature reader needs to be retyped
    if (!store.getSchema().equals(reader.getFeatureType())) {
        reader = new RetypingFeatureCollection.RetypingFeatureReader(reader, store.getSchema());
    }

    store().setFeatures(reader);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:18,代码来源:GeoServerFeatureStore.java


注:本文中的org.geotools.data.FeatureStore.getSchema方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。